-
Notifications
You must be signed in to change notification settings - Fork 28
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]: Freezes the nvim instance if used alongside Comment.nvim #209
Comments
For some reason, it appears that enabling treesitter highlights fixes the problem (i.e. using dropbar and Comment.nvim together no longer leads to neovim freezing). Thankfully, this works ... -- init.lua
require("nvim-treesitter.configs").setup({
["highlight"] = { ["enable"] = true },
}) ... or with # ...
plugins = {
treesitter = {
enable = true;
gccPackage = null;
settings = {
highlight.enable = true;
};
};
};
} Interesting, to say the least. |
Please use the minimal config provided to reproduce the bug without a package manager, or at least provide config with lazy.nvim bootstrap code, not only the plugin specs. |
In the -- init.lua
require("nvim-treesitter.configs").setup({
["highlight"] = { ["enable"] = true },
}) Would be nice to know the root cause of the problem, but given I found a fix (or at least a workaround), and given the problem manifested itself only when dropbar is used alongside Comment.nvim, not by itself, I'm not sure it's worth your time digging deeper into this, but your call. |
Cannot reproduce. |
I'm experiencing a similar issue with regard to freezing while editing nix files and deleting text. I haven't had enough time to locate the root cause, but while trying to sift through which plugins updated recently I disabled dropbar along with a few others. It seemed to prevent or sidestep the issue at first glance, but it could have been one of the other plugins I disabled. I'll test things further tomorrow when I get a chance in the evening. |
Looks like this might be a result of the neovim build in nixpkgs having a mismatched treesitter library or something, which makes sense with the behavior. |
local tmp = vim.env.TMPDIR or vim.env.TEMPDIR or vim.env.TMP or vim.env.TEMP or "/tmp"
local data = tmp .. "/" .. (vim.env.NVIM_APPNAME or "nvim")
local packages_root = data .. "/site"
local cloned_root = packages_root .. "/pack/packages/start"
local plugins = {
["Comment.nvim"] = "https://github.com/numToStr/Comment.nvim",
["dropbar.nvim"] = "https://github.com/Bekaboo/dropbar.nvim",
["nvim-treesitter"] = "https://github.com/nvim-treesitter/nvim-treesitter",
}
vim.fn.mkdir(cloned_root, "p")
vim.opt.rtp:prepend(packages_root)
vim.opt.pp = {}
vim.opt.pp:prepend(packages_root)
for plugin_name, url in pairs(plugins) do
local plugin_path = cloned_root .. "/" .. plugin_name
if not vim.loop.fs_stat(plugin_path) then
vim.fn.system({ "git", "clone", url, plugin_path })
end
end
-- This must be done once, then it can be commented out.
-- But w/o this, dropbar does not show up on in the bar in .nix files (and the dropbar.sources module doesnt get loaded).
-- require("nvim-treesitter.configs").setup({
-- ensure_installed = {
-- "nix",
-- },
-- -- ["highlight"] = { ["enable"] = true }, -- 👈 fix for nixpks#neovim
-- })
require("Comment").setup({}) -- 👈 fix for nixpks#neovim Above is the As @Kuwagata was saying, neovim outside of nixpkgs won't break with the above minimal config (even without the above "fixes", i.e. if Comment.nvim is enabled and the treesitter highlights are not enabled). This definitely doesn't look like a dropbar bug. |
Description
Hi,
I've noticed that when used alongside Comment.nvim,
dropbar.nvim
will lead to the nvim instance completely freezing.The freeze happens mostly on opening
.nix
files and afterV
-isually selecting a 50-ish block of code/text and trying to delete it or runninggcc
.However I did notice the freeze on
.rs
files, after deleting a single line and trying to save.In conclusion, freezing doesn't seem related to a specific file-type or operation (sometimes it froze as soon as I tried opening a file), but rather to using dropbar alongside Comment.nvim.
nvim version
v0.10.3
dropbar.nvim version
e5f9fb9
Operating system and version
Linux 6.9.3
Minimal config
See below the config used with
lazy.nvim
, or withnixvim
.You'll probably use
lazy.nvim
as that's more common; I am anixvim
uses so that's why I included that config, plus it's very short.Steps to reproduce
Below I have two minimal configs to reproduce this, lazy.nvim and nixvim.
lazy.nvim config
lazy-lock.json
:nixvim config
Expected behavior
No freeze.
Actual behavior
What happens exactly:
If I remove either dropbar or Comment, no freeze.
Additional information
No response
The text was updated successfully, but these errors were encountered: