Commit Graph
100 Commits
Author SHA1 Message Date
Christian Brabandt cd0b15b195 plugin: use airline#util#warning instead of echo consistently 2018-11-13 21:37:52 +01:00
Christian Brabandt c3ee263d5b whitespace: use airline#util#warning instead of echo consistently 2018-11-13 21:37:52 +01:00
Christian Brabandt 2eaf57ece8 xtabline: use airline#util#warning instead of echo conistently 2018-11-13 21:37:52 +01:00
Christian Brabandt c850f485ad autoload: use airline#util#warning instead of echo 2018-11-13 21:37:48 +01:00
Christian Brabandt 464633baad themes: Do not try to load the palette twice
This will be done explicitly by the switch_theme() function
2018-11-13 21:17:48 +01:00
Christian Brabandt d441b3f7b6 util: use correct endfunction style 2018-11-13 21:11:04 +01:00
Christian Brabandt f05f649be8 highlighter: even further refinement of when to skip groups 2018-11-13 13:57:15 +01:00
Christian Brabandt cfd373a5a2 highlighter: Better check, when to skip groups
Groupnames like 'airline_c1_to_airline_x_inactive' still have to be
processed, so do not skip them.

Also for the tabline, '_inactive' groups are not used, so skip them
2018-11-13 13:48:26 +01:00
Christian Brabandt 6ceaffc49a documentation: Mention AirlineModeChanged
In 781c40bb3d the AirlineModeChanged user-defined
autocommand has been introduced. However it was forgotten to mention
this actually in the documentation.

So here we go.

closes #1774
2018-11-13 09:19:56 +01:00
Christian Brabandt 78e67897a4 highlight: fix previous commit differently
Actually we can restrict the loop condition to only run 5 times instead
of 6 (which was an oversight).
2018-11-13 09:06:39 +01:00
Christian Brabandt e66d65ebf4 highlighter: break out of loop at the end
thanks for mentioning @jottkaerr at
https://github.com/vim-airline/vim-airline/commit/4d8a06a5a911bc5aac35504b0971365d528dae29#commitcomment-31275754
2018-11-13 08:50:10 +01:00
Christian Brabandt 4d8a06a5a9 highlighter: get rid of s:Get() function
Replace by a function that retuns the to be executed highlighting string

Should in theory be a bit faster, since the same function does not have
to be called 5 times per highlighting group.

It probably is not much better, but here are some random numbers:

Profiling:

