Skip to content

Commit 3598248

Browse files
committed
Fixed bad empty test
1 parent e9fe46a commit 3598248

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

plugin/bullets.vim

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ endfun
157157
fun! s:parse_bullet_text(line_text)
158158

159159
if s:bullet_cache isnot v:null
160-
let l:cached = get(s:bullet_cache, l:line_text, v:null)
160+
let l:cached = get(s:bullet_cache, a:line_text, v:null)
161161
if l:cached isnot v:null
162162
" Return a copy so as not to break the referene
163163
return copy(l:cached)
@@ -166,15 +166,15 @@ fun! s:parse_bullet_text(line_text)
166166

167167
let l:bullet = s:match_bullet_list_item(a:line_text)
168168
" Must be a bullet to be a checkbox
169-
let l:check = !empty(l:bullet) ? s:match_checkbox_bullet_item(a:line_text) : v:null
169+
let l:check = !empty(l:bullet) ? s:match_checkbox_bullet_item(a:line_text) : {}
170170
" Cannot be numeric if a bullet
171-
let l:num = empty(l:bullet) ? s:match_numeric_list_item(a:line_text) : v:null
171+
let l:num = empty(l:bullet) ? s:match_numeric_list_item(a:line_text) : {}
172172
" Cannot be alphabetic if numeric or a bullet
173-
let l:alpha = empty(l:bullet) && empty(l:num) ? s:match_alphabetical_list_item(a:line_text) : v:null
173+
let l:alpha = empty(l:bullet) && empty(l:num) ? s:match_alphabetical_list_item(a:line_text) : {}
174174
" Cannot be roman if numeric or a bullet
175-
let l:roman = empty(l:bullet) && empty(l:num) ? s:match_roman_list_item(a:line_text) : v:null
175+
let l:roman = empty(l:bullet) && empty(l:num) ? s:match_roman_list_item(a:line_text) : {}
176176

177-
let l:kinds = s:filter([l:bullet, l:check, l:num, l:alpha, l:roman], 'v:val isnot v:null')
177+
let l:kinds = s:filter([l:bullet, l:check, l:num, l:alpha, l:roman], '!empty(v:val)')
178178

179179
if s:bullet_cache isnot v:null
180180
let s:bullet_cache[a:line_text] = l:kinds

0 commit comments

Comments
 (0)