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

@@ -3887,11 +3887,11 @@ describe('API', function()
))
eq(
{
str = '3 ',
width = 2,
str = ' 3 ',
width = 9,
highlights = {
{ group = 'LineNr', start = 0 },
{ group = 'ErrorMsg', start = 1 },
{ group = 'ErrorMsg', start = 8 },
},
},
api.nvim_eval_statusline('%l%#ErrorMsg# ', { use_statuscol_lnum = 3, highlights = true })