]> Sergey Matveev's repositories - codecomm.git/blobdiff - plugin/codecomm.vim
Counter state in external file
[codecomm.git] / plugin / codecomm.vim
index 1b6d1e1ed0eb849ddb057c2f65bf67f14167964a..4f9d4eca9f0c8e3fe57c87b8870f170c4d248331 100644 (file)
@@ -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 <line1>, <line2> call <SID>CCRangeWrapper()
 vnoremap <silent><Leader>cc :call <SID>CCRangeWrapper()<CR>