File tree 3 files changed +26
-2
lines changed
3 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 1
1
" Vim plugin for automated bulleted lists
2
- " Last Change: Tue 18 Apr 2017
2
+ " Last Change: Sun 15 Oct 2017
3
3
" Maintainer: Dorian Karter
4
4
" License: MIT
5
5
" FileTypes: markdown, text, gitcommit
@@ -85,7 +85,7 @@ fun! s:match_roman_list_item(input_text)
85
85
endfun
86
86
87
87
fun ! s: match_bullet_list_item (input_text)
88
- let l: std_bullet_regex = ' \v(^\s*(-|*|\\item)( \[[x ]?\])? )(.*)'
88
+ let l: std_bullet_regex = ' \v(^\s*(-|*|#.| \\item)( \[[x ]?\])? )(.*)'
89
89
let l: matches = matchlist (a: input_text , l: std_bullet_regex )
90
90
91
91
if empty (l: matches )
Original file line number Diff line number Diff line change 53
53
EOF
54
54
end
55
55
56
+ it 'adds a pandoc bullet if the prev line had one' do
57
+ filename = "#{ SecureRandom . hex ( 6 ) } .md"
58
+ write_file ( filename , <<-EOF )
59
+ Hello there
60
+ #. this is the first bullet
61
+ EOF
62
+
63
+ vim . edit filename
64
+ vim . type 'GA'
65
+ vim . feedkeys '\<cr>'
66
+ vim . type 'second bullet'
67
+ vim . write
68
+
69
+ file_contents = IO . read ( filename )
70
+
71
+ expect ( file_contents ) . to eq normalize_string_indent ( <<-EOF )
72
+ Hello there
73
+ #. this is the first bullet
74
+ #. second bullet\n
75
+ EOF
76
+ end
77
+
56
78
it 'adds a new numeric bullet if the previous line had numeric bullet' do
57
79
filename = "#{ SecureRandom . hex ( 6 ) } .md"
58
80
write_file ( filename , <<-EOF )
96
118
second line\n
97
119
EOF
98
120
end
121
+
99
122
it 'adds a new roman numeral bullet' do
100
123
filename = "#{ SecureRandom . hex ( 6 ) } .md"
101
124
write_file ( filename , <<-EOF )
Original file line number Diff line number Diff line change 1
1
require 'vimrunner'
2
2
require 'vimrunner/rspec'
3
+ require 'securerandom'
3
4
4
5
Vimrunner ::RSpec . configure do |config |
5
6
# Use a single Vim instance for the test suite. Set to false to use an
You can’t perform that action at this time.
0 commit comments