Skip to content

Commit 5571a62

Browse files
author
Dorian Karter
committed
Numerical bullets must have space after them
Closes #8
1 parent f4c88e8 commit 5571a62

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

plugin/bullets.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ end
4040

4141
" Helper methods ---------------------------------------- {{{
4242
fun! s:match_numeric_list_item(input_text)
43-
let l:num_bullet_regex = '\v^((\s*)(\d+)(\.|\))(\s*))(.*)'
43+
let l:num_bullet_regex = '\v^((\s*)(\d+)(\.|\))(\s+))(.*)'
4444
let l:matches = matchlist(a:input_text, l:num_bullet_regex)
4545

4646
if empty(l:matches)

spec/bullets_spec.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,27 @@
7575
EOF
7676
end
7777

78+
it 'does not insert a new numeric bullet for decimal numbers' do
79+
filename = "#{SecureRandom.hex(6)}.md"
80+
write_file(filename, <<-EOF)
81+
# Hello there
82+
3.14159 is an approximation of pi.
83+
EOF
84+
85+
vim.edit filename
86+
vim.type 'GA'
87+
vim.feedkeys '\<cr>'
88+
vim.type 'second line'
89+
vim.write
90+
91+
file_contents = IO.read(filename)
92+
93+
expect(file_contents).to eq normalize_string_indent(<<-EOF)
94+
# Hello there
95+
3.14159 is an approximation of pi.
96+
second line\n
97+
EOF
98+
end
7899
it 'adds a new roman numeral bullet' do
79100
filename = "#{SecureRandom.hex(6)}.md"
80101
write_file(filename, <<-EOF)

0 commit comments

Comments
 (0)