Skip to content

Commit a540d3d

Browse files
committed
Handle case with no detected checkbox
1 parent 23576aa commit a540d3d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

plugin/bullets.vim

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,10 @@ endfun
558558
fun! s:set_checkbox(lnum, marker)
559559
let l:initpos = getpos('.')
560560
let l:pos = s:find_checkbox_position(a:lnum)
561-
call s:replace_char_in_line(a:lnum, l:pos, a:marker)
562-
call setpos('.', l:initpos)
561+
if l:pos >= 0
562+
call s:replace_char_in_line(a:lnum, l:pos, a:marker)
563+
call setpos('.', l:initpos)
564+
endif
563565
endfun
564566

565567
fun! s:toggle_checkboxes_nested()

0 commit comments

Comments
 (0)