File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -585,7 +585,8 @@ command! InsertNewBullet call <SID>insert_new_bullet()
585585" Helper for Colon Indent
586586" returns 1 if current line ends in a colon, else 0
587587fun ! s: line_ends_in_colon (lnum)
588- return getline (a: lnum )[strlen (getline (a: lnum ))-1 :] == # ' :'
588+ let l: last_char_nr = strgetchar (getline (a: lnum ), strcharlen (getline (a: lnum ))-1 )
589+ return l: last_char_nr == 65306 || l: last_char_nr == 58
589590endfun
590591" --------------------------------------------------------- }}}
591592
Original file line number Diff line number Diff line change 593593 \t i. this bullet is indented
594594 \t ii. this bullet is also indented
595595 TEXT
596+
597+ write_file ( filename , <<-TEXT )
598+ # Hello there
599+ a. this is the first bullet
600+ TEXT
601+
602+ vim . command 'let g:bullets_auto_indent_after_colon = 1'
603+ vim . edit filename
604+ vim . feedkeys '\<ESC>'
605+ vim . type 'GA'
606+ vim . feedkeys '\<cr>'
607+ vim . type 'this is the second bullet that ends with fullwidth colon:'
608+ vim . feedkeys '\<cr>'
609+ vim . type 'this bullet is indented'
610+ vim . feedkeys '\<cr>'
611+ vim . type 'this bullet is also indented'
612+ vim . write
613+
614+ file_contents = IO . read ( filename )
615+
616+ expect ( file_contents . strip ) . to eq normalize_string_indent ( <<-TEXT )
617+ # Hello there
618+ a. this is the first bullet
619+ b. this is the second bullet that ends with fullwidth colon:
620+ \t i. this bullet is indented
621+ \t ii. this bullet is also indented
622+ TEXT
596623 end
597624 end
598625end
You can’t perform that action at this time.
0 commit comments