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
This will make sure that the current window will be highlighted as
expected, even if there are no other windows and all highlighting groups
will be correctly re-created as 'inactive'
references #1807
When switching away from Vim and your terminal supports the FocusLost
autocommand, set the statusline to inactive, so it won't distract you
too much when working with another application.
In the gui, the FocusLost autocommand should always trigger.
This is now the default, if people start complaining, that behaviour
should probably be made configurable.
closes#1807
closes#1730
- Make sure to always call the term extension on TermOpen autocommands
- consistently use the airline_term highlighting group
- hard code the airline_term highlighting group, because by the time the
function airline#themes#patch() is called the highlighting group
airline_c would no be defined, so we cannot dynamically get those
attributes
- In the documentation, mention how the g:airline_mode_map can be set
including the terminal section