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>