Revert Section Z default value

Keep the section to commit 8929bc72a1,
this is, as it was before #2374 and #2385 (and how it is still described
in the readme), which has been working fine for years:

> The information in Section Z looks like this:
>
> `10% ☰ 10/100 ln : 20`

instead of reversing the symbols, adding extra characters and completely
botching spacing trying to fix the resulting rendering problems.

No reason to fix what's not broken.

Keep the added 'colnr' configuration, which was a good addition.
This commit is contained in:
Sebastián Mancilla 2021-09-10 22:29:39 -03:00
parent 2e29ab9656
commit a9dc15d6c6
2 changed files with 25 additions and 40 deletions

View File

@ -86,16 +86,13 @@ function! airline#init#bootstrap()
call s:check_defined('g:airline_left_alt_sep', "\ue0b1") "  call s:check_defined('g:airline_left_alt_sep', "\ue0b1") " 
call s:check_defined('g:airline_right_sep', "\ue0b2") "  call s:check_defined('g:airline_right_sep', "\ue0b2") " 
call s:check_defined('g:airline_right_alt_sep', "\ue0b3") "  call s:check_defined('g:airline_right_alt_sep', "\ue0b3") " 
" ro=, ws=☲, lnr=, mlnr=☰, colnr=, br=, nx=Ɇ, crypt=🔒, dirty=⚡ " ro=, ws=☲, lnr=☰, mlnr=, colnr=:, br=, nx=Ɇ, crypt=🔒, dirty=⚡
" Note: For powerline, we add an extra space after maxlinenr symbol,
" because it is usually setup as a ligature in most powerline patched
" fonts. It can be over-ridden by configuring a custom maxlinenr
call extend(g:airline_symbols, { call extend(g:airline_symbols, {
\ 'readonly': "\ue0a2", \ 'readonly': "\ue0a2",
\ 'whitespace': "\u2632", \ 'whitespace': "\u2632",
\ 'maxlinenr': "\u2630 ", \ 'linenr': "\u2630 ",
\ 'linenr': " \ue0a1:", \ 'maxlinenr': " \ue0a1",
\ 'colnr': " \ue0a3:", \ 'colnr': ":",
\ 'branch': "\ue0a0", \ 'branch': "\ue0a0",
\ 'notexists': "\u0246", \ 'notexists': "\u0246",
\ 'dirty': "\u26a1", \ 'dirty': "\u26a1",
@ -107,13 +104,13 @@ function! airline#init#bootstrap()
call s:check_defined('g:airline_left_alt_sep', "") call s:check_defined('g:airline_left_alt_sep', "")
call s:check_defined('g:airline_right_sep', "") call s:check_defined('g:airline_right_sep', "")
call s:check_defined('g:airline_right_alt_sep', "") call s:check_defined('g:airline_right_alt_sep', "")
" ro=⊝, ws=☲, lnr=㏑, mlnr=☰, colnr=℅, br=ᚠ, nx=Ɇ, crypt=🔒 " ro=⊝, ws=☲, lnr=☰, mlnr=㏑, colnr=:, br=ᚠ, nx=Ɇ, crypt=🔒
call extend(g:airline_symbols, { call extend(g:airline_symbols, {
\ 'readonly': "\u229D", \ 'readonly': "\u229D",
\ 'whitespace': "\u2632", \ 'whitespace': "\u2632",
\ 'maxlinenr': "\u2630", \ 'linenr': "\u2630 ",
\ 'linenr': " \u33d1:", \ 'maxlinenr': " \u33D1",
\ 'colnr': " \u2105:", \ 'colnr': ":",
\ 'branch': "\u16A0", \ 'branch': "\u16A0",
\ 'notexists': "\u0246", \ 'notexists': "\u0246",
\ 'crypt': nr2char(0x1F512), \ 'crypt': nr2char(0x1F512),
@ -128,9 +125,9 @@ function! airline#init#bootstrap()
call extend(g:airline_symbols, { call extend(g:airline_symbols, {
\ 'readonly': 'RO', \ 'readonly': 'RO',
\ 'whitespace': '!', \ 'whitespace': '!',
\ 'linenr': ' ln:', \ 'linenr': 'ln ',
\ 'maxlinenr': '', \ 'maxlinenr': ' ',
\ 'colnr': ' cn:', \ 'colnr': ':',
\ 'branch': '', \ 'branch': '',
\ 'notexists': '?', \ 'notexists': '?',
\ 'crypt': 'cr', \ 'crypt': 'cr',
@ -236,9 +233,9 @@ function! airline#init#sections()
endif endif
if !exists('g:airline_section_z') if !exists('g:airline_section_z')
if airline#util#winwidth() > 79 if airline#util#winwidth() > 79
let g:airline_section_z = airline#section#create(['windowswap', 'obsession', '%p%%', 'linenr', 'maxlinenr', 'colnr']) let g:airline_section_z = airline#section#create(['windowswap', 'obsession', '%p%%'.spc, 'linenr', 'maxlinenr', 'colnr'])
else else
let g:airline_section_z = airline#section#create(['%p%%', 'linenr', 'colnr']) let g:airline_section_z = airline#section#create(['%p%%'.spc, 'linenr', 'colnr'])
endif endif
endif endif
if !exists('g:airline_section_error') if !exists('g:airline_section_error')

View File

@ -71,14 +71,12 @@ section meaning (example)~
optionally may contain Byte Order Mark `[BOM]` and missing end of last optionally may contain Byte Order Mark `[BOM]` and missing end of last
line `[!EOL]` line `[!EOL]`
Z current position in the file Z current position in the file
percentage % ln: current line/number of lines ☰ cn: column percentage % ☰ current line/number of lines ln : column
So this: 10% ln:10/100☰ cn:20 So this: 10% ☰ 10/100 ln : 20 means: >
means: >
10% - 10 percent 10% - 10 percent
ln: - line number is ☰ 10 - current line 10
10/100☰ - 10 of 100 total lines /100 ln - of 100 lines
cn: - column number is : 20 - current column 20
20 - 20
< <
[...] additional sections (warning/errors/statistics) [...] additional sections (warning/errors/statistics)
from external plugins (e.g. YCM/syntastic/...) from external plugins (e.g. YCM/syntastic/...)
@ -345,16 +343,6 @@ CUSTOMIZATION *airline-customization*
The following are some unicode symbols for customizing the left/right The following are some unicode symbols for customizing the left/right
separators, as well as the powerline font glyphs. separators, as well as the powerline font glyphs.
Note: Some additional characters like spaces and colons may be included in the
default. Including them within the symbol definitions rather than outside of
them allows you to eliminate or otherwise alter them.
Note: Be aware that some of these glyphs are defined as ligatures, so they may
show up different (usually bigger) if followed by a space. This only happens
if both the font and terminal implementation used support ligatures. If you
want to follow a glyph with a space _without_ the alternate ligature being
rendered, follow it with a non-breaking-space character.
Note: You must define the dictionary first before setting values. Also, it's Note: You must define the dictionary first before setting values. Also, it's
a good idea to check whether it exists as to avoid accidentally overwriting a good idea to check whether it exists as to avoid accidentally overwriting
its contents. > its contents. >
@ -367,12 +355,12 @@ its contents. >
let g:airline_left_sep = '▶' let g:airline_left_sep = '▶'
let g:airline_right_sep = '«' let g:airline_right_sep = '«'
let g:airline_right_sep = '◀' let g:airline_right_sep = '◀'
let g:airline_symbols.colnr = ' :' let g:airline_symbols.colnr = '㏇'
let g:airline_symbols.colnr = ' :' let g:airline_symbols.colnr = '℅'
let g:airline_symbols.crypt = '🔒' let g:airline_symbols.crypt = '🔒'
let g:airline_symbols.linenr = '☰' let g:airline_symbols.linenr = '☰'
let g:airline_symbols.linenr = ' :' let g:airline_symbols.linenr = '␊'
let g:airline_symbols.linenr = ' :' let g:airline_symbols.linenr = '␤'
let g:airline_symbols.linenr = '¶' let g:airline_symbols.linenr = '¶'
let g:airline_symbols.maxlinenr = '' let g:airline_symbols.maxlinenr = ''
let g:airline_symbols.maxlinenr = '㏑' let g:airline_symbols.maxlinenr = '㏑'
@ -390,10 +378,10 @@ its contents. >
let g:airline_right_sep = '' let g:airline_right_sep = ''
let g:airline_right_alt_sep = '' let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = '' let g:airline_symbols.branch = ''
let g:airline_symbols.colnr = ' :' let g:airline_symbols.colnr = ':'
let g:airline_symbols.readonly = '' let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = ' :' let g:airline_symbols.linenr = ''
let g:airline_symbols.maxlinenr = '' let g:airline_symbols.maxlinenr = ''
let g:airline_symbols.dirty='⚡' let g:airline_symbols.dirty='⚡'
" old vim-powerline symbols " old vim-powerline symbols