Save "/ buffer, fix #35

This commit is contained in:
David Beniamine
2018-12-23 16:49:16 +01:00
parent 259125d9ef
commit 93480dd2c7

View File

@@ -65,12 +65,22 @@ function! todo#PrependDate()
endif endif
endfunction endfunction
function todo#SaveRegisters()
let s:last_search=@/
endfunction
function todo#RestoreRegisters()
let @/=s:last_search
endfunction
function! todo#ToggleMarkAsDone(status) function! todo#ToggleMarkAsDone(status)
call todo#SaveRegisters()
if (getline(".") =~ '\C^x\s*\d\{4\}') if (getline(".") =~ '\C^x\s*\d\{4\}')
:call todo#UnMarkAsDone(a:status) :call todo#UnMarkAsDone(a:status)
else else
:call todo#MarkAsDone(a:status) :call todo#MarkAsDone(a:status)
endif endif
call todo#RestoreRegisters()
endfunction endfunction
function! todo#FixFormat() function! todo#FixFormat()