Skip to content

[mini.diff] signs are not returned in sign_getplaced? #789

Closed Answered by echasnovski
ahmedelgabri asked this question in Q&A
Discussion options

You must be logged in to vote

Signs in 'mini.diff' are placed with extmarks (which are usually more efficient). The supposed way to retrieve them is with nvim_buf_get_extmarks(). Since neovim/neovim#25724 (i.e. on current Nightly) old style signs can also be retrieved this way. And this also seems to be a preferred way to do this task by 'statuscolumn' author.

So the suggested way would be to get all signs and filter later by sign_hl_group:

vim.api.nvim_buf_get_extmarks(0, -1, { vim.v.lnum - 1, 0}, { vim.v.lnum - 1, -1}, { type = 'sign', details = true })

The better approach would be to get namespace id of 'mini.diff', but it is not guaranteed to not break. However, for personal usage it might be fine. Currently names…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ahmedelgabri
Comment options

Answer selected by echasnovski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants