From 8600a03bf88a2bd817d71829344a8100deaed8b1 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 27 Oct 2022 07:51:07 +0200 Subject: [PATCH] feat: added option to disable smart_move --- README.md | 1 + lua/noice/config/init.lua | 1 + lua/noice/view/nui.lua | 3 +++ 3 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 62128cb..51ecb3c 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 1bdc255..955a705 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 456b927..44f36b8 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