Skip to content

Commit c52f957

Browse files
authored
Merge pull request #165 from mario-holubar/master
Fix promotion of top-level checkbox not removing it properly
2 parents a1d1d8b + e6ad0b7 commit c52f957

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

plugin/bullets.vim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ fun! s:parse_bullet_text(line_text)
161161
if s:bullet_cache isnot v:null
162162
let l:cached = get(s:bullet_cache, a:line_text, v:null)
163163
if l:cached isnot v:null
164-
" Return a copy so as not to break the referene
164+
" Return a copy so as not to break the reference
165165
return copy(l:cached)
166166
endif
167167
endif
@@ -177,11 +177,11 @@ fun! s:parse_bullet_text(line_text)
177177
let l:roman = empty(l:bullet) && empty(l:num) ? s:match_roman_list_item(a:line_text) : {}
178178

179179
let l:kinds = s:filter([l:bullet, l:check, l:num, l:alpha, l:roman], '!empty(v:val)')
180-
180+
181181
if s:bullet_cache isnot v:null
182182
let s:bullet_cache[a:line_text] = l:kinds
183183
endif
184-
184+
185185
return l:kinds
186186
endfun
187187

@@ -971,7 +971,7 @@ fun! s:change_line_bullet_level(direction, lnum)
971971
if a:direction == 1
972972
if l:curr_line != [] && indent(a:lnum) == 0
973973
" Promoting a bullet at the highest level will delete the bullet
974-
call setline(a:lnum, l:curr_line[0].text_after_bullet)
974+
call setline(a:lnum, l:curr_line[-1].text_after_bullet)
975975
return
976976
else
977977
execute a:lnum . 'normal! <<'

0 commit comments

Comments
 (0)