1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
function! todo#Escalate()
let todo = getline('.')
" First non-whitespace character
let col = match(todo, '\S')
let priority = todo[col]
if priority ==# '_'
let todo = substitute(todo, '_', '-', '')
elseif priority ==# '-'
let todo = substitute(todo, '-', '!', '')
endif
call setline(line('.'), todo)
endfunction
function! todo#Descalate()
let todo = getline('.')
" First non-whitespace character
let col = match(todo, '\S')
let priority = todo[col]
if priority ==# '!'
let todo = substitute(todo, '!', '-', '')
elseif priority ==# '-'
let todo = substitute(todo, '-', '_', '')
endif
call setline(line('.'), todo)
endfunction
|