Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix - strcharlen support older vim #150

Merged
merged 3 commits into from
Apr 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions plugin/bullets.vim
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,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)
if exists("*strcharlen") && exists("*strgetchar")
let l:last_char_nr = strgetchar(l:line, strcharlen(l:line)-1)
return l:last_char_nr == 65306 || l:last_char_nr == 58
else
" Older versions of vim do not support strchar*
return l:line[strlen(l:line)-1:] ==# ':'
endif
endfun
" --------------------------------------------------------- }}}

Expand Down
Loading