-
Notifications
You must be signed in to change notification settings - Fork 17
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: fatal with invalid buffer #114
Conversation
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.
Thanks for the PR!
The change itself looks good to me, but have you determined what the cause of the error is (beyond just an invalid buffer) / how it can be reproduced? Ideally, we shouldn't be attempting to parse an invalid buffer in the first place, so I think this should be investigated further.
@@ -68,6 +68,10 @@ local function parse_buf(buf, lnum_end, incremental) | |||
symbols_parsed.symbols = {} | |||
symbols_parsed['end'] = { lnum = 0, inside_code_block = false } | |||
end | |||
-- if buf is invalid, return |
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.
Small nit, but I think the code is self-explanatory and a comment isn't needed.
It seems the real problem comes from this plugin |
Thanks, if the function relies on the validity of |
This is my first time making some pr stuff, maybe a little bad, ...Thank you anyway! |
It is not bad at all. Thanks for reporting this issue and coming up with the PR, it helps us making dropbar.nvim more stable. Please keep goinig! |
+1 to this, it's not bad in any way! Thank you for the PR, it is much appreciated even if it didn't end up being merged. If you're ever interested in making another PR here I'd be happy to guide that process / answer any questions about the codebase :) |
I'm still confused as to why this was happening in the first place though... Maybe we should make an issue for this so the root cause can be investigated, even if it's not technically an issue anymore? I don't think the |
Yeah, but this depends on @Parsifa1 to provide minimal production steps since I haven't had the issue.
You are right,
I am not quite sure what is your solution here. If the |
I'll try to reproduce based on their description, since I already have project.nvim installed.
You're right, looking back over the code I don't think I was correct. I'll try to reproduce with my config, but if that doesn't work we can just wait for repro steps. Edit: oops, wrong |
it's this plugin As for the minimum configuration return {
"coffebar/neovim-project",
-- cmd = "Telescope",
event = "VeryLazy",
opts = {
last_session_on_startup = false,
projects = {
-- define project roots
},
},
init = function()
-- enable saving the state of plugins in the session
vim.opt.sessionoptions:append("globals") -- save global variables that start with an uppercase letter and contain at least one lowercase letter.
end,
dependencies = {
{ "nvim-lua/plenary.nvim" },
{ "nvim-telescope/telescope.nvim" },
{ "Shatur/neovim-session-manager" },
},
} for dropbar.nvim -- local custom = require "custom"
return {
"Bekaboo/dropbar.nvim",
-- "Parsifa1/dropbar.nvim",
dependencies = { 'nvim-telescope/telescope-fzf-native.nvim' },
event = "VeryLazy",
opts = {
general = {
enable = function(buf, win)
return not vim.api.nvim_win_get_config(win).zindex
and vim.bo[buf].buftype == ""
and vim.api.nvim_buf_get_name(buf) ~= ""
and not vim.wo[win].diff
and vim.bo[buf].filetype ~= "toggleterm"
end,
},
},
} and the step is :
|
Thanks @Parsifa1! What version of Neovim are you using? |
nightly |
Avoids triggering lazy-loading of fields when deleting menus. closes Bekaboo#114
Before executing buf_get_lines, add a check to see if the buf_id is valid.