I noticed, that in some environments the default
g:airline_symbols[notexists] just does not show up, even when the same
font in the gui works. So let's at least mention a possible alternative,
that you can easily use in your vimrc:
```vim
if !exists("g:airline_symbols")
let g:airline_symbols = {}
endif
let g:airline_symbols.notexists = "\u2204"
```
using getwinvar directly with 7.3 version of vim display the following error
E118: Too many arguments for function: getwinvar
E15: Invalid expression: getwinvar(a:winnr, '&buftype', '') ==# 'popup'
When the sandbox is active (e.g. while debugging something), certains
commands and expressions are not allowed (see :h sandbox) and may cause
nasty exceptions to be thrown.
So try to catch E48 and handle it gracefully
When `g:airline_skip_empty_sections' is set, and a section is considered
and after that section comes the alignment separator '%=' than airline
would not correctly render the airline_prevgroup_to_airline_curgroup
simply because the '%=' marker confuses it about which is actually the
previous group.
So consider the '%=' marker to be empty as well.
The case can be observed, when having set
`g:airline_skip_empty_sections' to true and opening a help buffer.
Because in that case, airline_section_c will be considered empty, then
the alignment separator comes and after that airline will (wrongly)
generate a highlighting group `airline_c_to_airline_z`, while it should
actually generate `airline_b_to_airline_z`
as per https://github.com/tpope/vim-fugitive/issues/2034
This also fixes an issue that is shown in older Vims (pre 7.4.1711)
since those versions did not correctly catch exceptions while evaluating
the statusline.
closes#2566
fern.vim decided to remove the global variable `g:fern_loaded` in
f9404e8a59b6a74b15a5
So adjust to use the correct variable name `g:loaded_fern`.
fixes#2346
Back when the colnr symbol was first introduced in
8929bc72a1 it included symbol `\ue0a3`
when powerline fonts where supposed to be used by setting
`:let g:airline_powerline_fonts=1`
However, it turns out, that those symbol, may actually not be defined in
the powerline fonts at all, only in the
[powerline-extra-symbols](https://github.com/ryanoasis/powerline-extra-symbols)
and this has caused various issues, because it either did not display at
all, or the symbol caused strange overflowing issues which made the
overall look of the status line not very appealing and already caused
various issues here in the vim-airline repository.
Therefore, fall back to the symbol `\u2105` (℅) which at least is
already defined in the Unicode specification and has therefore a higher
chance of being defined inside a powerline font at all (but it may still
be missing after all).
Also, it is more consistent, because it will now use the same symbol as
when `g:airline_powerline_fonts` is not defined and the default Unicode
symbols are selected.
So if you want to keep on using the old symbol, you need to use:
```
let g:airline_symbols.colnr="\ue0a3:"
```
fixes: #2563
related: #2381
927e142e94 broke the "show the lang flag"
functionality, as the check `if g:airline_detect_spelllang` is always
false when this variable is `'flag'`. Explicitly check whether this
variable is the string `'0'` to detect whether the feature should be
disabled.
Not marking the end makes the rest of line (after the close button) also clickable and react as if the close button was clicked. That is very confusing and incorrect behavior.
The last PR (#2522) caused some issues for me, and the author @KSR-Yasuda suggested that this change could be the culprit. `__CtrlSF__` and `[No Name]` tabs appearing, and adding them to `airline#extensions#tabline#ignore_bufadd_pat` just made the whole tabline disappear.
I also use the Startify plugin with session saving, and found that when restoring a session, the tabs would no longer appear until I had visited a buffer again, whereas beforehand they would load up a soon as I opened Vim. So I commented out my entire vimrc, and could reproduce this issue by opening an existing session with `vim -S mysession`. Without this fix, only a single buffer from the session is shown in the tabline.
I'm using regular Vim, version 8.2 on MacOS 12.3.1.
- Manage `nobuflisted` windows together
- If a tab has no `buflisted` window,
the tab label is named from default buffer name.
- Fix default buffer name selection from wrong tab
- It has picked up default buffer name from active tab,
not from the target tab.
With Neovims recent merge of a global statusline (e.g. a statusline that
is the same across all windows), make sure that truncation only happens,
by checking the complete terminal window width instead of using the Vim
window width (similar to when using g:airline_statusline_ontop).
related: #2517
The current way to parse the statusline content and decide whether a
section is empty, has some flaws:
That is for the following reasons:
- accents are considered to be empty (which they really shouldn't)
- manually parsing the expressions using a
`:while ... matchlist() ... endwhile` loop is slow and fragile
- grouping items such as %( %) are not considered
So replace the logic by using `substitute('pat', '\=add()', '')` to
capture all single expression groups into a list and then looping over
those to decide whether the section is empty.
fixes#2411
So with https://github.com/jmcantrell/vim-virtualenv you can display the
virtualenv in your statusline section (if you have enabled it). However
it would only become active for python buffers.
Now perhaps you want to show the virtualenv also in other filetypes like
markdown or CI scripts, so allow this by adding a variable
`airline#extensions#virtualenv#ft'` to the list of filetypes you want to
have enabled. So set:
let g:airline#extensions#virtualenv#enabled = 1
let g:airline#extensions#virtualenv#ft = ['python', 'markdown']
To allow displaying the virtual environment for python and markdown
buffers (but remember you need to have the plugin
https://github.com/jmcantrell/vim-virtualenv installed as well!)
fixes#2483
When openning popup (vim) or floating (neovim) windows,
do not consider those windows for disabled windows. That is, leave the
main window in activate state instead of marking it disabled
closes: #2387
When using Neovim and switching to another buffer with the mouse and the
current buffer is modified, Vim refuses to switch buffers rightfully,
if the user has not set 'hidden' or 'autowrite' (because it is going to
unload the buffer from memory).
So catch this case and let the user know.
Note: :b! would be another possibility, but I do not prefer using this
attribute, because it is not clear what happens to the current buffer. I
think it is made hidden, but I prefer to be explicit here
closes#2478