mirror of
https://github.com/neovim/neovim.git
synced 2025-09-19 17:58:18 +00:00
floats: implement floating windows
Co-Author: Dongdong Zhou <dzhou121@gmail.com>
This commit is contained in:
@@ -6285,6 +6285,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);
|
||||
}
|
||||
@@ -6309,8 +6312,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
|
||||
@@ -6331,6 +6334,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;) {
|
||||
@@ -6339,6 +6343,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);
|
||||
|
Reference in New Issue
Block a user