-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(mini): dodge status line when cmdheight > 0 #685
Conversation
dfe3c29
to
0c73904
Compare
Hmmm... When my system is slow, sometimes they can still overlap with my status bar but only when they are disappearing. Suggestions? |
0c73904
to
1b75a55
Compare
2f0227d
to
1ac5ad0
Compare
1ac5ad0
to
ab545fb
Compare
ab545fb
to
6165cca
Compare
@@ -262,6 +262,9 @@ function M.setup(options) | |||
end, | |||
}) | |||
|
|||
if M.options.cmdline.enabled then | |||
vim.o.cmdheight = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I don't apply it here, I guess due to the fact that MiniView's initialisation happens too early, there's a gap between the pop-ups and the status line.
PS: repro.lua
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
"MunifTanjim/nui.nvim",
{ "https://github.com/Frederick888/noice.nvim.git", branch = 'mini-dodge-status-line' },
-- add any other plugins here
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- add anything else here
require("noice").setup({
lsp = {
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp
},
},
-- you can enable a preset for easier configuration
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help
},
cmdline = {
enabled = true,
},
messages = {
enabled = true,
}
})
local timer = vim.uv.new_timer()
local counter = 1
vim.uv.timer_start(timer, 1000, 1000, function ()
vim.notify('hello, world! ' .. counter)
counter = counter + 1
end)
The cmdheight addition in config/init.lua is to avoid breaking the default setup, where cmdheight is reduced to 0 after MiniView's initialisation.
6165cca
to
67ba0b5
Compare
I just pushed an update that probably also fixes this issue. Can you check? |
Unfortunately no. I checked out 7ee3649 and the issue still persists in both my minimal repro.lua and full setup. repro.lua: -- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
"MunifTanjim/nui.nvim",
-- { "https://github.com/Frederick888/noice.nvim.git", branch = 'mini-dodge-status-line' },
"https://github.com/folke/noice.nvim",
-- add any other plugins here
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- add anything else here
require("noice").setup({
lsp = {
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp
},
},
-- you can enable a preset for easier configuration
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help
},
cmdline = {
enabled = false,
},
messages = {
enabled = false,
}
})
local timer = vim.uv.new_timer()
local counter = 1
vim.uv.timer_start(timer, 1000, 1000, function ()
vim.notify('hello, world! ' .. counter)
counter = counter + 1
end)
vim.opt.cmdheight = 2 |
* up/main: (76 commits) fix(mini): update view options of underlying view. See folke#685 chore(build): auto-generate vimdoc fix(scrollbar): fix scrollbar. Fixes folke#759. Fixes folke#727 chore(main): release 4.2.2 (folke#858) chore(build): auto-generate vimdoc fix(hover): ignore invalid markup. Fixes folke#819 fix(msg): clear existing confirm messages. Fixes folke#302 chore(main): release 4.2.1 (folke#857) chore(build): auto-generate vimdoc fix(cmdline): only use cmdline_input for short prompts without newline. Fixes folke#856 chore(main): release 4.2.0 (folke#850) chore(build): auto-generate vimdoc fix(cmdline): allow overriding title hl fix(cmdline): reset title when needed chore(build): auto-generate vimdoc fix(nui): redo layout when border changes fix(cmdline_input): put in same position as cmdline_popup feat(cmdline): icon for cmdline input fix(fzf): message id feat(cmdline): use cmdline prompt as title. Noice is now great for vim.ui.input out of the box ...
Finally got some time to look into this. This is honestly not a bug. |
@folke Thank you! I didn't know that option existed! I went through the docs, and for the record, I ended up with {
'folke/noice.nvim',
opts = {
cmdline = { enabled = false },
messages = { enabled = false },
popupmenu = { enabled = false },
views = {
mini = {
position = {
row = -3,
},
},
},
},
}, |
The cmdheight addition in config/init.lua is to avoid breaking the
default setup, where cmdheight is reduced to 0 after MiniView's
initialisation.
I'm migrating to LazyVim but I still like https://github.com/gelguy/wilder.nvim.
So I disabled noice.nvim's
cmdline
andmessages
.But then I noticed that the LSP progress pop-ups started overlapping
with the status line, so here's a patch I managed to put together.
I'm not quite sure if this is the right fix. Feel free to trump this
with a better PR :)