Previously:
count  total (s)   self (s)
  199   0.022973   0.009909     let cmd = printf('hi %s %s %s %s %s %s %s %s', a:group, s:Get(colors, 0, 'guifg=')…

New:
count  total (s)   self (s)
   79   0.010166   0.000862     let cmd = printf('hi %s%s', a:group, s:GetHiCmd(colors))
2018-11-12 17:59:02 +01:00
Christian Brabandt 6c6c6c104f highlighter: exec_separator will re-create '_to_' groups
so we don't need to re-create them in the main for loop of
airline#highlighter#highlight() and so skip those groups.
2018-11-12 05:18:53 +01:00
Christian Brabandt f3d6a3542a Revert "highlighter: also check separator groups for being defined"
This reverts commit 99971aa24d.
2018-11-11 21:18:13 +01:00
Christian Brabandt e8fd2057a8 doc: Mention how to add funtions for inactive statuslines 2018-11-08 17:20:41 +01:00
Christian Brabandt 8c36d2b595 allow to use alternative seperators for inactive windows
closes #1236
2018-11-08 17:09:17 +01:00
Christian Brabandt a993ae5d42 builder: don't call add_separtor twice 2018-11-08 16:44:26 +01:00
Christian Brabandt f08078d683 autoload: add comments 2018-11-08 16:20:37 +01:00
Christian Brabandt 99971aa24d highlighter: also check separator groups for being defined
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
2018-11-08 15:31:58 +01:00
Christian Brabandt d57344a3c3 highlighter: skip more buffer related hi groups
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.
2018-11-08 13:32:20 +01:00
Christian Brabandt 496de8b745 highlighter: do not skip empty c_sections
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
2018-11-08 12:40:46 +01:00
Christian Brabandt 71dc6f0257 highlighter: fix regex typo 2018-11-08 12:24:02 +01:00
Christian Brabandt 09b5eb952c highlighter: Only recreate hi groups for visible buffers
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
2018-11-08 12:20:55 +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 b7367c605a highlighter: do not redefine the same groups several times
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.
2018-11-07 14:25:40 +01:00
Christian Brabandt 18200bfad3 modes: do not add special sections to accents 2018-11-07 13:49:22 +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 776f7aa948 Merge pull request #1816 from amiller27/numbered-ctrlspace-tabs
Add option for numbered tabs
2018-11-01 16:10:16 +01:00
Christian Brabandt 6516b1b4dc po: only reset cache if window width changed 2018-11-01 11:18:04 +01:00
Christian Brabandt fc021cf4e8 po: only substitute, if value is present in string 2018-11-01 11:14:57 +01:00
Christian Brabandt 6508558c3d po: shorten and reformat message format for smaller windows 2018-11-01 10:40:41 +01:00
Christian Brabandt 08e9aa5386 Merge pull request #1810 from LarsMichelsen/visualize_checking
Visualize that ale is currently checking the current buffer
2018-10-22 08:59:52 +02:00
Christian Brabandt 2e99805dbf Fix failing test 2018-10-16 12:13:24 +02:00
Christian Brabandt 726b730f0a highlight: correctly cache and restore reverse attributes for highlighting colors
references #1779
2018-10-16 12:03:31 +02:00
Christian Brabandt 7e004804d1 Merge pull request #1811 from LarsMichelsen/update_post_ale
Improve update logic after ale finished
2018-10-16 10:56:49 +02: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 c44bbc66f5 main: make sure winnr is available in s:context for check_mode function 2018-10-16 10:26:26 +02:00
Christian Brabandt 61e2c7f86a Merge pull request #1813 from fishioon/master
Remove trailing space
2018-10-15 15:53:12 +02:00
Christian Brabandt 07ac69570b main: make FocusLost autocommand configurable
references #1807
2018-10-15 14:23:45 +02:00
Christian Brabandt 68f5f1e50d mode: Update doc, sort dict 2018-10-15 14:17:49 +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 13993d120e Merge pull request #1805 from doronbehar/exteralize-quickfix-type-func
Externalize quickfix function returning text
2018-10-02 20:17:56 +02:00
Christian Brabandt a0298263b7 autocomd: do not re-evaluate modelines
fixes #1804
2018-09-25 16:03:30 +02:00
Christian Brabandt 57bbe050c7 Merge pull request #1801 from flemingfleming/wordcount-fixes
The rest of the wordcount fixes, and some improvements
2018-09-23 17:38:11 +02:00
Christian Brabandt dd508340ea Merge pull request #1803 from dfalling/master
Add dictionary key check for d.severity
2018-09-23 17:37:25 +02:00
Christian Brabandt ae024293e4 wordcount: fix wrong normal mode command 2018-09-21 21:37:21 +02:00
Christian Brabandt ecf10d0e58 wordcount: check that the retun value has the dict key
else it will throw an error.
2018-09-21 11:49:42 +02:00
Christian Brabandt 11e6492849 Merge pull request #1797 from flemingfleming/wordcount-improvements
wordcount: Update documentation
2018-09-20 17:34:02 +02:00
Christian Brabandt 82a6097b01 wordcount: work-around non-existing v:t_list
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
2018-09-20 11:44:17 +02:00
Christian Brabandt 7957bd1d32 wordcount: only add fmt function once to statusline functions
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.
2018-09-20 10:41:50 +02:00
Christian Brabandt 110594c91a tabline: remove spurious variable 2018-09-20 10:31:14 +02:00
Christian Brabandt 012229fe08 tabline: Ignore buffers in buflist matching ignore_bufadd_pat
closes #1777
2018-09-20 10:26:32 +02:00
Christian Brabandt a60eabb82f tabline: do not show terminal buffers by default 2018-09-20 10:25:47 +02:00
Christian Brabandt fce8585239 main: detect some more modes 2018-09-20 10:13:59 +02:00
Christian Brabandt 326b37cf13 help: document tag airline#extensions#tabline#exclude_buffers 2018-09-20 10:13:59 +02:00
Christian Brabandt 1b8ecb6336 Merge pull request #1796 from flemingfleming/wordcount-improvements
[WIP] Rewrite wordcount plugin
2018-09-20 10:04:53 +02:00
Christian Brabandt 251ed064e8 Make mode return only single letter except for virt replace mode
commit bcd37fc115 changed the detection of modes slightly in that it
allowed not only single letters but also several letters.

While in theory, it might be okay to have extra modes displayed like
Insert Completion or Normal Insert, or Operator Pending, let's for now
just revert it to the default. We can always enhance it later if
requested.
2018-09-18 20:00:46 +02:00
Christian Brabandt a1c112cafd main: replace and virt replace mode should use same coloring
fixes #1794
2018-09-16 20:01:00 +02:00
Christian Brabandt bcd37fc115 mode: add support for virt replace mode
fixes #1792
2018-09-16 18:25:27 +02:00
Christian Brabandt aec0a1a15a languageclient: Check severity key before accessing it
closes #1793
2018-09-16 18:17:04 +02:00
Christian Brabandt da8035d8a8 Merge pull request #1789 from danielwe/master
Fix bug introduced in #1788: Don't use the read-only `count` as local variable
2018-09-10 09:52:34 +02:00
Christian Brabandt f5676d1fa1 Merge pull request #1788 from hallettj/extension/languageclient
Extension to report errors and warnings from LanguageClient plugin
2018-09-10 07:36:15 +02:00
Christian Brabandt d342c3cb1e Merge pull request #1785 from smancill/conditional-vimtex-loading
Load vimtex only when the extension is enabled
2018-09-07 08:01:33 +02:00
Christian Brabandt c7fb175d35 Add a specific color for commandline mode
closes #1768

Colors for the other themes need to be defined however
2018-07-26 10:22:40 +02:00
Christian Brabandt 59f3669a42 Merge pull request #1770 from shyun3/pullreq
Add vim-grepper extension
2018-07-24 19:16:22 +02:00
Christian Brabandt 964f53a418 Merge pull request #1767 from tpope/fugitive-real-path
Update to new Fugitive real path API
2018-07-23 08:11:18 +02:00
Christian Brabandt 4cc255a384 tests: Fix tabline tests 2018-07-13 22:35:05 +02:00
Christian Brabandt eac10a104f tests: add test for tabaline 2018-07-13 22:30:20 +02:00
Christian Brabandt 5aef1b90e5 tabline: Correctly trigger on BufDelete autocommand
fixes #399
2018-07-13 22:29:34 +02:00
Christian Brabandt 821372b9cf tabline: re-map tabline keys
fixes #1753
2018-07-13 21:33:03 +02:00
Christian Brabandt db45cdd994 Merge pull request #1759 from tpope/fugitive-path
Fixes for fugitiveline
2018-07-13 21:22:42 +02:00
Christian Brabandt b790fd2120 Merge pull request #1750 from Mangero/arduino-whitespace
Add Arduino to list of C-like languages
2018-06-18 08:39:53 +02:00
Christian Brabandt c3a814dbae Merge pull request #1749 from flemingfleming/autocmd-improvements
Autocmds: Move CursorMoved autocmd into the main augroup.
2018-06-18 08:39:17 +02:00
Christian Brabandt 45c9621157 Merge pull request #1744 from flemingfleming/fix-function-signatures
add "!" to function signatures
2018-06-13 20:06:17 +02:00
Christian Brabandt 4f95970228 branch: use :noa before calling async func
for some reasons, calling async functions might cause an error, if a
SourcePre command has been defined. So explicitly call the functions
using `:noa` modifier to prevent triggering the SourcePre autocommand.

fixes #1742
2018-06-11 14:45:29 +02:00
Christian Brabandt 7d871137be Correctly test for CompleteDone event 2018-06-09 10:50:25 +02:00
Christian Brabandt 6a05b92716 Merge pull request #1732 from shirohana/fix/integrate-with-ctrlspace
airline#extension#ctrlspace: Fix tabline didn't update when enable both buffers and tabs
2018-06-05 11:23:12 +02:00
Christian Brabandt 55716a1cc2 Remove wrong comment for TerminalOpen autocmd 2018-06-05 11:22:07 +02:00
Christian Brabandt add75907d5 Merge pull request #1738 from shirohana/fix/ctrlspace-tabline-switching
airline#extensions#ctrlspace: Fix tabline didn't update when switch to tab which focused on non-listed buffer
2018-06-04 22:56:22 +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 1bb1ce594a Formatter: Use pathshorten() instead of substitute()
The default formatter uses a hand-build regexp for shortening the path
in the tabline. However, since it uses the \w  regex atom, this won't
match e.g. cyrillic letters.

To fix this, use the builtin pathshorten() function which does handle
this case correctly. For a test, use e.g. 'D/Учёба/t.c'

closes #1737
2018-06-04 21:59:16 +02:00
Christian Brabandt 044a90ed55 use get(v:, 'lang', '') instead of v:lang
closes #1735
2018-06-04 21:45:46 +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 08570b6dcb doc: fix wrong double quote by single quote 2018-05-25 11:37:57 +02:00
Christian Brabandt 64e925d675 doc: document notexists symbol correctly
fixes #1729
2018-05-25 11:36:54 +02:00
Christian Brabandt 315cf0deec Merge pull request #1724 from lubomir/fix-doc
Fix documentation for syntastic format of warnings
2018-05-20 19:53:25 +02:00
Christian Brabandt 02ffdfe0e5 Merge pull request #1722 from dkav/patch-1
Update README.md
2018-05-13 18:33:34 +02:00
Christian Brabandt a7b84f5b67 doc: fix tag airline#ignore_bufadd_pat 2018-05-11 22:36:44 +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
Christian Brabandt c7e05efb76 Only consider regular files for the '[noperm]'
Recently, NERDTree added the &readonly setting to its buffer.
Unfortunately, this caused airline to render the '[noperm]' string in
it.

Fix this by only making the readonly check for buffers that actually
represent files (e.g. the buftype option is empty).
2018-05-11 09:53:55 +02:00
Christian Brabandt 5a065e8b82 Merge pull request #1717 from iroedius/disable-trailing-check
allow to also disable trailing whitespace check per filetype
2018-04-28 09:16:32 +02:00
Christian Brabandt 33310c5b24 whitespace: Allow to disable individual whitespace checks per filetype
closes #1716
2018-04-27 08:25:49 +02:00
Christian Brabandt 3ad4a18d85 xtabline doc: mention required tabline setting 2018-04-17 07:37:56 +02:00
Christian Brabandt a76f523be5 bufferline: always add a space for the very first item
closes #1631
2018-04-15 10:16:28 +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
Christian Brabandt 0df2c9b12e Merge pull request #1700 from mox-mox/master
Add extension for vim-localsearch
2018-04-09 13:27:44 +02:00
Christian Brabandt d66b507b02 Merge pull request #1683 from idbrii/add-custom-scm
Make branch detection customizable
2018-04-08 21:56:32 +02:00