Skip to content

Commit

Permalink
Numerical bullets must have space after them
Browse files Browse the repository at this point in the history
Closes #8
  • Loading branch information
Dorian Karter committed Apr 18, 2017
1 parent f4c88e8 commit 5571a62
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion plugin/bullets.vim
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ end

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

if empty(l:matches)
Expand Down
21 changes: 21 additions & 0 deletions spec/bullets_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,27 @@
EOF
end

it 'does not insert a new numeric bullet for decimal numbers' do
filename = "#{SecureRandom.hex(6)}.md"
write_file(filename, <<-EOF)
# Hello there
3.14159 is an approximation of pi.
EOF

vim.edit filename
vim.type 'GA'
vim.feedkeys '\<cr>'
vim.type 'second line'
vim.write

file_contents = IO.read(filename)

expect(file_contents).to eq normalize_string_indent(<<-EOF)
# Hello there
3.14159 is an approximation of pi.
second line\n
EOF
end
it 'adds a new roman numeral bullet' do
filename = "#{SecureRandom.hex(6)}.md"
write_file(filename, <<-EOF)
Expand Down

0 comments on commit 5571a62

Please sign in to comment.