Skip to content

Commit

Permalink
feat: added option to disable smart_move
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Oct 27, 2022
1 parent dc33efa commit 8600a03
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ Check the [wiki](https://github.com/folke/noice.nvim/wiki/Configuration-Recipes)
},
smart_move = {
-- noice tries to move out of the way of existing floating windows.
enabled = true, -- you can disable this behaviour here
-- add any filetypes here, that shouldn't trigger smart move.
excluded_filetypes = { "cmp_menu", "cmp_docs", "notify" },
},
Expand Down
1 change: 1 addition & 0 deletions lua/noice/config/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ M.defaults = {
},
smart_move = {
-- noice tries to move out of the way of existing floating windows.
enabled = true, -- you can disable this behaviour here
-- add any filetypes here, that shouldn't trigger smart move.
excluded_filetypes = { "cmp_menu", "cmp_docs", "notify" },
},
Expand Down
3 changes: 3 additions & 0 deletions lua/noice/view/nui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ end

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

0 comments on commit 8600a03

Please sign in to comment.