When airline is configured to show on top (`let g:airline_statusline_ontop = 1`)
and vim's `laststatus` option is configured to be hidden (`set laststatus=0`)
then there is no need to override its setting.
E.g. how to disable the FocusGained event by setting the 'eventignore'
option.
Add some boilerplate to skip the focusgained function handler function, if it should be
ignored. (this should in theory stop setting up the autocommands at all
so might be tiny performance optimization).
closes#2421
Ignore 'wildignore' and 'suffixes' when globbing for themes and extensions.
This can be a problem when you have a wildignore containing *.vim.
closes#2375
Several extensions trigger custom actions. Make sure, those actions are
only performed, if airline is actually active and not temporarily
disabled using e.g. :AirlineToggle
This is needed for Neovim, because an external UI could be attached to
the same neovim server, so it does not make sense to define highlighting
groups with either only the cterm or the guifg attribute set.
So refactor the code slightly got get rid of this variable (and since
this variable is not needed anymore, we can also get rid of the guienter
and OptionSet autocommand).
fixes: #2261
closes#2029
airline#util#focusgain(1) was called too soon -- it's called before vim
loses focus and not after it gains focus. Instead, we ignore the next
FocusGained event.
coc.nvim might set the filetype of the poppup window, which might
trigger a redraw of the statusline, causing the current window to become
inactive.
So bail out early, if the current buffer is a popup buffer. It cannot
have a statusline anyhow.
fixes#1930 (but this time for Vim)
When `g:skip_empty_sections` is set, `:AirlineRefresh` can be called
very often and cause slow down, because it forcefully re-creates the
highlighting groups. This is mostly not needed for the redraw to happen,
therefore, add the `<bang>` attribute to the command, making it skip to
re-create the highlighting groups and have all extensions that rely on a
forced update use the `!` form.
Should be much fast then.
fixes#1908
plugin/airline.vim was calling airline#switch_theme() without actually
catching the 'not-found' exception.
Therefore, in case of errors, explicitly switch to a dark theme.
closes#1903
You can now specify the special theme name `random` and vim-airline will
load a random theme from the ones installed. This works from either your
.vimrc as well as when calling `:AirlineTheme` command directly.
closesvim-airline/vim-airline-themes#170
Do not scatter the autocommands around, but rather move the auto command
to the main plugin file. The function that handles the auto command will
be created in the autoload script.
Also add a call to force updating the tabline, if g:airline_statusline_ontop
is defined.
In addition, the wordcount() extension did not correctly notice
block-wise visual mode, so while creating the airline#mode_changed()
function, make the mode also detect blockwise visual mode correctly.
This is an experimental feature that allows to display the statusline in
the tabline. It might still be a bit rough, but seems to work so far.
Remaining problem:
- Mode changes are not immediately detected, only after moving the
cursor
fixes#1388closes#1867
there was a call to s:init() missing in the toggle function.
Without it, it wouldn't reload correctly, since the s:initialized
variable would never be set to 1 again. So load it when setting up
everything correctly.
fixes#1842
Only show the "airline theme not found" warning message, when the user
actually used `:AirlineTheme foobar`, not when called by an autocommand
that tries to switch themes when the Vim colorscheme changed.
fixes#1824
remove autocommand, that would overwrite the airline theme on :term
(e.g. After a :AirlineTheme monochrome and then using `:term` the
autocommand would reset the theme back to the one given in the .vimrc)
commit f045452743 introduced the
FocusGained autocommand. Unfortunately, for some systems this might
trigger already at startup, resulting in an unwanted redraw that might
clear the intro screen.
Therefore, add a timer, that enables the FocusGained autocommand after 5
seconds. The 5 seconds is somewhat arbritrarely, but we could change it
later if it turns out to be not useable.
fixes#1817