Skip to content

Commit 8600a03

Browse files
committed
feat: added option to disable smart_move
1 parent dc33efa commit 8600a03

3 files changed

Lines changed: 5 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ Check the [wiki](https://github.com/folke/noice.nvim/wiki/Configuration-Recipes)
197197
},
198198
smart_move = {
199199
-- noice tries to move out of the way of existing floating windows.
200+
enabled = true, -- you can disable this behaviour here
200201
-- add any filetypes here, that shouldn't trigger smart move.
201202
excluded_filetypes = { "cmp_menu", "cmp_docs", "notify" },
202203
},

lua/noice/config/init.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ M.defaults = {
138138
},
139139
smart_move = {
140140
-- noice tries to move out of the way of existing floating windows.
141+
enabled = true, -- you can disable this behaviour here
141142
-- add any filetypes here, that shouldn't trigger smart move.
142143
excluded_filetypes = { "cmp_menu", "cmp_docs", "notify" },
143144
},

lua/noice/view/nui.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ end
7070

7171
-- Check if other floating windows are overlapping and move out of the way
7272
function NuiView:smart_move()
73+
if not Config.options.smart_move.enabled then
74+
return
75+
end
7376
if not (self._opts.type == "popup" and self._opts.relative and self._opts.relative.type == "editor") then
7477
return
7578
end

0 commit comments

Comments
 (0)