mirror of
https://github.com/vim-airline/vim-airline.git
synced 2026-05-18 06:19:42 +08:00
whitespace: support multiline statusline for warnings
Add a new airline_section_warning2 that displays whitespace warnings on a second statusline line when Vim supports the statuslineopt option (Vim 9.2.0083+) and g:airline_multiline is set. The second line only appears when there are actual whitespace issues, avoiding an empty second line when the buffer is clean. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -57,6 +57,8 @@ this: >
|
||||
+---------------------------------------------------------------------------+
|
||||
| A | B | C X | Y | Z | [...] |
|
||||
+---------------------------------------------------------------------------+
|
||||
| [...] |
|
||||
+---------------------------------------------------------------------------+
|
||||
|
||||
The statusline is the colored line at the bottom, which contains the sections
|
||||
(possibly in different colors):
|
||||
@@ -82,6 +84,7 @@ section meaning (example)~
|
||||
<
|
||||
[...] additional sections (warning/errors/statistics)
|
||||
from external plugins (e.g. YCM/syntastic/...)
|
||||
Can be shown on a second line optionally.
|
||||
|
||||
For a better look, those sections can be colored differently, depending on
|
||||
the mode and whether the current file is 'modified'
|
||||
@@ -124,6 +127,9 @@ values):
|
||||
" Currently: Enable Vim9 Script implementation
|
||||
let g:airline_experimental = 1
|
||||
|
||||
* enable multiline feature (requires Vim 9.2.0083) >
|
||||
let g:airline_multiline = 1
|
||||
|
||||
* the separator used on the left side >
|
||||
let g:airline_left_sep='>'
|
||||
<
|
||||
@@ -445,6 +451,7 @@ window.
|
||||
languageclient_error_count)
|
||||
let g:airline_section_warning (ycm_warning_count, syntastic-warn,
|
||||
languageclient_warning_count, whitespace)
|
||||
let g:airline_section_warning2 (whitespace) [optional]
|
||||
|
||||
" [*] This section needs at least the fugitive extension or else
|
||||
" it will remain empty
|
||||
|
||||
Reference in New Issue
Block a user