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

feat: support for statuscolumn #1037

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feat: support for statuscolumn #1037

wants to merge 1 commit into from

Conversation

lewis6991
Copy link
Owner

No description provided.

@lewis6991 lewis6991 force-pushed the feat/statuscolumn branch 4 times, most recently from 1f2e274 to 28feeed Compare June 11, 2024 08:41
table.insert(res, '%#' .. s[2] .. '#')
table.insert(res, s[1])
res_len = res_len + vim.str_utfindex(s[1])
table.insert(res, '%#NONE#')
Copy link

@luukvbaal luukvbaal Jun 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you want %* here to restore the currently active default statuscolumn highlight (affected by cursorline etc). (Unless this does the same?)

if next(signs.signs) then
max_pad = 2
end
local marks = api.nvim_buf_get_extmarks(0, signs.ns, { lnum - 1, 0 }, { lnum - 1, -1 }, {})
Copy link

@luukvbaal luukvbaal Jun 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
local marks = api.nvim_buf_get_extmarks(0, signs.ns, { lnum - 1, 0 }, { lnum - 1, -1 }, {})
local buf = api.nvim_win_get_buf(vim.g.statusline_winid)
local marks = api.nvim_buf_get_extmarks(buf, signs.ns, { lnum - 1, 0 }, { lnum - 1, -1 }, {})

I suppose there is no need to change the function signature like I suggested on matrix.

api.nvim__redraw({
buf = bufnr,
range = { top, bot },
statuscolumn = true,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you experience that both range and statuscolumn are necessary? The entire window should already be redrawn with statuscolumn = true. But yeah previously placing sign extmarks was what triggered redraws so since that doesn't happen here anymore I think these manual redraws are necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants