Skip to content

fix: reduce signcolumn/foldcolumn from window width #1688

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

Merged

Conversation

ssiyad
Copy link
Contributor

@ssiyad ssiyad commented Oct 26, 2022

@pleshevskiy
Copy link

pleshevskiy commented Oct 26, 2022

I've checked and it works! Thanks!

image

Copy link
Member

@alex-courtis alex-courtis left a comment

Choose a reason for hiding this comment

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

Looking good:

20221029_135419 441x477

Please be more defensive:

  • win_getid may return 0 which will result in an incorrect result from getwininfo
  • getwininfo may return an empty list

textoff is OK as it is "guaranteed" to be a number for a successful result.

@ssiyad ssiyad force-pushed the fix/render_fullname_signcolumn branch from 67b344c to 9418b80 Compare October 30, 2022 21:27
@ssiyad ssiyad requested a review from alex-courtis October 30, 2022 21:28
ref: `:h getwininfo()`

Signed-off-by: Sabu Siyad <hello@ssiyad.com>
@ssiyad ssiyad force-pushed the fix/render_fullname_signcolumn branch from 9418b80 to 777279f Compare October 30, 2022 21:32
Copy link
Member

@alex-courtis alex-courtis left a comment

Choose a reason for hiding this comment

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

Works beautifully, thank you for the contribution.

local width = fn.strdisplaywidth(fn.substitute(line, "[^[:print:]]*$", "", "g"))
if width < fn.winwidth(0) then
local text_width = fn.strdisplaywidth(fn.substitute(line, "[^[:print:]]*$", "", "g"))
local win_width = effective_win_width()
Copy link
Member

Choose a reason for hiding this comment

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

nice

@alex-courtis alex-courtis merged commit fba9751 into nvim-tree:master Oct 31, 2022
@ssiyad ssiyad deleted the fix/render_fullname_signcolumn branch October 31, 2022 08:25
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.

3 participants