From 2efc471969c1f8bbf00be0a27ed205a7d14b0106 Mon Sep 17 00:00:00 2001 From: David Beniamine Date: Fri, 13 Mar 2015 10:03:32 -0300 Subject: [PATCH] Add: prioritize update the priority When there is already a priority in the line, we update it instead of adding a new one --- ftplugin/todo.vim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ftplugin/todo.vim b/ftplugin/todo.vim index 81cd633..64b83e0 100644 --- a/ftplugin/todo.vim +++ b/ftplugin/todo.vim @@ -111,8 +111,12 @@ function! TodoTxtPrioritizeDecrease() endfunction function! TodoTxtPrioritizeAdd (priority) - " Need to figure out how to only do this if the first visible letter in a line is not ( - :call TodoTxtPrioritizeAddAction(a:priority) + let line=getline('.') + if line !~ '^([A-F])' + :call TodoTxtPrioritizeAddAction(a:priority) + else + exec ':s/^([A-F])/('.a:priority.')/' + endif endfunction function! TodoTxtPrioritizeAddAction (priority)