diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-10-30 22:16:04 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-10-30 22:22:39 +1300 |
commit | d299397536e77e13ae2febb7b72561e32a307f40 (patch) | |
tree | 01c382c37c13b3269c21b0377a0dd8b8c59c8af1 | |
parent | Rearrange two options for clarity (diff) | |
download | dotfiles-d299397536e77e13ae2febb7b72561e32a307f40.tar.gz dotfiles-d299397536e77e13ae2febb7b72561e32a307f40.zip |
Keep 'breakindent'-available flag in script var
Because this is a version-based check and shouldn't change any runtime,
we can just calculate it once as a variable local and persistent to this
script, and then store it for reference by the toggling function.
-rw-r--r-- | vim/config/wrap.vim | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/vim/config/wrap.vim b/vim/config/wrap.vim index 94a3163a..14f36fb7 100644 --- a/vim/config/wrap.vim +++ b/vim/config/wrap.vim @@ -20,7 +20,9 @@ nnoremap k gk if has('linebreak') set linebreak set showbreak=... - if v:version > 704 || v:version ==# 704 && has('patch338') + let s:breakindent = v:version > 704 + \ || v:version ==# 704 && has('patch338') + if s:breakindent set breakindent endif @@ -31,13 +33,13 @@ if has('linebreak') if &l:linebreak setlocal nolinebreak setlocal showbreak= - if v:version > 704 || v:version ==# 704 && has('patch338') + if s:breakindent setlocal nobreakindent endif else setlocal linebreak setlocal showbreak=... - if v:version > 704 || v:version ==# 704 && has('patch338') + if s:breakindent setlocal breakindent endif endif |