Commit Graph

903 Commits

Author SHA1 Message Date
Christian Brabandt
0ea4daa103 Merge pull request #1297 from chrisbra/mq
Add mq status for hg repositories
2016-10-26 20:47:45 +02:00
Christian Brabandt
98fe4eabd4 Merge pull request #1299 from gregorias/fix_git_untracked
Display not exists symbol correctly in Git repos
2016-10-26 20:47:28 +02:00
Grzegorz Milka
2af2bdb424 Display not exists symbol correctly in Git repos
This commit fixes a bug, where untracked files in Git repos did not get the not
exists symbol displayed. The fix works by replacing the previous check for
whether currently edited file is a directory or not with a check based on
`findfile`. More detailed explanation follows.

VCS extension to vim-airline checks whether currently edited file is untracked.
The previous `s:get_git_untracked` implementation, which was used for the
aforementioned purpose for Git repos, was buggy, because it did not return the
untracked symbol in most situations, i.e. the edited file is untracked, but it
was treated as if it wasn't.
The root cause was the second clause in boolean expression checking the output
of `git status`:

    if output[0:1] is# '??' && output[3:-2] is? a:file

It was added to make sure we are not checking a directory, but at this point in
the program `a:file` is an absolute path, while output of `git status` is a
relative path from the root of git repo. So the `is?` expression failed in most
situations.
2016-10-25 19:26:44 +02:00
Christian Brabandt
5fe511c20b Merge pull request #1298 from chrisbra/shorten_mode
Shorten mode message for small windows
2016-10-25 08:01:07 +02:00
Christian Brabandt
6a155fabda guard against loading extensions twice
fixes #1300
2016-10-24 12:14:30 +02:00
Christian Brabandt
69020706b2 Shorten mode message for small windows 2016-10-20 22:57:26 +02:00
Christian Brabandt
14ab47cae6 Add mq status for hg repositories
Now that we have async feature for Vim 8, we can add the output of 'hg
qtop' back to the statusline if it is supported
2016-10-20 22:46:24 +02:00
Aditya
be6e3db68b
on_exit function fix if self.file is missing 2016-10-18 22:23:07 -04:00
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