Make sure, to also check, if the separator groups have already been
defined. Once they are defined initially, they are usually available in
the palette group. So do not redefine them once they have been created
initially.
references #1779
Previously, we only checked for if the name starts with 'airline_c'
But there could as well be highlighting groups starting being called
'airline_b_to_airline_c5', but if buffer 5 is no longer visible in the
current viewport, then we do not need to recreate those groups.
currently, if the matchstr() evaluates to '', it would skip the required
section, because bnr would be evaluated to zero and since there is no
buffer zero, skip that highlighting group.
Make sure, to only skip the highlighting group if the buffer number is
actually > 0
In a long editing session, there could happen to accumulate several
highlighting groups for buffers that might no longer be visible.
Therefore, only re-create the highlighting group for buffers that are
actually displayed in the current tabpage. If not, skip them.
references #1779
previously, it could happen that the same highlighting group was defined
several times, because it was available in several modes within
g:airline#theme[mode]. So the second one would always win.
Therefore, loop through all modes in reverse order and define the group
and remember what group has already been defined. If we happen to have
to re-define the same group, skip it. Since we are traversing the list
in reverse order, this should make sure the last definition wins.
This has the benefit of being more performant and hopefully helps with
e.g. #1779 and similar issues.
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
At the moment you can never be sure whether you look at the results
that ale just produced after your last changes or you are looking at
outdated information.
Instead of showing the last results while ale executes checks on the
current buffer it can now show a specific indicator.
This commit introduces the new config variable
`g:airline#extensions#ale#checking_symbol` which defaults to "...". In
case you don't want to see this, you may set it to an empty string.
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
Previously the ale refresh was triggered after user interactions only.
When linting takes some time and the user is not actively working the
ale information was not updated while the things ale directly controls
were updated. This change makes showing linting results a loot smoother.
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
for older Vims, the wordcount extension falls back to `g<c-g>` and
parses the messaage that is generated.
When doing so, it expects the English locale, which might not be true.
Therefore, try to regex parse the result without using the english words
(assuming the output is still in the same order as in English).
Compatibility:
- Don't use a script-local function to update the format strings
- Protect against `:normal!' moving the cursor on on the wordcount check
Bugfix:
- Let to_string() try to return something for all values
- Now returns correctly when passed both 0 and '0'
Upkeep:
- Simplify check again no valid key from winwidth()
- Old wordcount check: use matchstr() - more expressive and fewer steps
- Improve documentation style/clarity/detail
v:t_list is an internal variable describing the type of a list.
Unfortunately, this is not available in older vims. So let's fall back
to using `type([])`
see #1795
This prevents a warning message, when the function is tried to add
several times. Also while at it, add a '!' so that no error is thrown if
the file is sourced a second times.