aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2019-03-02 17:26:50 +0100
committerGitHub <noreply@github.com>2019-03-02 17:26:50 +0100
commit7a6da502b9d8deecfc89d1497a8e8da15e65f31e (patch)
treee3811b52dd00e67175383f11f1b67b42acc88f4c /src/nvim/ex_docmd.c
parent0aba4d825a5b18c5fa937c0426788f61f756e086 (diff)
parent9a1675b065394734ddaef91a314896028e2b1d46 (diff)
downloadrneovim-7a6da502b9d8deecfc89d1497a8e8da15e65f31e.tar.gz
rneovim-7a6da502b9d8deecfc89d1497a8e8da15e65f31e.tar.bz2
rneovim-7a6da502b9d8deecfc89d1497a8e8da15e65f31e.zip
Merge pull request #6619 from bfredl/floating
Floating windows in TUI and Remote UI
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r--src/nvim/ex_docmd.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index bbec977c74..8f9af1c2ec 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -6279,6 +6279,9 @@ void tabpage_close(int forceit)
{
// First close all the windows but the current one. If that worked then
// close the last window in this tab, that will close it.
+ while (curwin->w_floating) {
+ ex_win_close(forceit, curwin, NULL);
+ }
if (!ONE_WINDOW) {
close_others(true, forceit);
}
@@ -6303,8 +6306,8 @@ void tabpage_close_other(tabpage_T *tp, int forceit)
/* Limit to 1000 windows, autocommands may add a window while we close
* one. OK, so I'm paranoid... */
while (++done < 1000) {
- sprintf((char *)prev_idx, "%i", tabpage_index(tp));
- wp = tp->tp_firstwin;
+ snprintf((char *)prev_idx, sizeof(prev_idx), "%i", tabpage_index(tp));
+ wp = tp->tp_lastwin;
ex_win_close(forceit, wp, tp);
/* Autocommands may delete the tab page under our fingers and we may
@@ -6325,6 +6328,7 @@ static void ex_only(exarg_T *eap)
{
win_T *wp;
int wnr;
+
if (eap->addr_count > 0) {
wnr = eap->line2;
for (wp = firstwin; --wnr > 0;) {
@@ -6333,6 +6337,10 @@ static void ex_only(exarg_T *eap)
else
wp = wp->w_next;
}
+ } else {
+ wp = curwin;
+ }
+ if (wp != curwin) {
win_goto(wp);
}
close_others(TRUE, eap->forceit);