File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6161if ! exists (' g:bullets_max_alpha_characters' )
6262 let g: bullets_max_alpha_characters = 2
6363end
64+
65+ if ! exists (' g:bullets_enable_roman_list' )
66+ let g: bullets_enable_roman_list = 1
67+ end
68+
6469" calculate the decimal equivalent to the last alphabetical list item
6570let s: power = g: bullets_max_alpha_characters
6671let s: abc_max = -1
@@ -166,6 +171,10 @@ endfun
166171
167172
168173fun ! s: match_roman_list_item (input_text)
174+ if g: bullets_enable_roman_list == 0
175+ return {}
176+ endif
177+
169178 let l: rom_bullet_regex = join ([
170179 \ ' \v\C' ,
171180 \ ' ^(' ,
Original file line number Diff line number Diff line change 293293 -
294294 TEXT
295295 end
296+
297+ it 'toggles roman numeral bullets with g:bullets_enable_roman_list' do
298+ filename = "#{ SecureRandom . hex ( 6 ) } .txt"
299+ write_file ( filename , <<-TEXT )
300+ # Hello there
301+ i. this is the first bullet
302+ TEXT
303+
304+ # Disable alpha lists to isolate test to roman numerals
305+ vim . command 'let g:bullets_max_alpha_characters = 0'
306+ vim . command 'let g:bullets_enable_roman_list = 1'
307+ vim . edit filename
308+ vim . type 'GA'
309+ vim . feedkeys '\<cr>'
310+ vim . type 'second bullet'
311+ vim . feedkeys '\<cr>'
312+ vim . type 'third bullet'
313+ vim . command 'let g:bullets_enable_roman_list = 0'
314+ vim . feedkeys '\<cr>'
315+ vim . type 'fourth bullet'
316+ vim . feedkeys '\<cr>'
317+ vim . type 'fifth bullet'
318+ vim . write
319+
320+ file_contents = IO . read ( filename )
321+
322+ expect ( file_contents ) . to eq normalize_string_indent ( <<-TEXT )
323+ # Hello there
324+ i. this is the first bullet
325+ ii. second bullet
326+ iii. third bullet
327+ fourth bullet
328+ fifth bullet\n
329+ TEXT
330+ end
296331 end
297332 end
298333end
You can’t perform that action at this time.
0 commit comments