Skip to content

Commit

Permalink
Used fallback to support old vim
Browse files Browse the repository at this point in the history
  • Loading branch information
harshad1 committed Apr 21, 2024
1 parent 0664f78 commit 9416e79
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions plugin/bullets.vim
Original file line number Diff line number Diff line change
Expand Up @@ -632,8 +632,14 @@ command! InsertNewBullet call <SID>insert_new_bullet()
" Helper for Colon Indent
" returns 1 if current line ends in a colon, else 0
fun! s:line_ends_in_colon(lnum)
let l:last_char_nr = strgetchar(getline(a:lnum), strcharlen(getline(a:lnum))-1)
return l:last_char_nr == 65306 || l:last_char_nr == 58
let l:line = getline(a:lnum)
# Older versions of vim do not support strchar*
if exists("*strcharlen") && exists("*strcharget")
let l:last_char_nr = strgetchar(l:line, strcharlen(l:line)-1)
return l:last_char_nr == 65306 || l:last_char_nr == 58
else
return l:line[strlen(l:line)-1:] ==# ':'
endif
endfun
" --------------------------------------------------------- }}}

Expand Down

0 comments on commit 9416e79

Please sign in to comment.