Commit Graph

281 Commits

Author SHA1 Message Date
Christian Brabandt
915c7cfcd7
Fix brocken CI test
because vim 7.4 does not know v:vim_did_enter

I am beginning to wonder, whether we should have vim8 as a minimal
requirement...
2020-05-04 08:10:33 +02:00
Christian Brabandt
0ac474fdc4
plugin: load vim-airline as optional package
allow to load vim-airline as opt package

Fixes: 2122
2020-05-04 07:48:13 +02:00
David Briscoe
dd247a0f85 branch: ignore upcoming FocusGained when updating
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.
2020-01-28 12:01:09 -08:00
Christian Brabandt
f4795532c6
branch: disable FocusGained handler when updating fugitive information
closes #2029
2020-01-28 15:54:53 +01:00
kazukazuinaina
cf6dcf5e19 update license's year in vim-airline 2020-01-06 11:22:49 +09:00
midchildan
bc0e2a3438
fix missing check for w:airline_disable_statusline 2019-12-22 20:06:35 +09:00
Christian Brabandt
9f00b402c5
plugin: save/restore cpo setting
This has been missing way too long. It should always be set to a sane
vim default, as documented (:h write-plugin). So add it as well.
2019-12-13 10:17:15 +01:00
Christian Brabandt
5f9ae83f44
config: allow to disable setting the statusline option
closes #2013
2019-12-13 09:59:45 +01:00
Christian Brabandt
e395afed51
vista: init extension on VimEnter
closes #2009
2019-12-13 08:56:26 +01:00
Christian Brabandt
81fdc3b988
plugin: make use of rand() function from vim 8.1.2342 2019-11-25 17:13:33 +01:00
Christian Brabandt
19c655b420
plugin: do not trigger redraws for popup windows
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)
2019-11-25 16:24:58 +01:00
kazukazuinaina
0cba7d3ed6 add check to statusline's update 2019-10-24 16:19:58 +09:00
Christian Brabandt
73b4e4233c
Remove Neovim Workaround, as bug has been fixed 2019-06-12 11:26:09 +02:00
Christian Brabandt
48d9d5e901
neovim: Do not react on BufWinEnter for floating windows
closes #1930
2019-06-03 10:35:58 +02:00
Christian Brabandt
7d5302b51f
plugin: make the on_window_changed function take the autocommand as argument
This is just for making it easier to debug why the plugin update called
2019-06-03 08:30:27 +02:00
Christian Brabandt
ea7f5d5313
extensions: show loaded extension once (at most once)
could happen, that extensions are shown several times, if airline is
available in your &rtp several times (for whatever reason)
2019-05-03 12:43:21 +02:00
Christian Brabandt
a753422549
main: Make :AirlineRefresh! skip recrecrating highlighting groups
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
2019-04-26 10:16:40 +02:00
Christian Brabandt
d1d9548b8e
themes: correctly catch not-found in init function
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
2019-04-17 08:27:30 +02:00
Christian Brabandt
86e73cade7
Get a random number from win32 cmd.exe 2019-03-26 21:53:47 +01:00
Christian Brabandt
4265798d4b
style: rename inconsistent function names 2019-03-26 21:10:45 +01:00
Christian Brabandt
148eb6bb28
Allow to switch to a random theme
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.

closes vim-airline/vim-airline-themes#170
2019-03-26 21:03:13 +01:00
Christian Brabandt
a6fb6d9da0
Extensions: indicate, if an extension is external
Show in :AirlineExtensions if the extension comes bundled with airline
or from an external source.

closes #1890
2019-03-26 08:41:36 +01:00
Christian Brabandt
c8a36e14e9
Updated Copyright Statements 2019-03-25 12:29:47 +01:00
Christian Brabandt
25e384f236
wordcount: move User autocommand to plugin
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.
2019-02-04 08:25:45 +01:00
Christian Brabandt
8867301f78
plugin: Move tabline_update function to autoload 2019-02-04 08:23:58 +01:00
Christian Brabandt
fd5bde1a3a
allow to show the statusline on top
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 #1388
closes #1867
2019-02-03 17:30:55 +01:00
Christian Brabandt
72888d87ea
Revert "Make plugin reloadable"
This reverts commit 56197d5104.

fixes #1844
2018-12-18 16:13:03 +01:00
Christian Brabandt
56197d5104
Make plugin reloadable
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
2018-12-17 22:23:40 +01:00
Christian Brabandt
bd468dacfe
Revert TermOpen autocommand for Neovim
closes #1828
2018-11-22 08:31:14 +01:00
Christian Brabandt
f9ccb57e76
Make terminal extension work with Neovim 2018-11-20 15:55:11 +01:00
Christian Brabandt
fa11b8855b
Test for TerminalOpen Autocommand before using it 2018-11-20 15:28:29 +01:00
Christian Brabandt
904ac4eb0b
plugin: Reload terminal extension on :term command 2018-11-20 14:51:22 +01:00
Christian Brabandt
df0c1731db
Add :AirlineExtensions command
This shows whether or not an extensions has been loaded.
2018-11-14 08:06:39 +01:00
Christian Brabandt
ffac12cbbe
theme: do not show not-found warning
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
2018-11-14 07:36:45 +01:00
Christian Brabandt
b20e181bc8
Add a separate function for returning all available themes 2018-11-13 22:14:51 +01:00
Christian Brabandt
49671d0a11
terminal: do not reset airline theme on TerminalOpen
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)
2018-11-13 22:01:36 +01:00
Christian Brabandt
cd0b15b195
plugin: use airline#util#warning instead of echo consistently 2018-11-13 21:37:52 +01:00
Christian Brabandt
a334a89e59
plugin: better check for timer and funcref 2018-11-08 07:54:01 +01:00
Christian Brabandt
ce6cf6f07e
Check that funcrefs() actually exists
closes #1819
2018-11-07 17:55:11 +01:00
Christian Brabandt
33a633766d
main: do not trigger FocusGained on startup
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
2018-11-07 10:46:57 +01:00
Christian Brabandt
d81cdacb1e
better disabled highlighting for inactive windows on FocusLost
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
2018-10-16 10:49:17 +02:00
Christian Brabandt
07ac69570b
main: make FocusLost autocommand configurable
references #1807
2018-10-15 14:23:45 +02:00
Christian Brabandt
f045452743
main: disable airline on FocusLost
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
2018-10-03 12:31:45 +02:00
Christian Brabandt
a0298263b7
autocomd: do not re-evaluate modelines
fixes #1804
2018-09-25 16:03:30 +02:00
Liam Fleming
11bc0ba843 Move CursorMoved autocmd to main augroup 2018-06-16 20:34:07 +01:00
Christian Brabandt
7d871137be
Correctly test for CompleteDone event 2018-06-09 10:50:25 +02:00
Christian Brabandt
55716a1cc2
Remove wrong comment for TerminalOpen autocmd 2018-06-05 11:22:07 +02:00
Christian Brabandt
eab6d35852
terminal: Some improvements to Terminal detection
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
2018-06-04 22:44:46 +02:00
Christian Brabandt
d9acbc53b0
Reset g_airline_gui_mode on setting termguicolors
fixes #1663, should make sure that the separators are correctly
displayed even when setting 'termguicolors' later than expected.
2018-04-12 10:24:54 +02:00
Sheheryar Parvaz
8c1a7a5343 tabline: fix tabline on :syn on
better solution for #1590. Previous solution refreshes airline
completely which is much slower.
2018-01-20 23:27:32 -05:00