Skip to content
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

bug: Error when processing modelines when dropbar.nvim is installed #572

Closed
3 tasks done
MariaSolOs opened this issue Aug 16, 2023 · 2 comments · Fixed by #627, #637 or #639
Closed
3 tasks done

bug: Error when processing modelines when dropbar.nvim is installed #572

MariaSolOs opened this issue Aug 16, 2023 · 2 comments · Fixed by #627, #637 or #639
Labels
bug Something isn't working

Comments

@MariaSolOs
Copy link
Contributor

MariaSolOs commented Aug 16, 2023

Did you check docs and existing issues?

  • I have read all the noice.nvim docs
  • I have searched the existing issues of noice.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

v0.10.0-dev-836+g6d93bdd45

Operating system/version

Mac Ventura 13.5

Describe the bug

When opening a file that has a modeline, strange things happen when opening/closing the command line and triggering completion. Moreover, I see the following error in my debug logs:

Error detected while processing nvim_exec2()..modelines[1365]..OptionSet Autocommands for "filetype":
E12: Command not allowed in secure mode in current dir or tag search
Executing OptionSet Autocommands for "*"
autocommand <Lua 310: ~/.local/share/nvim/lazy/dropbar.nvim/lua/dropbar.lua:70>

Disclaimer that I've been able to reproduce the issue when using noice and dropbar.nvim. Given the above stack trace I originally created an issue there, but I was advised to report it to noice instead.

Steps To Reproduce

  1. Save the configuration file above under minimal.lua.
  2. In the same directory, create a file with the following content:
A text file.

 vim:tw=78:ts=8:sw=2:et:ft=help:norl:
  1. Open Neovim with nvim --clean -u minimal.lua test.txt
  2. Type :h he<Tab> (trigger command line autocompletion).
  3. Notice how Noice's command line get's stuck.
  4. Exit Neovim with qa. Repeat step 4 but opening Neovim with nvim --clean -u minimal.lua test.txt -V10mynvim.log
  5. Open mynvim.log and search for Error.
  6. Notice the errors about incorrectly processing autocommands.

Expected Behavior

For neovim to behave normally.

Repro

-- 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",
  { "folke/noice.nvim", dependencies = "MunifTanjim/nui.nvim", config = true },
  { "Bekaboo/dropbar.nvim", config = true },
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
@MariaSolOs MariaSolOs added the bug Something isn't working label Aug 16, 2023
@folke
Copy link
Owner

folke commented Oct 19, 2023

Really no idea. I can reproduce it, but I don't see any errors in that log file.

I also enabled noice debug mode, and noice isn't reporting any errors.

@folke folke closed this as completed in 1f087c2 Oct 19, 2023
@folke
Copy link
Owner

folke commented Oct 19, 2023

Nevermind, found the issue and the fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants