diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2023-03-14 19:53:44 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2023-03-14 19:53:44 +1300 |
commit | bc96014f9504d6068a0f53d1679fb7db6ee63cc4 (patch) | |
tree | bc36d79c378638138b5088e5cbff04bf666b9a46 | |
parent | Merge branch 'release/v1.0.0' (diff) | |
download | vim-copy-linebreak-bc96014f9504d6068a0f53d1679fb7db6ee63cc4.tar.gz vim-copy-linebreak-bc96014f9504d6068a0f53d1679fb7db6ee63cc4.zip |
Turn off line/column highlighting options too
This can almost certainly be better-structured.
-rw-r--r-- | autoload/copy_linebreak.vim | 18 |
1 files changed, 18 insertions, 0 deletions
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 |