From 162933301ef7bf56d24541220d0bcfc6e7935247 Mon Sep 17 00:00:00 2001 From: lzxin Date: Fri, 17 May 2024 17:08:38 +0800 Subject: [PATCH] Fix issue where left and right are reversed when resizing the middle window --- plugin/winresizer.vim | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/plugin/winresizer.vim b/plugin/winresizer.vim index 7ff6bac..28e87bb 100644 --- a/plugin/winresizer.vim +++ b/plugin/winresizer.vim @@ -244,16 +244,21 @@ endfun " Decide behavior of up, down, left and right key . " (to increase or decrease window size) fun! s:getResizeBehavior() - let signs = {'left':'-', 'down':'+', 'up':'-', 'right':'+'} + " There are two situations (window's position): + " 1. left and bottom: the right and upper lines move (default) + " 2. the others (right and upper): the left and bottom lines move + let signs = {'left':'-', 'down':'-', 'up':'+', 'right':'+'} let result = {} let ei = winresizer#getEdgeInfo() - if !ei['left'] && ei['right'] + + if !ei['left'] " the right windows: left line let signs['left'] = '+' let signs['right'] = '-' endif - if !ei['up'] && ei['down'] - let signs['up'] = '+' - let signs['down'] = '-' + + if !ei['down'] " the upper windows: bottom line + let signs['up'] = '-' + let signs['down'] = '+' endif return signs endfun