Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions plugin/bullets.vim
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ fun! s:match_checkbox_bullet_item(input_text)
" match any symbols listed in g:bullets_checkbox_markers as well as the
" default ' ', 'x', and 'X'
let l:checkbox_bullet_regex =
\ '\v(^(\s*)([-\*] \[(['
\ '\v(^(\s*)(%([-\*\+]|\d+\.) \[(['
\ . g:bullets_checkbox_markers
\ . ' xX])?\])(\s+))(.*)'
let l:matches = matchlist(a:input_text, l:checkbox_bullet_regex)
Expand Down Expand Up @@ -814,19 +814,22 @@ command! RenumberList call <SID>renumber_whole_list()
" Changing outline level ---------------------------------- {{{
fun! s:change_bullet_level(direction)
let l:lnum = line('.')
let l:col = col('.')
let l:curr_line = s:parse_bullet(l:lnum, getline(l:lnum))

if a:direction == 1
if l:curr_line != [] && indent(l:lnum) == 0
" Promoting a bullet at the highest level will delete the bullet
call setline(l:lnum, l:curr_line[0].text_after_bullet)
execute 'normal! $'
call cursor(line('.'), l:col - len(l:curr_line[0].leading_space) - len(l:curr_line[0].bullet) - len(l:curr_line[0].trailing_space))
return
else
execute 'normal! <<$'
execute 'normal! <<'
call cursor(line('.'), l:col - shiftwidth())
endif
else
execute 'normal! >>$'
execute 'normal! >>'
call cursor(line('.'), l:col + shiftwidth())
endif

if l:curr_line == []
Expand Down Expand Up @@ -921,7 +924,6 @@ fun! s:change_bullet_level(direction)
" Apply the new bullet
call setline(l:lnum, l:next_bullet_str)

execute 'normal! $'
return
endfun

Expand Down