Skip to content

Commit

Permalink
Merge pull request #53 from the-zeitgeist/master
Browse files Browse the repository at this point in the history
validate nvim_buf_set_extmark existance
  • Loading branch information
APZelos authored Nov 17, 2021
2 parents ab4dc40 + 76152f2 commit f4eb22a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions autoload/blamer.vim
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,11 @@ endfunction

function! blamer#SetVirtualText(buffer_number, line_number, message) abort
let l:line_index = a:line_number - 1
call nvim_buf_set_extmark(a:buffer_number, s:blamer_namespace, l:line_index, 0, {"hl_mode": "combine", "virt_text": [[s:blamer_prefix . a:message, 'Blamer']]})
if exists('*nvim_buf_set_extmark')
call nvim_buf_set_extmark(a:buffer_number, s:blamer_namespace, l:line_index, 0, {"hl_mode": "combine", "virt_text": [[s:blamer_prefix . a:message, 'Blamer']]})
else
call nvim_buf_set_virtual_text(a:buffer_number, s:blamer_namespace, l:line_index, [[s:blamer_prefix . a:message, 'Blamer']], {})
endif
endfunction

function! blamer#CreatePopup(buffer_number, line_number, message) abort
Expand Down Expand Up @@ -237,7 +241,7 @@ function! blamer#Show() abort

let l:file_path = s:substitute_path_separator(expand('%:p'))

if empty(l:file_path)
if empty(l:file_path)
return
endif

Expand Down Expand Up @@ -288,7 +292,7 @@ endfunction

function! blamer#IsBufferGitTracked() abort
let l:file_path = shellescape(s:substitute_path_separator(expand('%:p')))
if empty(l:file_path)
if empty(l:file_path)
return 0
endif

Expand Down

0 comments on commit f4eb22a

Please sign in to comment.