From 677a80c4ed5134ff897b7f69586e83586f070126 Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Tue, 24 Sep 2019 11:25:48 +0100 Subject: [PATCH] Only show intra line highlights in Vim popups when supported --- autoload/gitgutter/hunk.vim | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/autoload/gitgutter/hunk.vim b/autoload/gitgutter/hunk.vim index 7bd2e93..6225ff3 100644 --- a/autoload/gitgutter/hunk.vim +++ b/autoload/gitgutter/hunk.vim @@ -476,10 +476,12 @@ function! s:populate_hunk_preview_window(header, body) if exists('*popup_create') call popup_settext(s:winid, a:body) - for region in gitgutter#diff_highlight#process(a:body) - let type = region[1] == '+' ? 'gitgutter_add_intra_line' : 'gitgutter_delete_intra_line' - call prop_add(region[0], region[2], {'bufnr': winbufnr(s:winid), 'type': type, 'end_col': region[3]+1}) - endfor + if has('patch-8.1.2071') + for region in gitgutter#diff_highlight#process(a:body) + let type = region[1] == '+' ? 'gitgutter_add_intra_line' : 'gitgutter_delete_intra_line' + call prop_add(region[0], region[2], {'bufnr': winbufnr(s:winid), 'type': type, 'end_col': region[3]+1}) + endfor + endif endif else