feat(column)!: rework 'statuscolumn' %r/l items

Problem:  A custom 'statuscolumn' needs to check a bunch of options and
          placed signs to replicate the default number column.
Solution: Rework %l item to include the necessary logic to mimic the
          default number column. Remove now redundant %r item.
This commit is contained in:
Luuk van Baal
2024-06-15 05:46:43 +02:00
parent 114197517f
commit ad70c9892d
10 changed files with 251 additions and 202 deletions

View File

@@ -6373,8 +6373,7 @@ vim.go.sol = vim.go.startofline
--- Some of the items from the 'statusline' format are different for
--- 'statuscolumn':
---
--- %l line number of currently drawn line
--- %r relative line number of currently drawn line
--- %l line number column for currently drawn line
--- %s sign column for currently drawn line
--- %C fold column for currently drawn line
---
@@ -6403,11 +6402,8 @@ vim.go.sol = vim.go.startofline
--- Examples:
---
--- ```vim
--- " Relative number with bar separator and click handlers:
--- set statuscolumn=%@SignCb@%s%=%T%@NumCb@%r│%T
---
--- " Right aligned relative cursor line number:
--- let &stc='%=%{v:relnum?v:relnum:v:lnum} '
--- " Line number with bar separator and click handlers:
--- set statuscolumn=%@SignCb@%s%=%T%@NumCb@%l│%T
---
--- " Line numbers in hexadecimal for non wrapped part of lines:
--- let &stc='%=%{v:virtnum>0?"":printf("%x",v:lnum)} '