aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-28 23:47:35 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-28 23:47:35 +1200
commit01f72bc518ae04fc86c110f3e6283314ce1757c0 (patch)
tree19c849649529612028684289bab53341eb7c9ebe /plugin
parentMerge branch 'release/v0.2.0' into develop (diff)
downloadvim-equalalways-resized-01f72bc518ae04fc86c110f3e6283314ce1757c0.tar.gz
vim-equalalways-resized-01f72bc518ae04fc86c110f3e6283314ce1757c0.zip
Pare down to just a few lines
Diffstat (limited to 'plugin')
-rw-r--r--plugin/equalalways_resized.vim15
1 files changed, 3 insertions, 12 deletions
diff --git a/plugin/equalalways_resized.vim b/plugin/equalalways_resized.vim
index 80ae548..436255d 100644
--- a/plugin/equalalways_resized.vim
+++ b/plugin/equalalways_resized.vim
@@ -5,23 +5,14 @@
" Author: Tom Ryder <tom@sanctum.geek.nz>
" License: Same as Vim itself
"
-if exists('loaded_equalalways_resized') || &compatible
- finish
-endif
-if !has('autocmd') || !has('windows') || !exists('##VimResized')
+if exists('loaded_equalalways_resized') || &compatible || v:version < 700
finish
endif
let loaded_equalalways_resized = 1
-" If 'equalalways' is set, rebalance the windows
-function! s:Rebalance() abort
- if &equalalways
- wincmd =
- endif
-endfunction
-
" Add hook for VimResized event
augroup equalalways_resized
autocmd!
- autocmd VimResized * call s:Rebalance()
+ autocmd VimResized *
+ \ if &equalalways | wincmd = | endif
augroup END