mirror of
https://github.com/neovim/neovim.git
synced 2026-03-31 04:42:03 +00:00
fix(api): don't config split as floatwin relative to itself
Problem: possible to configure a split as a floatwin with relative=win that is relative to itself. Solution: fix the check. Not caused by this PR; just something I noticed when about to fix the validation logic.
This commit is contained in:
@@ -1360,7 +1360,7 @@ static bool parse_win_config(win_T *wp, Dict(win_config) *config, WinConfig *fco
|
||||
}
|
||||
|
||||
if (relative_is_win || is_split) {
|
||||
if (reconf && relative_is_win) {
|
||||
if (wp && relative_is_win) {
|
||||
win_T *target_win = find_window_by_handle(config->win, err);
|
||||
if (!target_win) {
|
||||
goto fail;
|
||||
|
||||
@@ -11191,6 +11191,9 @@ describe('float window', function()
|
||||
local winid = api.nvim_open_win(buf, false, config)
|
||||
api.nvim_set_current_win(winid)
|
||||
eq('floating window cannot be relative to itself', pcall_err(api.nvim_win_set_config, winid, config))
|
||||
-- Also when configuring split into float.
|
||||
command('split')
|
||||
eq('floating window cannot be relative to itself', pcall_err(api.nvim_win_set_config, 0, config))
|
||||
end)
|
||||
|
||||
it('bufpos out of range', function()
|
||||
|
||||
Reference in New Issue
Block a user