Skip to content

Commit

Permalink
fix: don't try smart move between noice windows
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Oct 26, 2022
1 parent 3da3f6d commit 4a46ba3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lua/noice/view/nui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,15 @@ end

-- Check if other floating windows are overlapping and move out of the way
function NuiView:smart_move()
if
not (self._opts.type == "popup" and self._opts.relative and self._opts.relative.type == "editor")
or self._opts.view == "cmdline"
then
if not (self._opts.type == "popup" and self._opts.relative and self._opts.relative.type == "editor") then
return
end

local wins = vim.tbl_filter(function(win)
return win ~= self._nui.winid
and not (self._nui.border and self._nui.border.winid == win)
and vim.api.nvim_win_is_valid(win)
and vim.bo[vim.api.nvim_win_get_buf(win)].filetype ~= "noice"
and vim.api.nvim_win_get_config(win).relative == "editor"
and Util.nui.overlap(self._nui.winid, win)
end, vim.api.nvim_list_wins())
Expand Down

2 comments on commit 4a46ba3

@wangl-cc
Copy link
Contributor

@wangl-cc wangl-cc commented on 4a46ba3 Oct 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix seems to only work to cmdline completions with popupmenu, but not for cmp.cmdline.

@folke
Copy link
Owner Author

@folke folke commented on 4a46ba3 Oct 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wangl-cc right. Didn't think about that.
I'll look into it. See #130

Please sign in to comment.