-
Notifications
You must be signed in to change notification settings - Fork 918
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: get_signs is broken on nightly #2039
Comments
Likely the reason: neovim/neovim#25724 |
@amaanq function M.get_signs(buf, lnum)
-- Get regular signs
---@type Sign[]
local signs = vim.tbl_map(function(sign)
---@type Sign
local ret = vim.fn.sign_getdefined(sign.name)[1]
print(sign.name)
if ret ~= nil then --------------| Lines in Question
ret.priority = sign.priority --|
return ret --|
end -----------------------------|
end, vim.fn.sign_getplaced(buf, { group = "*", lnum = lnum })[1].signs)
-- Get extmark signs
local extmarks = vim.api.nvim_buf_get_extmarks(
buf,
-1,
{ lnum - 1, 0 },
{ lnum - 1, -1 },
{ details = true, type = "sign" }
)
for _, extmark in pairs(extmarks) do
signs[#signs + 1] = {
name = extmark[4].sign_hl_group or "",
text = extmark[4].sign_text,
texthl = extmark[4].sign_hl_group,
priority = extmark[4].priority,
}
end
This still has the gitsigns show up in the statuscolumn (i'm guessing because of the for loop for extmarks below this tbl_map) but stops that error from happening. I'm look into diagnosing actual what the logic difference is and if there is a cleaner fix but this hopefully should work for you in the meantime. |
With neovim/neovim#25724 merged,
|
Ok so I think i understand but would really appreciate it if you could verify if my thought process is correct. So before the neovim/neovim#25724 update to nvim the local signs = vim.tbl_map(function(sign)
---@type Sign
local ret = vim.fn.sign_getdefined(sign.name)[1]
ret.priority = sign.priority
return ret
end, vim.fn.sign_getplaced(buf, { group = "*", lnum = lnum })[1].signs) wouldn't retrieve the extmark signs, thus the If it is, and as a side question, does this mean after the new functionality is fully implemented that the usage surrounding Thanks so much! |
Correct,
Indeed, this was one of the motivations for neovim/neovim#25724. Either |
Awesome, thanks so much for explaining that, really appreciate it! |
neovim/neovim#25724 get merged and now lazyvim is having a lot of errors. Example:
|
Thanks for the workaround @bouvettem17. At least I can run neovim head! |
Based on a discussion in the {
"lewis6991/gitsigns.nvim",
opts = {
_extmark_signs = false,
},
} |
neovim/neovim#26105 got merged, so maybe Folke would like to consider @luukvbaal's comment with how he will proceed solving this. |
This should be enough, then? function M.get_signs(buf, lnum)
-- Get regular signs
---@type Sign[]
- local signs = vim.tbl_map(function(sign)
- ---@type Sign
- local ret = vim.fn.sign_getdefined(sign.name)[1]
- ret.priority = sign.priority
- return ret
- end, vim.fn.sign_getplaced(buf, { group = "*", lnum = lnum })[1].signs)
+ local signs = {} |
Did you check docs and existing issues?
Neovim version (nvim -v)
v0.10.0-dev-1600+ga84b454eb
Operating system/version
Arch Linux x86_64 6.6.1-zen1-1-zen
Describe the bug
Something in Neovim changed w.r.t. signs, I'm not sure what it implies but it causes a slew of errors in Neovim
Steps To Reproduce
Expected Behavior
No error
Repro
The text was updated successfully, but these errors were encountered: