Commit Graph

77 Commits

Author SHA1 Message Date
amarakon 3fe71a6ce6 Remove trailing whitespace 2022-09-30 23:25:47 -04:00
Shad dba64a910d
Update util.vim
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'
2022-09-26 15:01:40 +02:00
Christian Brabandt 2cea8346cf
plugin: handle sandbox mode gracefully
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
2022-09-07 09:44:51 +02:00
Christian Brabandt 5d7e656081
fugitive: remove old fugitive test
As mentioned by @tpope, remove the old test for the autoloaded function
fugitivie#head() and instead use consistently FugitiveHead() everywhere
2022-05-21 21:58:11 +02:00
Christian Brabandt 1d486430cc
neovim: support global statusline and do not truncate too early
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
2022-03-23 19:40:21 +01:00
Gauravsingh Sisodia 8e36c0a8ed
main: ignore popup windows for inactive windows
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
2021-12-05 19:05:15 +01:00
Christian Brabandt 49cdcb7b3e
vim9: Needs at least version 8.2.22844 2021-06-07 13:44:53 +02:00
kazukazuinaina 51c79f61f4 [add] winwidth's test 2021-05-14 02:25:14 +09:00
Vincenzo Di Massa f7cbf8c429
glob return results without removing wildignore matches
Ignore 'wildignore' and 'suffixes' when globbing for themes and extensions.

This can be a problem when you have a wildignore containing *.vim.

closes #2375
2021-05-03 08:37:05 +02:00
Trevor Stone 7a87615cbe Fire AirlineToggledOff autocmd even if airline is disabled
Fixes #2377.  This regression was introduced in 2e9df43.
2021-05-02 21:44:45 -06:00
Christian Brabandt 2e9df43962
autocommands: check for existence of airline highlight group
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
2021-04-30 13:26:33 +02:00
Bailey Ling 5601c0928e Happy new year! 2021-01-01 12:57:00 +00:00
David Briscoe c2ff76829f Ignore FocusGained events for the current second
Fix #2062: restore g:airline_focuslost_inactive behaviour.

Only ignore focusgained events on Windows. If there are more problematic
platforms, we'll add them later.

Instead of ignoring the next x FocusGained events whenever we do call
system(), ignore them for the current second. That allows us to put a
hard limit on the duration of the ignore.

This seems like a much better solution than the previous one because it
also prevents ignore events from building up (s:focusgained_ignored was
often greater than 5).

Test (gvim 8.2.140 on Win10)
gvim.exe ~/.vim/bundle/airline/autoload/airline/extensions/branch.vim
:Gedit HEAD
check several parents and no regression of looping behaviour from #2053.

:let g:airline_focuslost_inactive = 1
:split
alt-tab several times and statusline is correctly dimmed and restored
each time.
2020-02-21 09:21:47 -08:00
Christian Brabandt f659a98d50
completion: only return random theme, when it actually matches 2020-01-30 13:42:21 +01: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 9779a7a340
allow disabling airline per-buffer 2019-12-22 21:26:59 +09:00
midchildan bc0e2a3438
fix missing check for w:airline_disable_statusline 2019-12-22 20:06:35 +09:00
kazukazuinaina 44b1e3df5d can choice to use gina's extension
fix typo

add v:version >= 800and remove v:version > 704

fix CI error
2019-12-18 00:44:47 +09:00
kazukazuinaina f8e1f85fde add gina support for vim-airline's branch
add check gina in util.vim

fix typo

add gina check

fix typo

add gina.vim's url in doc

fix typo

delete v:version > 800

fix error
2019-12-14 04:10:46 +09:00
Christian Brabandt 5f9ae83f44
config: allow to disable setting the statusline option
closes #2013
2019-12-13 09:59:45 +01:00
Christian Brabandt 6409c7b317
tabline: do not display neovim terminal there 2019-08-26 15:16:38 +02:00
Christian Brabandt 22f54d8528
sort airline#extensions#tabline#ignore_bufadd_pat 2019-08-26 15:14:21 +02:00
Christian Brabandt 018688a90f
tabline: do not show defx buffers
fixes #1962
2019-08-26 15:11:50 +02:00
Christian Brabandt 57fb980df7
util: micro-optimization of existence check for vcscommand plugin 2019-08-20 22:30:20 +02:00
Christian Brabandt 5df9e23f14
util: micro-optimization of existence check for lawrencium 2019-08-20 22:28:49 +02:00
Christian Brabandt 0370a3b89b
util: micro-optimization of existence check for fugitive 2019-08-20 22:28:49 +02:00
Christian Brabandt 51e74f1d1f
util: micro-optimization of existence check for strcharpart() 2019-08-20 22:22:19 +02:00
Christian Brabandt ccef93e887
util: micro-optimization of existence check for strchars() 2019-08-20 22:20:39 +02:00
Christian Brabandt 15322e41c7
util: Add comment header, declaring s:vars as constant 2019-08-20 22:19:48 +02:00
Kai Moschcau 3f82d3a975
Improve multibyte character handling in branch ext
This fixes a bug that causes a mangled statusline. The bug occurs, when
the `displayed_head_limit` variable is set and causes the substring
expression to take a substring, which ends in the middle of a multi-byte
character.

