nvim-tree.lua icon indicating copy to clipboard operation
nvim-tree.lua copied to clipboard

statuscolumn support - blocked

Open gukz opened this issue 2 years ago • 5 comments

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)

gukz avatar Aug 31 '23 08:08 gukz

related: #1510 missing diagnostic placement

alex-courtis avatar Sep 02 '23 01:09 alex-courtis

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.

alex-courtis avatar Sep 02 '23 01:09 alex-courtis

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

gegoune avatar Nov 28 '23 20:11 gegoune

Still happening on 0.9.4

xterm: 20231202_101113

alex-courtis avatar Dec 01 '23 23:12 alex-courtis

master (983defd28) too.

I think I'm doing it wrong.

20231202_101816

alex-courtis avatar Dec 01 '23 23:12 alex-courtis

@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. :)

YanWQ-monad avatar Jan 24 '24 16:01 YanWQ-monad

Thank you.

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

Edit: no

alex-courtis avatar Jan 27 '24 03:01 alex-courtis

@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?

alex-courtis avatar Jan 28 '24 23:01 alex-courtis

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

gukz avatar Feb 01 '24 07:02 gukz