nvim-tree / nvim-tree.lua

A file explorer tree for neovim written in lua
Other
7.24k stars 609 forks source link

statuscolumn support - blocked #2394

Closed gukz closed 9 months ago

gukz commented 1 year ago

Neovim has support the new feature: statuscolumn https://github.com/neovim/neovim/pull/20621 please allow user config this property and set it to the tree window buffer.

currently, if I set the statuscolumn for global, the tree window's statuscolumn will not always update. see below, I set the statuscolumn="%=%{v:relnum?v:relnum:v:lnum} "

image

what am I request for? 1, allow user customize the statuscolumn just like the signcolumn. 2, fix the statuscolumn update bug (optional)

alex-courtis commented 1 year ago

related: #1510 missing diagnostic placement

alex-courtis commented 1 year ago

This is fantastic news! It allows more flexibility for sign placement.

I don't think this is ready yet:

:; nvim --version
NVIM v0.9.1
Build type: Release
LuaJIT 2.1.1692616192

nvim --clean README.md

:let &statuscolumn="%=%{v:relnum?v:relnum:v:lnum} "

Cursor down and watch the line number become corrupted: 20230902_111604

Let's revisit this once the feature is ready.

gegoune commented 11 months ago

@alex-courtis I can't replicate issue you described above. There were numerous fixes regarding statuscolumn on master since September.

alex-courtis commented 11 months ago

Still happening on 0.9.4

xterm: 20231202_101113

alex-courtis commented 11 months ago

master (983defd28) too.

I think I'm doing it wrong.

20231202_101816

YanWQ-monad commented 9 months ago

@alex-courtis According to the documentation of statuscolumn:

When using v:relnum, keep in mind that cursor movement by itself will not cause the 'statuscolumn' to update unless 'relativenumber' is set.

It says that if one want to use v:relnum, one must also set relativenumber to keep line number updated.

So, if you set

:set relativenumber
:let &statuscolumn="%=%{v:relnum?v:relnum:v:lnum} "

the corrupted line numbers go away. :)

alex-courtis commented 9 months ago

Thank you.

Likely related: https://github.com/nvim-tree/nvim-tree.lua/discussions/2640

Edit: no

alex-courtis commented 9 months ago

@alex-courtis According to the documentation of statuscolumn:

When using v:relnum, keep in mind that cursor movement by itself will not cause the 'statuscolumn' to update unless 'relativenumber' is set.

It says that if one want to use v:relnum, one must also set relativenumber to keep line number updated.

So, if you set

:set relativenumber
:let &statuscolumn="%=%{v:relnum?v:relnum:v:lnum} "

the corrupted line numbers go away. :)

That works beautifully: view.relativenumber = true results in :let &statuscolumn="%=%{v:relnum?v:relnum:v:lnum} " functioning correctly.

@gukz are you satisfied with this outcome?

gukz commented 9 months ago

@alex-courtis that's so cool, everything just works!!! a big thank you.