diff options
| author | Luuk van Baal <luukvbaal@gmail.com> | 2024-01-01 14:24:48 +0100 |
|---|---|---|
| committer | Lewis Russell <me@lewisr.dev> | 2024-01-04 11:52:37 +0000 |
| commit | fa61e0c047954e7eb494ee02144a4dc71a42b3b2 (patch) | |
| tree | 7fe807a23591eec0ea2286cc3e0845c7f620538e /runtime | |
| parent | 444f37fe510f4c28c59bade40d7ba152a5ee8f7c (diff) | |
| download | rneovim-fa61e0c047954e7eb494ee02144a4dc71a42b3b2.tar.gz rneovim-fa61e0c047954e7eb494ee02144a4dc71a42b3b2.tar.bz2 rneovim-fa61e0c047954e7eb494ee02144a4dc71a42b3b2.zip | |
refactor(column): define and use maximum 'statuscolumn' width
Problem: The maximum 'statuscolumn' width and grow behavior is undocumented.
Solution: Define, use and document the maximum 'statuscolumn' width and grow behavior.
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/doc/options.txt | 10 | ||||
| -rw-r--r-- | runtime/lua/vim/_meta/options.lua | 10 |
2 files changed, 14 insertions, 6 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 176c8ca3db..117e9c9ec8 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -5923,9 +5923,13 @@ A jump table for the options with a short description can be found at |Q_op|. %s sign column for currently drawn line %C fold column for currently drawn line - NOTE: To draw the sign and fold columns, their items must be included in - 'statuscolumn'. Even when they are not included, the status column width - will adapt to the 'signcolumn' and 'foldcolumn' width. + The 'statuscolumn' width follows that of the default columns and + adapts to the |'numberwidth'|, |'signcolumn'| and |'foldcolumn'| option + values (regardless of whether the sign and fold items are present). + Aditionally, the 'statuscolumn' grows with the size of the evaluated + format string, up to a point (following the maximum size of the default + fold, sign and number columns). Shrinking only happens when the number + of lines in a buffer changes, or the 'statuscolumn' option is set. The |v:lnum| variable holds the line number to be drawn. The |v:relnum| variable holds the relative line number to be drawn. diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index 46497179ac..7ad720b6b2 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -6359,9 +6359,13 @@ vim.go.sol = vim.go.startofline --- %s sign column for currently drawn line --- %C fold column for currently drawn line --- ---- NOTE: To draw the sign and fold columns, their items must be included in ---- 'statuscolumn'. Even when they are not included, the status column width ---- will adapt to the 'signcolumn' and 'foldcolumn' width. +--- The 'statuscolumn' width follows that of the default columns and +--- adapts to the `'numberwidth'`, `'signcolumn'` and `'foldcolumn'` option +--- values (regardless of whether the sign and fold items are present). +--- Aditionally, the 'statuscolumn' grows with the size of the evaluated +--- format string, up to a point (following the maximum size of the default +--- fold, sign and number columns). Shrinking only happens when the number +--- of lines in a buffer changes, or the 'statuscolumn' option is set. --- --- The `v:lnum` variable holds the line number to be drawn. --- The `v:relnum` variable holds the relative line number to be drawn. |