This patch replaces the byte-based methods for measuring the
length of the branch name and creating a substring with methods that are
character-based and multi-byte aware.

It also has the nice side effect of making the length measuring more
accurate, by taking the actual display width of multi-byte characters
and the ambiwidth setting into account.

Since we need to take into account older Vim 7.4 (which might not have
the strcharpart() function), do introduce a compatibility wrapper in
airline#util that checks for the existence of the function before using
it. Older Vims will keep on using the byte-based index. I suppose Vim
7.4 before the strcharpart() function was available (patch 7.4.1730)
shouldn't be in use anymore.

closes #1948
2019-08-20 14:21:10 +02: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 c8a36e14e9
Updated Copyright Statements 2019-03-25 12:29:47 +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 b20e181bc8
Add a separate function for returning all available themes 2018-11-13 22:14:51 +01:00
Christian Brabandt d441b3f7b6
util: use correct endfunction style 2018-11-13 21:11:04 +01:00
Christian Brabandt a0298263b7
autocomd: do not re-evaluate modelines
fixes #1804
2018-09-25 16:03:30 +02:00
Christian Brabandt a60eabb82f
tabline: do not show terminal buffers by default 2018-09-20 10:25:47 +02:00
Christian Brabandt 981b83003f
fugitive: Use FugitiveHead() instead of fugitive#head
function if possible and use it instead of the fugitive#head
(which will always autload the fugitive plugin).
2018-06-04 18:32:30 +02:00
Christian Brabandt a1680cc36d
fugitive: Check for existence of FugitiveStatusline function
as per @tpopes advice.
2018-06-04 17:42:33 +02:00
Christian Brabandt 30a3c4f549
branch: fugitive renamed its functions
this caused that the branch extension was not correctly working anymore
because of a refactoring of fugitive tpope/vim-fugitive@5d11ff7

Solution: Move the existence check for the fugitive plugin into a
separate function and call it from there in all places that check the
fugitive plugin. Do the same for lawrencium and vcscommand check.

fixes #605 #1739
2018-06-04 17:38:49 +02:00
Christian Brabandt b84e13f1d7
Blacklist startify for [noperm]
Startify unfortunately does not set the buftype option, so the
`[noperm]` would be shown, since the buffer is not really a file.
(see mhinz/vim-startify#324)

So allow to blacklist startify from this setting. To do so, the logic
from the tabline extension was refactored out into a separate function
that returns true, if the buffer matches
`g:airline#extensions#tabline#ignore_bufadd_pat` and that function is
then reused for the readonly() function as well.
2018-05-11 22:32:20 +02:00
mrmr1993 51bb8dd7e0 Move strchars into util.vim 2018-03-19 15:03:51 +00:00
Christian Brabandt 5db4c408bd
Update copyright notifications 2018-01-05 10:37:59 +01:00
Christian Brabandt 4c74a95045
Refactor async functions
- create a new async module
- refactor async functions from branch.vim and po.vim to async.vim
- support nvim async correctly
2017-08-23 18:37:24 +02:00
Christian Brabandt 50bfe8dd68
First commit to handle nvim specific async code 2017-08-23 18:31:43 +02:00
Christian Brabandt b2f301f73c
tabline: Cache title as tablocal variable 2017-06-27 14:40:31 +02:00
Christian Brabandt a950a2938a
shorten tagbar extension on short windows 2017-05-02 21:22:47 +02:00
Hirokazu Hata dfc0cb772a Add dict to function refferencing self
This is no explicit problem in Vim, however Neovim diverged in this
behaviour from Vim and requires the dict attribute to be present before
accessing the self attribute.

See neovim/neovim#5763
2016-12-12 19:26:52 +01:00