X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=plugin%2Fcodecomm.vim;h=27bd890d4be5020c83b604e16a35ccec9d81bcc3;hb=HEAD;hp=1b6d1e1ed0eb849ddb057c2f65bf67f14167964a;hpb=957dafb50459a8aa00d8bb4fb28d69b87e900e76;p=codecomm.git diff --git a/plugin/codecomm.vim b/plugin/codecomm.vim index 1b6d1e1..4f9d4ec 100644 --- a/plugin/codecomm.vim +++ b/plugin/codecomm.vim @@ -6,18 +6,17 @@ vim9script if exists("*codecomm#Do") | finish | endif -if !exists("g:codecomm_file") - g:codecomm_file = ((getenv("TMPDIR") == null) ? "/tmp" : getenv("TMPDIR")) .. - "/" .. "codecomm.txt" +if !exists("g:codecomm_txt") + var tmp = (getenv("TMPDIR") == null) ? "/tmp" : getenv("TMPDIR") + g:codecomm_txt = tmp .. "/" .. "codecomm.txt" + g:codecomm_ctr = tmp .. "/" .. "codecomm.ctr" endif -if !exists("g:codecomm_count") | g:codecomm_count = 0 | endif - function CCRangeWrapper() range call codecomm#Do(a:firstline, a:lastline, FugitiveExtractGitDir(getcwd())) endfunction command! CodeCommClear codecomm#Clear() -command! CodeCommEdit :execute "edit " .. g:codecomm_file +command! CodeCommEdit :execute "edit " .. g:codecomm_txt command! -range CodeComm , call CCRangeWrapper() vnoremap cc :call CCRangeWrapper()