@@ -288,9 +288,9 @@ fun! s:match_checkbox_bullet_item(input_text)
288288 " match any symbols listed in g:bullets_checkbox_markers as well as the
289289 " default ' ', 'x', and 'X'
290290 let l: checkbox_bullet_regex =
291- \ ' \v(^(\s*)([-\*] \[(['
291+ \ ' \v(^(\s*)([+ -\*] \[(['
292292 \ . g: bullets_checkbox_markers
293- \ . ' xX])?\])(\s+))(.*)'
293+ \ . ' xX])?\])(:?)( \s+))(.*)'
294294 let l: matches = matchlist (a: input_text , l: checkbox_bullet_regex )
295295
296296 if empty (l: matches )
@@ -301,16 +301,17 @@ fun! s:match_checkbox_bullet_item(input_text)
301301 let l: leading_space = l: matches [2 ]
302302 let l: bullet = l: matches [3 ]
303303 let l: checkbox_marker = l: matches [4 ]
304- let l: trailing_space = l: matches [5 ]
305- let l: text_after_bullet = l: matches [6 ]
304+ let l: trailing_char = l: matches [5 ]
305+ let l: trailing_space = l: matches [6 ]
306+ let l: text_after_bullet = l: matches [7 ]
306307
307308 return {
308309 \ ' bullet_type' : ' chk' ,
309310 \ ' bullet_length' : l: bullet_length ,
310311 \ ' leading_space' : l: leading_space ,
311312 \ ' bullet' : l: bullet ,
312313 \ ' checkbox_marker' : l: checkbox_marker ,
313- \ ' closure' : ' ' ,
314+ \ ' closure' : l: trailing_char ,
314315 \ ' trailing_space' : l: trailing_space ,
315316 \ ' text_after_bullet' : l: text_after_bullet
316317 \ }
@@ -631,14 +632,21 @@ command! InsertNewBullet call <SID>insert_new_bullet()
631632" Helper for Colon Indent
632633" returns 1 if current line ends in a colon, else 0
633634fun ! s: line_ends_in_colon (lnum)
634- return getline (a: lnum )[strlen (getline (a: lnum ))-1 :] == # ' :'
635+ let l: line = getline (a: lnum )
636+ if exists (" *strcharlen" ) && exists (" *strgetchar" )
637+ let l: last_char_nr = strgetchar (l: line , strcharlen (l: line )-1 )
638+ return l: last_char_nr == 65306 || l: last_char_nr == 58
639+ else
640+ " Older versions of vim do not support strchar*
641+ return l: line [strlen (l: line )-1 :] == # ' :'
642+ endif
635643endfun
636644" --------------------------------------------------------- }}}
637645
638646" Checkboxes ---------------------------------------------- {{{
639647fun ! s: find_checkbox_position (lnum)
640648 let l: line_text = getline (a: lnum )
641- return matchend (l: line_text , ' \v\s*(\*|-) \[' )
649+ return matchend (l: line_text , ' \v\s*(\*|-|\+ ) \[' )
642650endfun
643651
644652fun ! s: select_checkbox (inner)
0 commit comments