From bc96014f9504d6068a0f53d1679fb7db6ee63cc4 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 14 Mar 2023 19:53:44 +1300 Subject: Turn off line/column highlighting options too This can almost certainly be better-structured. --- autoload/copy_linebreak.vim | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'autoload') diff --git a/autoload/copy_linebreak.vim b/autoload/copy_linebreak.vim index 3ea5f1c..8c81133 100644 --- a/autoload/copy_linebreak.vim +++ b/autoload/copy_linebreak.vim @@ -1,6 +1,12 @@ " Enable copy-friendly linebreak options function! copy_linebreak#Enable() abort setlocal nolinebreak linebreak? + let s:colorcolumn_save = &colorcolumn + setlocal colorcolumn= + let s:cursorcolumn_save = &cursorcolumn + setlocal nocursorcolumn + let s:cursorline_save = &cursorline + setlocal nocursorline let s:showbreak_save = &showbreak set showbreak= if exists('+breakindent') @@ -11,6 +17,18 @@ endfunction " Disable copy-friendly linebreak options function! copy_linebreak#Disable() abort setlocal linebreak linebreak? + if exists('s:colorcolumn_save') + let &colorcolumn = s:colorcolumn_save + unlet s:colorcolumn_save + endif + if exists('s:cursorcolumn_save') + let &cursorcolumn = s:cursorcolumn_save + unlet s:cursorcolumn_save + endif + if exists('s:cursorline_save') + let &cursorline = s:cursorline_save + unlet s:cursorline_save + endif if exists('s:showbreak_save') let &showbreak = s:showbreak_save unlet s:showbreak_save -- cgit v1.2.3