aboutsummaryrefslogtreecommitdiffstats
path: root/bundle/diff-corrections
diff options
context:
space:
mode:
Diffstat (limited to 'bundle/diff-corrections')
-rw-r--r--bundle/diff-corrections/autoload/diff_corrections.vim26
1 files changed, 26 insertions, 0 deletions
diff --git a/bundle/diff-corrections/autoload/diff_corrections.vim b/bundle/diff-corrections/autoload/diff_corrections.vim
index c9e77ff..620c1b0 100644
--- a/bundle/diff-corrections/autoload/diff_corrections.vim
+++ b/bundle/diff-corrections/autoload/diff_corrections.vim
@@ -1,3 +1,5 @@
+let s:old_cursorline = &cursorline
+
function! diff_corrections#Run()
if &diff
if exists('g:colors_name') && g:colors_name ==# 'twilight256'
@@ -5,5 +7,29 @@ function! diff_corrections#Run()
endif
set nocursorline
+ else
+ if exists('g:colors_name') && g:colors_name ==# 'twilight256'
+ execute 'highlight ' . s:old_highlight_comment
+ endif
+
+ let &cursorline = s:old_cursorline
endif
endfunction
+
+
+function! s:SaveCommentColor()
+ redir => old_highlight
+ silent highlight Comment
+ redir END
+
+ let parts = split(old_highlight, ' ')
+ call filter(parts, {_idx, val -> val !=? "" && val !=? "xxx"})
+
+ let restore = join(parts, ' ')
+
+ " Remove ^@ character from the beginning that messes up the `execute` call
+ return restore[1:]
+endfunction
+
+
+let s:old_highlight_comment = s:SaveCommentColor()