aboutsummaryrefslogtreecommitdiff
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
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
-rw-r--r--doc/equalalways_resized.txt5
-rw-r--r--plugin/equalalways_resized.vim15
2 files changed, 5 insertions, 15 deletions
diff --git a/doc/equalalways_resized.txt b/doc/equalalways_resized.txt
index 44dcbd7..e4098df 100644
--- a/doc/equalalways_resized.txt
+++ b/doc/equalalways_resized.txt
@@ -1,4 +1,4 @@
-*equalalways_resized.txt* For Vim version 7.0 Last change: 2018 Aug 16
+*equalalways_resized.txt* For Vim version 7.0 Last change: 2019 May 28
DESCRIPTION *equalalways_resized*
@@ -7,8 +7,7 @@ resized.
REQUIREMENTS *equalalways_resized-requirements*
-This plugin only loads if 'compatible' is not set. It requires the |+autocmd|
-and |+windows| features, with the |VimResized| event introduced in |version7|.
+This plugin only loads if 'compatible' is not set.
AUTHOR *equalalways_resized-author*
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