Skip to content

Commit

Permalink
Reverted removal of setpos
Browse files Browse the repository at this point in the history
  • Loading branch information
harshad1 committed Jan 27, 2024
1 parent fbdff1b commit 4d4cccc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions plugin/bullets.vim
Original file line number Diff line number Diff line change
Expand Up @@ -532,11 +532,18 @@ fun! s:insert_new_bullet()
" insert next bullet
call append(l:curr_line_num, l:next_bullet_list)


" go to next line after the new bullet
let l:col = strlen(getline(l:next_line_num)) + 1
call setpos('.', [0, l:next_line_num, l:col])

" indent if previous line ended in a colon
if l:indent_next
" demote the new bullet
call s:change_line_bullet_level(-1, l:next_line_num)
" reset cursor position after indenting
let l:col = strlen(getline(l:next_line_num)) + 1
call setpos('.', [0, l:next_line_num, l:col])
elseif g:bullets_renumber_on_change
call s:renumber_whole_list()
endif
Expand Down

0 comments on commit 4d4cccc

Please sign in to comment.