fix(floatwin): don't use same window as altwin (#40748)

Fixes a regression from #34486
Fix #40745
This commit is contained in:
zeertzjq
2026-07-15 13:59:45 +08:00
committed by GitHub
parent 4b69d3fd2d
commit 39bc59a8f1
2 changed files with 15 additions and 9 deletions

View File

@@ -388,7 +388,7 @@ win_T *win_float_find_altwin(const win_T *win, const tabpage_T *tp)
assert(tp != curtab);
wp = tabpage_win_valid(tp, tp->tp_prevwin) ? tp->tp_prevwin : tp->tp_firstwin;
return (wp->w_config.focusable && !wp->w_config.hide) ? wp : tp->tp_firstwin;
return (wp != win && wp->w_config.focusable && !wp->w_config.hide) ? wp : tp->tp_firstwin;
}
/// Inline helper function for handling errors and cleanup in win_float_create_preview.