File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -558,8 +558,10 @@ endfun
558558fun ! 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
563565endfun
564566
565567fun ! s: toggle_checkboxes_nested ()
Original file line number Diff line number Diff line change 3535 - [.] fourth bullet
3636 - [o] fifth bullet
3737 - [O] sixth bullet
38+ - not a checkbox
3839 TEXT
3940
4041 vim . edit filename
5051 vim . command 'ToggleCheckbox'
5152 vim . normal 'j'
5253 vim . command 'ToggleCheckbox'
54+ vim . normal 'j'
55+ vim . command 'ToggleCheckbox'
5356 vim . write
5457
5558 file_contents = IO . read ( filename )
6265 - [X] fourth bullet
6366 - [X] fifth bullet
6467 - [X] sixth bullet
68+ - not a checkbox
6569
6670 TEXT
6771 end
You can’t perform that action at this time.
0 commit comments