Prioritize: preserve cursor position
This commit is contained in:
@@ -111,12 +111,15 @@ function! TodoTxtPrioritizeDecrease()
|
|||||||
normal! 0f)h
|
normal! 0f)h
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! TodoTxtPrioritizeAdd (priority)
|
||||||
let oldpos=getcurpos()
|
let oldpos=getcurpos()
|
||||||
let line=getline('.')
|
let line=getline('.')
|
||||||
if line !~ '^([A-F])'
|
if line !~ '^([A-F])'
|
||||||
|
:call TodoTxtPrioritizeAddAction(a:priority)
|
||||||
let oldpos[2]+=4
|
let oldpos[2]+=4
|
||||||
else
|
else
|
||||||
exec ':s/^([A-F])/('.a:priority.')/'
|
exec ':s/^([A-F])/('.a:priority.')/'
|
||||||
|
endif
|
||||||
call setpos('.',oldpos)
|
call setpos('.',oldpos)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user