Commit Graph

895 Commits

Author SHA1 Message Date
Christian Brabandt
8964603844 fix missing declaration 2016-10-14 11:14:33 +02:00
Bjorn Neergaard
06351e86df Add support for ALE, the Async Linting Engine
Ale is a plugin that lints text in the background, as you type!

It is new, but under [rapid development](https://github.com/w0rp/ale).
2016-10-14 10:36:21 +02:00
Bjorn Neergaard
45e5c907be Add support for flattened and NeoSolarized themes
These are forks/alternate versions of Solarized, without many of the
dynamic elements or the extensive terminal support.

[flattened](https://github.com/romainl/flattened) is a basic, totally
static version of Solarized with only ansi and GUI support.

[NeoSolarized](https://github.com/iCyMind/NeoSolarized) is a version
focusing on true/24-bit color support and NeoVim support, with limited
dynamic options.

[solarized8](https://github.com/lifepillar/vim-solarized8) is a version
focusing on vim/neovim true color support and limited dynamics. It is
already supported (`match()` matches it), but it is at least worth
noting.

Many users, including myself, use these themes over the original
Solarized for performance or technical reasons. Many users believe they
are incompatible with airline because automatic theming no longer
functions. While they can manually override the theme, most people seem
to miss this option in the documentation and give up.

It would be a nice quality of live improvement if airline detected these
themes and enabled its own Solarized theme automatically to match.
2016-10-14 10:36:21 +02:00
Christian Brabandt
4f8a16c31e fixup for async feature 2016-10-14 10:36:21 +02:00
Christian Brabandt
81ccd3bdf6 po-extension: Make asyncable 2016-10-14 10:36:21 +02:00
Christian Brabandt
c39e5f82cc check for existence of git/hg before calling them 2016-10-14 10:36:21 +02:00
Christian Brabandt
f706edee9f init async global variables 2016-10-14 10:36:21 +02:00
Christian Brabandt
57ca6c9e78 include workaround from c1704a2de0
add workaround from commit c1704a2de0 to prevent overwriting
v:shell_error
2016-10-14 10:36:21 +02:00
Christian Brabandt
ffa3d59af2 branch ext: use async functions for system() commands
Make use of vim 8 async functionality and use it to get the vcs status
for the branch extension.

Won't work with neovim.

fixes #1266
2016-10-14 10:36:21 +02:00
Benjamin Thomas
78439b2b35 Fix whitespace symbol empty string has extra space
This makes it so if the whitespace symbol (g:airline#extensions#whitespace#symbol) is an empty string, we don't end up wth two characters at the beginning of the message.
2016-10-02 01:22:50 -07:00
Christian Brabandt
f5359f9177 do not skip empty sections for the tabline
commit #3d667c32d3ac04 fixed a bug, that a section was not considered
empty for the statusline, also g:airline_skip_empty was set.

However unfortunately, this lead to a regression, makeing the tabline
ugly, because sections, that contained a single highlighting group would
be considered empty and would therefore be skipped. Since this is not
what is expected, make s:section_is_empty() return zero, when it notices
we are looking at a tabline.

fixes #1273
2016-09-27 21:44:00 +02:00
Saad Malik
3c33251ee7 Support for neomake
Added support for neomake plugin; similar to syntastic.
Shows warning and error counts in the airline statusbar.
2016-09-27 21:21:35 +02:00
Christian Brabandt
1c052e39b1 Merge pull request #1271 from chrisbra/highlighter_bug
Use the correct highlighting for the inactive window
2016-09-26 21:13:02 +02:00
Christian Brabandt
29c556dba4 use correct groupname for inactive windows
airline_c (which contains the filename) usually is used together with
the buffer number, so that several windows showing the a different
buffer do not share the same highlighting group.

This was fixed in 73aea86a, but unfortunately it was forgotten to not
only add this to the current group, but also modify the previous group
accordingly. This is what this patch does.

fixes #1268
2016-09-26 21:12:15 +02:00
Christian Brabandt
3d667c32d3 for empty sections, make test return true
fixes #1231
2016-09-24 22:06:41 +02:00
Christian Brabandt
513afd25bc Merge pull request #1263 from thawk/master
Set script encoding to avoid script parsing problem in non UTF-8 VIM
2016-09-24 21:55:50 +02:00
thawk
45d77ca909 Add 'scriptencoding utf-8' to all scripts 2016-09-24 08:16:30 +08:00
Christian Brabandt
c1704a2de0 Do not overwrite v:shell_overwrite after ShellCmdPost
Prevents resetting v:shell_error from the followin system() call in
get_git_untracked.

Fixes #1266
2016-09-23 16:11:53 +02:00
R.Chavignat
da457ae5ea Add support for b:airline_whitespace_checks variable and documentation 2016-09-22 14:27:07 +02:00
Christian Brabandt
65b9aa4856 Check for existence of key in context dict before using it
fixes #1251
2016-09-09 08:07:07 +02:00
Christian Brabandt
c058922358 do not use utf-8 chars, if encoding is different
fixes #1234 #1248
2016-09-08 21:33:39 +02:00
Christian Brabandt
afee79bbe0 Merge pull request #1250 from chrisbra/1233
Do not unconditionally modify airline_c_inactive
2016-09-08 21:30:20 +02:00
Simon Ratner
0b1df0c524 Add null accent, to allow accents to be removed 2016-09-08 21:24:04 +02:00
Christian Brabandt
73aea86a7a Do not unconditionally modify airline_c_inactive
consider a window with these splits:
,----
| file1
| ---
| file2
| ---
| file1
`----

If the top buffer is the active one and you start modifying this buffer,
this will also reset the highlighting for the inactive buffer2, since
the highlighting group 'airline_c_inactive' is used for both windows
(one having the unmodified buffer 'file2' and one having the modified
'file1').

This lead to the incorrect highlighting of the buffer name of file2.

Airline basically already created different airline_c<bufnr>_inactive
highlighting groups, but unfortunately did not use them.

Therefore, make the builder aware of this and always append the buffer
number to the group 'airline_c' if it is in an inactive window.

2) we need to make sure, the highlighting won't get overwritten, so
make the highlighter aware of this situation as well, by appending the
buffer number to the group name, if it creates the 'inactive' mode
groups and a buffer number has been given.

this fixes #1233
2016-09-08 18:46:11 +02:00
Christian Brabandt
c0cb03f48b don't add a second separator if not needed
Using let g:airline_section_y = airline#section#create_right(['ffenc','%{strftime("%H:%M")}'])
will result in an output string of `utf-8[unix] < < 00:00`

This happens, because the function util#prepend() will eventually add an
extra separator, if the width is zero. Therefore, when building the
string, remember, if the last section added an extra separator and only
add one, if there hasn't been added one before.

fixes #1220
2016-09-05 20:20:44 +02:00
Christian Brabandt
54e4772ef8 Merge pull request #1239 from chrisbra/1230
Do not cache gitgutter values
2016-09-05 19:32:24 +02:00
Ythildyr
afb75adc11 :AirlineRefresh not work correctly
If active buffer is modified, `:AirlineRefresh` apply `normal` highlight
instead of `normal_modified` highlight.

No particular config is requiered to reproduce this bug.

I see this bug with option `g:airline_skip_empty_sections` set.
Add any modification at the active buffer return to normal mode,
**do not save** and wait a few seconds, you can see highlight change to
normal but file is modified.

Without option `g:airline_skip_empty_sections`, add any modification at
the active buffer return to normal mode and type `:AirlineRefresh` you
can see change to bad highlight .
2016-08-28 14:41:45 +02:00
Christian Brabandt
43e3ef5428 Do not cache gitgutter values
fixes #1230
2016-08-24 21:22:28 +02:00
Bill Neubauer
460ed02864 Add Go to the list of C-like languages. 2016-07-26 10:06:40 +09:00
Julien Pivard
53dcd8a49c Hunks won't appear if g:airline_skip_empty_sections = 1 2016-07-24 21:15:10 +02:00
Christian Brabandt
657cf773ad Merge pull request #1206 from chrisbra/width
Cache hunk values, shorten for small windows
2016-07-24 10:08:40 +02:00
Christian Brabandt
797ad1ea79 Merge pull request #1207 from chrisbra/ctrlspace
Map keys in ctrlspace mode
2016-07-24 10:07:36 +02:00
Christian Brabandt
4d0c4f6b1e Merge pull request #1197 from chrisbra/eclim
Cache eclim errorlist
2016-07-04 20:29:08 +02:00
Christian Brabandt
fdd29caef4 shorten filetype for smaller screens 2016-07-03 21:32:33 +02:00
Christian Brabandt
a6c04644ef Map keys in ctrlspace mode
fixes #1181
2016-07-03 21:09:42 +02:00
Christian Brabandt
8fda614d0d Cache hunk values, shorten for small windows
Cache the hunk values. In case of short windows, shorten the hunk string
a little bit and make the branch extension take the hunk value into
account when deciding how much to shorten it.
2016-07-03 20:44:05 +02:00
Daniel Hahler
63dc4ba2a4 tabline: do not change the signature of get_buffer_name
Thanks to @wsdjeg about notifying me in
https://github.com/vim-airline/vim-airline/commit/e1f7bf#commitcomment-18104843.

Fixes: https://github.com/vim-airline/vim-airline/issues/1204.
2016-07-02 16:24:47 +02:00
Christian Brabandt
e1f7bffe71 Merge pull request #1189 from blueyed/tabline-only-handle-visible-buffer-names
Tabline performance: only pass in visible buffers to formatters
2016-07-02 10:57:50 +02:00
Christian Brabandt
c6f5d8b823 Merge pull request #1202 from chrisbra/resolve_symlink
Try to resolve symlinks for git
2016-07-02 10:55:49 +02:00
Christian Brabandt
e715bce77b Shorten section z in small windows 2016-07-02 10:20:19 +02:00
Christian Brabandt
409e8b0cbd refactor shortening code 2016-07-02 10:20:07 +02:00
Christian Brabandt
5b00d54cd6 If window is too small, shorten branch name 2016-07-02 10:19:43 +02:00
Christian Brabandt
fadd737a29 Merge pull request #1201 from chrisbra/ycm
call YCM function only if they are defined
2016-07-01 11:54:09 +02:00
Christian Brabandt
ece61f346e Try to resolve symlinks for git 2016-07-01 11:52:07 +02:00
Christian Brabandt
fbfea6daee Merge pull request #1200 from chrisbra/width
limit whitespace check output for smaller screens
2016-07-01 11:17:16 +02:00
Christian Brabandt
bc095bcde1 limit whitespace check output for smaller screens
Sometimes, if a buffer triggers many whitespace check warnings,
and the Vim window size is too small, other parts of the statusline
might become unreadable.

Therefore, if the window size is smaller than say 120 characters
and the whitespace warning > 9 chars, limit it to 10 characters
and inidicate, that there is more to come
2016-07-01 11:10:51 +02:00
Christian Brabandt
5c24c3c504 call YCM function only if they are defined
fixes #1187 by making sure, we only call functions, that actually exist.

Should make vim-airline work with lady loaded YCM, e.g. using vim-plug:

```viml
" Code to execute when the plugin is loaded on demand
Plug 'Valloric/YouCompleteMe', { 'for': 'cpp' }
autocmd! User YouCompleteMe if !has('vim_starting') | call youcompleteme#Enable() | endif
```
2016-06-24 11:49:53 +02:00
Christian Brabandt
72b316c871 Cache eclim errorlist
fixes #1193
2016-06-24 11:43:20 +02:00
Daniel Hahler
8d681c7119 Tabline performance: only pass in visible buffers to formatters
This only passes in the list of visible buffers on that tab, which
reduces the processing a lot if you have a lot of buffers opened.
2016-06-17 15:07:55 +02:00
Daniel Hahler
f51f73773d airline#highlighter#exec: do not build cmd always 2016-06-06 20:41:33 +02:00