Commit Graph

248 Commits

Author SHA1 Message Date
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
Christian Brabandt
b7d3feb4d2
tabline: correctly refresh on :syn commands
fixes #1590 and #1638
2018-01-10 08:41:04 +01:00
Christian Brabandt
5db4c408bd
Update copyright notifications 2018-01-05 10:37:59 +01:00
Christian Brabandt
4d0233ebdb
plugin: correctly re-init on :syn-enable
should fix #1590 correctly
2018-01-04 21:09:26 +01:00
Christian Brabandt
133a76d2d4
plugin: reset syntax highlighting on :syn off
hopefully fixes #1590
2018-01-04 20:07:15 +01:00
Christian Brabandt
a8c4424244
highligthing: Enable cacheing only when config is set.
This enables the highlighting caching only when the variable
g:airline_highlighting_cache is set to 1

Should make airline faster and more performant, because we can save a
lot of expensive C core calls. However, when redefining highlighting
groups, it might not correctly reset the cache.
2017-08-14 08:06:53 +02:00
Christian Brabandt
6ee75bdbde
Fix failing tests 2017-08-11 12:55:44 +02:00
Christian Brabandt
a96681d459
highlighter: Cache syntax highlighting attributes
Should in theory improve performance by quiet a lot.
2017-08-11 11:26:35 +02:00
Christian Brabandt
b78c2ec475
Always enable airline by setting laststatus=2
Previously the user was expected to set 'laststatus' himself to 2 if he
wanted to have airline be shown by default.

However it doesn't make much sense to have airline installed but not
display the statusline. Therefore, set the 'laststatus' to 2, if it
isn't set to it already.
2017-07-02 20:42:32 +02:00
Christian Brabandt
b4ad02f906
fix wrong variable name 2017-03-20 08:56:35 +01:00
Christian Brabandt
703241942a
Add filetype to chache, disable cache for fugitive
#1452 (partly)
2017-03-20 08:37:48 +01:00
Christian Brabandt
3a23eeac42
Check that 'statusline' option is correct
statusline of quickfix window will be reset in the ftplugin of
$VIMRUNTIME, therefore check that airline is still active

fixes #1447
2017-03-17 12:03:19 +01:00
Christian Brabandt
70dd0655d2
Do not trigger on SessionLoadPost autocommand
This basically reverts commit 64a3bfd

closes #1444
2017-03-16 13:15:17 +01:00
Christian Brabandt
52663545a9
Only reset to Normal highlighting if it is actually defined
closes #1415 and similar
2017-02-28 08:33:44 +01:00
Christian Brabandt
b66c1ef070
Redraw statusline on CompleteDone event
closes #1402
2017-02-11 20:11:59 +01:00
thawk
45d77ca909 Add 'scriptencoding utf-8' to all scripts 2016-09-24 08:16:30 +08:00
Christian Brabandt
6e3c0c1c14 do not cache status of statusline per tabpage
When cacheing the values of buffer number, window number per tabpage, we
might forget to update the statusline when it is actually needed, e.g.
on `:tab help h | norm! gt` which would then still display "Help" also
we are not in a help window anymore.

Therefore cache those values (including current tabpage number)
globally.

fixes #1253
2016-09-14 19:05:57 +02:00
Christian Brabandt
62eb44a9d6 disable refresh function, if airline has been disabled
fixes #1213
2016-07-24 09:58:52 +02:00
Christian Brabandt
41df6668c7 Reset w:airline_active on TabEnter
fixes #1182
2016-06-23 18:09:01 +02:00
Christian Brabandt
70c16f4c46 Reset mode when resizing
fixes #1156
2016-05-15 11:13:29 +02:00
Christian Brabandt
eef069d7bc reset w:airline_active variable on TabEnter
fixes #1159
2016-05-13 14:41:31 +02:00
Christian Brabandt
46f854fc83 Use <nomodeline> if possible in :doautocmd
prevents closing of folds on CursorHold autocommand
when skip_empty sections is true
2016-05-13 11:22:12 +02:00
Christian Brabandt
64a3bfd439 Make sure the statusline option is correct
should fix #1131 completely, but literally comparing the
statusline option with the expected value
2016-04-28 07:17:44 +02:00
Christian Brabandt
b91f729586 call refresh function on window resize event
fixes #1144
2016-04-26 21:05:03 +02:00
Christian Brabandt
a5f7b9520a Check the value of the 'stl' setting on SessionLoadPost
Restoring a session using vim -S with 'sessionopts' including options,
might overwrite the statusline function.

fixes #1131
2016-04-21 20:03:42 +02:00
Christian Brabandt
1e77e6cbcc Merge pull request #1133 from blueyed/on_window_changed-only-once
Update each window only once in s:on_window_changed.
2016-04-20 21:31:52 +02:00
Daniel Hahler
5652b576b0 Add bang to function definitions
This makes it easier to reload the files, e.g. via vim-scriptease's
`:Runtime`.
2016-04-20 21:10:28 +02:00
Daniel Hahler
abcb3c4bb3 Update each window only once in s:on_window_changed.
We might come there several times for different autocommands.

The key uses bufnr/winnr and the number of total windows, and is stored
for the tab.
2016-04-20 21:06:04 +02:00
Christian Brabandt
7efa5067ef fix performance regression 2016-02-07 22:17:17 +01:00
Christian Brabandt
87d60febaf fix neovim color mode 2016-02-05 22:47:57 +01:00
Bailey Ling
ffe0fafa2d fix load regression errors with recent theme changes 2016-01-31 01:41:13 -05:00
Tuomas Penttilä
905522cd8b Fix issue when an airline theme and an external colorscheme have been defined 2016-01-30 21:35:14 +02:00
Christian Brabandt
e7560025d1 Fix break for non-existing g:airline_theme
fixes #969
2016-01-30 14:03:01 +01:00
Bailey Ling
d7fd8ca649 remove all themes from the core repository except for the default.
resolves #923
2016-01-29 22:24:49 -05:00