Skip to content

Commit

Permalink
fix(smart_move): Dont move cmdline view (#123)
Browse files Browse the repository at this point in the history
\#117 Added the smart_move function that avoids overlap. But it
introduced some bugs with cmdline view set to `cmdline`. To avoid
overlap with `mini` or other views, the cmdline itself would move to odd
locations. This fixes that issue.
  • Loading branch information
ranjithshegde authored Oct 26, 2022
1 parent 2a85172 commit 3da3f6d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/noice/view/nui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ 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") then
if
not (self._opts.type == "popup" and self._opts.relative and self._opts.relative.type == "editor")
or self._opts.view == "cmdline"
then
return
end

Expand Down

0 comments on commit 3da3f6d

Please sign in to comment.