diff --git a/README.md b/README.md index 62128cbd..51ecb3cc 100644 --- a/README.md +++ b/README.md @@ -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" }, }, diff --git a/lua/noice/config/init.lua b/lua/noice/config/init.lua index 1bdc2557..955a705d 100644 --- a/lua/noice/config/init.lua +++ b/lua/noice/config/init.lua @@ -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" }, }, diff --git a/lua/noice/view/nui.lua b/lua/noice/view/nui.lua index 456b927b..44f36b82 100644 --- a/lua/noice/view/nui.lua +++ b/lua/noice/view/nui.lua @@ -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