X-Git-Url: http://www.git.stargrave.org/?p=codecomm.git;a=blobdiff_plain;f=plugin%2Fcodecomm.vim;fp=plugin%2Fcodecomm.vim;h=4f9d4eca9f0c8e3fe57c87b8870f170c4d248331;hp=1b6d1e1ed0eb849ddb057c2f65bf67f14167964a;hb=ca495ac6c5d03265caaa8e2b2357cd704ed80d5c;hpb=96b4b0f835ee3696faccaf4da397a64fd7c26c54 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()