From 9601e7c5d5cc455bd6649ece2049a528993f4c79 Mon Sep 17 00:00:00 2001 From: shirasaka Date: Fri, 4 Dec 2020 12:03:04 +0900 Subject: ui: Fix win_hide distination grid When create tab, win_hide sent to new tab and new tab's previous tab. So, if created tab that not next tab (eg. $tabnew cmd), send win_hide to not current tab, and fixed this. --- src/nvim/window.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nvim/window.c b/src/nvim/window.c index 72ee400e40..5a5d3690f6 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -3787,6 +3787,7 @@ void free_tabpage(tabpage_T *tp) /// @return Was the new tabpage created successfully? FAIL or OK. int win_new_tabpage(int after, char_u *filename) { + tabpage_T *old_curtab = curtab; tabpage_T *tp = curtab; tabpage_T *newtp; int n; @@ -3830,9 +3831,9 @@ int win_new_tabpage(int after, char_u *filename) redraw_all_later(NOT_VALID); - tabpage_check_windows(tp); + tabpage_check_windows(old_curtab); - lastused_tabpage = tp; + lastused_tabpage = old_curtab; apply_autocmds(EVENT_WINNEW, NULL, NULL, false, curbuf); apply_autocmds(EVENT_WINENTER, NULL, NULL, false, curbuf); -- cgit