Commit Graph

669 Commits

Author SHA1 Message Date
Christian Brabandt
195f2e1dae
keymap: fix missing keymap symbol, fix wrong condition 2017-08-27 21:29:40 +02:00
Christian Brabandt
3b225a1322
keymap: add some more missing parts, fix missing printf 2017-08-26 21:14:35 +02:00
Christian Brabandt
57cda93aad
keymap: fix the style 2017-08-26 18:14:08 +02:00
Doron Behar
89e484ac59
Add keymap extension which shows keymap setting. 2017-08-26 18:09:20 +02:00
kaidiren
2b45581f1c fix: refresh airline when airline_skip_empty_sections enabled in plugin ale 2017-08-26 19:00:40 +08:00
Christian Brabandt
42e5c82d64 Merge pull request #1535 from chrisbra/nvim_async
Improvement to async functionality
2017-08-25 14:37:47 +02:00
Christian Brabandt
5345c8fafa
denite: Check filetype in mode function
references #1540
2017-08-25 08:38:31 +02:00
Christian Brabandt
9bd2c40e7d
denite: remove FileType autocommand
closes #1540
2017-08-25 07:44:39 +02:00
icymind
b6a98bcd10 add option 'keymap_ignored_filetypes' for tabline extensions 2017-08-24 23:22:16 +08:00
Christian Brabandt
b77f326b33
async: rename variable
rename g:airline#init#async variable to g:airline#init#vim_async
because that is what it is for: showing whether vim supports async. Is
not set vor nvim, because nvim always supports jobs.
2017-08-23 18:38:19 +02:00
Christian Brabandt
06272275b5
fix po output not visible for nvim
Apparently, the output of msgfmt goes to stderr. So catch that one as
well.
2017-08-23 18:37:28 +02: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
a01d03a78a
branch: only do mq check once
but reset the check variable on Shell commands and when :AirlineRefresh
was called.

should make vim more performant

references #1536
2017-08-23 18:28:48 +02:00
Christian Brabandt
3ec22a524c
branch: comment why the argument is not used for update_hg_branch 2017-08-23 18:23:28 +02:00
Christian Brabandt
8cd7e35027
branch: correctly reset cache variables 2017-08-23 18:03:23 +02:00
Christian Brabandt
e553433430
branch: when mq is disabled, do not run hg qtop anymore 2017-08-23 18:01:41 +02:00
Christian Brabandt
5147d385a5
branch: cache filename path
fixes #1536
2017-08-23 17:56:57 +02:00
Christian Brabandt
232b6415d9
tagbar: do not error out, if autoloaded function does not exist
tagbar is not loaded if filetype plugin is off, so do not try to call a
non-existent function than.
2017-08-23 15:54:06 +02:00
Christian Brabandt
04bc544db2
po: rename variable correctly and add g: prefix 2017-08-21 21:29:16 +02:00
Christian Brabandt
5fc5a43802
init: rename variable 2017-08-21 21:26:35 +02:00
Christian Brabandt
c2b2351d99
async: Better check for nvim
closes neovim/neovim#7186
2017-08-21 21:23:34 +02:00
Christian Brabandt
d8eb12845f
hunks: do not cache for changes plugin 2017-08-14 08:13:19 +02:00
Christian Brabandt
2ec563bd57
syntastic: slightly tweak output format
also document how to use different syntastic statusline format

closes #1525
2017-08-08 14:57:04 +02:00
Christian Brabandt
83ceae726e
syntastic: display line number for errors/warnings
line number was omitted from 2e3055541e, so add it back
in parenthesis.

fixes #1525
2017-08-08 12:59:15 +02:00
tenfy
c0695feb13 Fixes #1515. The tabline will no update when use ctrlspace together.
Do not update tabline when the new buffer is no add to BufferList yes.
It will update by other event later.
2017-08-08 15:07:54 +08:00
Reuben D'Netto
e79188c3bd Neomake integration: if loclist is empty, fallback to quickfix 2017-07-21 18:30:34 +10:00
Christian Brabandt
61c624ef6c
unicode: Update Unicode extension
do not draw the complete statusline in a bright yellow. This might hurt
your eyes
2017-07-19 12:57:18 +02:00
Christian Brabandt
afcda0510e
Ale: Removing caching
fixes #1506
2017-07-06 12:14:49 +02:00
Christian Brabandt
4f43e5c93d Merge pull request #1503 from d10n/git-hunk-empty
Fix git hunk status disappearance on CursorHold
2017-07-01 21:44:30 +02:00
d10n
b6eaa60a88 Fix typo 2017-07-01 12:11:27 -04:00
d10n
39c61288e8 Fix git hunk status disappearance on CursorHold
When using vim-gitgutter and fugitive:

The hunks extension and the branch extension work as expected when the
file is first loaded; both parts are added to the statusline.

Once the cursor is moved and stopped for &updatetime ms:

1. The branch extension clears b:airline_head on CursorHold
2. Somehow (?) airline#statusline gets called on CursorHold
3. The hunks extension returns '' when b:airline_head is empty, causing
the hunks to be removed from the statusline.

It doesn't make sense to clear airline_head just because the cursor
moved, and the commit message adding the line doesn't say why:
13297cee03

Commit 174b7e1962 relies on airline_head
being set.

Debug detail:

Executing CursorHold Auto commands for "*"
autocommand unlet! b:airline_head
[...]
continuing in CursorHold Auto commands for "*"
calling function airline#statusline(1)
[...]
line 1:   return exists('*airline#extensions#branch#head') && empty(get(b:, 'airline_head', ''))
function airline#extensions#hunks#get_hunks[13]..<SNR>32_get_hunks[14]..<SNR>32_get_hunks_gitgutter[1]..<SNR>32_is_branch_empty returning #1
function airline#extensions#hunks#get_hunks[13]..<SNR>32_get_hunks[14]..<SNR>32_get_hunks_gitgutter returning ''
function airline#extensions#hunks#get_hunks[13]..<SNR>32_get_hunks returning ''
function airline#extensions#hunks#get_hunks returning ''

:au CursorHold
--- Auto-Commands ---
gitgutter  CursorHold
    *         call gitgutter#process_buffer(bufnr(''), 1)
CursorHold
    *         unlet! b:airline_head
airline_whitespace  CursorHold
    *         call <sid>ws_refresh()

------------------------

Sample vimrc:

set nocompatible

if empty(glob('~/.vim/autoload/plug.vim'))
  silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  autocmd VimEnter * PlugInstall --sync | q | doautocmd WinEnter
endif

autocmd VimEnter *
  \  if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
  \|   PlugInstall --sync | q
  \| endif

call plug#begin('~/.vim/bundle/')
Plug 'vim-airline/vim-airline'
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
call plug#end()
set laststatus=2
set updatetime=250
let g:airline_theme = 'dark'
2017-07-01 11:57:08 -04:00
David Antaramian
42522f994a Fixes typo introduced in a10d321
Commmit a10d321809 introduced a small typo
spelling a previously set variable `trailing_fmt` as `trailing_fm`. This
causes Vim to report `trailing_fm` as an undefined variable. In this
change, the variable is properly referenced as `trailing_fmt`.
2017-06-30 18:45:21 -04:00
Christian Brabandt
a10d321809
whitespace: move s:variables around
Will make sure, that even after setting the whitespace extension
variables, they are taken correctly into account.
2017-06-30 21:37:37 +02:00
Christian Brabandt
a914cfb754
backout b2f301f73c
Backout commit b2f301f73c

First of all, it caused flicker (which is caused by a Vim bug:
https://groups.google.com/d/msg/vim_dev/fdgPqmYZwOk/KJzR4l9wAwAJA)

and then the cache was not reset when editing a new file.

So let's just revert that commit, although it does affect performance.

fixes #1499
2017-06-28 21:10:57 +02:00
Christian Brabandt
313a6fcad2
tabline: prevent flicker on Windows
calling settabvar() while evaluating the 'tabline' setting apparently
causes flicker on Windows. Fall back to using `:let t:var` to store the
content in the current tabpage.

This is not as good as using `settabvar()` since we cannot store the
title for other tabs, but at least it should prevent the flicker and at
the same time at least cache the title for the current tabpage.
2017-06-27 18:28:28 +02:00
Christian Brabandt
825aec9e4d
Revert "highlight: skip processing the same hi group twice"
This reverts commit feee9bcf3c.

It brakes CI and shouldn't be needed
2017-06-27 14:44:49 +02:00
Christian Brabandt
62952b3887
tabline: only map keys if not done yet
Should improve performance by not steadily remapping keys
2017-06-27 14:44:03 +02:00
Christian Brabandt
b2f301f73c
tabline: Cache title as tablocal variable 2017-06-27 14:40:31 +02:00
Christian Brabandt
174b7e1962
hunks: Make hunk extension slightly faster
do not call airline#extensions#branch#head() but instead use the cached
variable b:airline_head.

Note: it looks like GitGutterGetHunkSummary() could need some cacheing
2017-06-27 14:16:28 +02:00
Christian Brabandt
6ab0098ced
Ale: Cache Warning and Errors
should provide some better performance
2017-06-27 13:52:48 +02:00
Christian Brabandt
feee9bcf3c
highlight: skip processing the same hi group twice
Shouldn't happen, but just in case skip creating highlighting group,
if the same group with the same attributes has already been defined.
2017-06-26 23:17:43 +02:00
Christian Brabandt
f86f1e8103
whitespace: Only refresh on changes to buffer
Should prevent too many redraws of Vim
2017-06-26 10:04:43 +02:00
w0rp
c8a5efc11e Update the ALE extension so it loads better and uses the new count format 2017-06-25 19:49:18 +01:00
Christian Brabandt
0a352c9f5b
branch: don't check untracked status for files in vcs dir
Currently, vim-airline will check untracked status for files e.g. living
in .git. So when editing .git/config it will show as being untracked.

While technically, this is correct I prefer not to see this for those
files. So skip the check for those files.
2017-06-24 14:03:40 +02:00
Christian Brabandt
fde2511201
Syntastic: remove unused variable 2017-06-22 09:47:01 +02:00
Christian Brabandt
52c0afadb9 Merge pull request #1413 from chrisbra/wordformat
Improvements to wordcount formatting
2017-06-20 23:31:15 +02:00
Christian Brabandt
2e3055541e
syntastic: distinguis errors and warnings
Currently the syntastic results are simply dumped into the error
section, however syntastic does internally distinguish between error and
warning sections.

Therefore change the syntastic extension to dump errors into the error
section and warnings into the warning section.

closes #1480
2017-06-20 22:26:22 +02:00
Christian Brabandt
d2b697d27b
ale ext: fix syntax error 2017-06-20 22:23:46 +02:00
Christian Brabandt
7f3d6287b5
ale ext: simplify logic 2017-06-20 21:20:24 +02:00
Christian Brabandt
1891933e59
branch: better display of branch for both hg and git
If a file is edited inside a git repository, which lies within a git
repository, the branch extensions shows 'gitmaster | hgdefault'

To make it more obvious, that we are looking into both repositories
here, use 'git:master | hg:default'

closes #1482
2017-06-20 17:47:07 +02:00
Christian Brabandt
c436592559
bufferline: take 'acd' into account
vim-airline does use a different section (path/file) depending on
whether 'acd' is set. Later in the bufferline extesion however, it
unconditionally overwrites the 'file' section, regardless of whether
this section is actually used.

Therefore the bufferline section needs to check this option as well.

fixes #1487
2017-06-20 13:58:39 +02:00
Christian Brabandt
e16ff7cc88
Do not error out, if a netrw variable is not defined
This should not happen, however being a bit more error tolerant
shouldn't hurt, so let's just fall back to 'normal' for the
g:netrw_sort_direction in case it is not defined (which should be the
default anyhow).

fixes #1492
2017-06-19 15:56:17 +02:00
Oz Elentok
7865dc8149 Improve denite extension performance 2017-06-12 22:00:25 +03:00
Maxim Gonchar
8e64138ef4 Add vimtex support
Indicates:
- whether the file is considered to be main or local
- whether the viewer is opened
- whether the compilation is running
- whether the compilation is continuous

Added:

* `vimtex` existence check
* variables documentation

TODO: readme and a screenshot

Update readme.md

Update doc

Update screenshot url
2017-05-08 13:07:13 +03:00
Christian Brabandt
f76ede3b28
Make skip_empty variable overridable per window
The denite extension functions return the content of some buffer-local
variables. Those variables are not defined, the first time the they are
accessed and therefore, the statusline is not updated later when
g:airline_skip_empty_sections is set.

So disable this variable in this window, by setting the
w:airline_skip_empty_section=0 variable in the denite window.

closes #1454
2017-04-10 09:29:27 +02:00
Christian Brabandt
46b0b6bf5a Merge pull request #1427 from thatsmydoing/denite
Add support for denite
2017-03-15 10:06:19 +01:00
Thomas Dy
c9a0c62b1b Add support for denite 2017-03-15 16:41:50 +08:00
Christian Brabandt
ba7d8c59f7
Call hg qtop with locale set to C
closes #1438
2017-03-13 09:49:02 +01:00
Lingnan Dai
7f19896dc6 Fix problems with AirlineSelect{Prev,Next}Tab
Use the entire list of buffers instead of the currently visible ones
2017-02-28 15:56:37 +00:00
Alexey Zhikhartsev
3c6135d75f
Add a function to disable whitespace-detection
Useful to call for particular file types (e.g., .tex files):
ftplugin/tex.vim:
    call airline#extensions#whitespace#disable()
2017-02-26 10:35:17 +01:00
Christian Brabandt
9d89375b8f
Do not update wordcount on unknown buffers 2017-02-26 10:25:21 +01:00
Christian Brabandt
727a2b48d9
Rename wordcount update function 2017-02-26 10:24:08 +01:00
Christian Brabandt
db01efd508
Better reformat wordcount format in with separator 2017-02-24 18:28:48 +01:00
Christian Brabandt
b2bbe7dbc2
Small wordcount format output on windows < 80 2017-02-24 18:25:29 +01:00
Christian Brabandt
562d060b08
Reset wordcount cache on window size
so the format can make a better guess what to display on different
window sizes.
2017-02-24 18:24:30 +01:00
Christian Brabandt
d8b62aa426
Remove unused variable 2017-02-24 18:22:25 +01:00
Jorrit Visser
8776a3e058 Truncation fix
Line numbers are now displayed before the error, instead of after, preventing truncation (and thus making the whitespace/indent section essentially useless in smaller terminals)
2017-02-07 14:20:56 +01:00
Christian Brabandt
b56a064377 Use get() to access members of getwininfo() function
And add default value, in case the 'loclist' and 'quickfix' entry is not
available (can happen on versions without +quickfix feature).

Fixes #1379
2017-01-21 22:02:40 +01:00
Jerome Reybert
a1db013d3f Add vimagit extension 2017-01-19 14:02:53 +01:00
Christian Brabandt
9b1770f246 hg extension did not work on Windows
remove extra file argument

closes #1367
2016-12-31 23:50:39 +01:00
YoungHoon Rhiu
d60323d623 Add vim-xkblayout extension to display keyboard layout 2017-01-18 12:34:14 +09:00
Christian Brabandt
a2431f2adb Check s:jobs dictionary before trying to remove jobid
fixes #1363
2016-12-29 11:22:55 +01:00
Christian Brabandt
706cee277a Add tab indicator for tabline when buffers are shown
closes #1329
2016-12-16 23:42:58 +01:00
Christian Brabandt
73a1238205 wrong quoting of condition 2016-12-14 16:10:33 +01:00
Christian Brabandt
a0ea8db1fc Make the wordcount ext more flexible for the def. filetypes
This allows the user to further adjust the
g:airline#extensions#wordcount#filetypes configuration variable even
after Vim has started up.
2016-12-13 21:27:53 +01:00
Christian Brabandt
c375d050a8 Do not add extra %( %) in the statusline
This was used as a workaround to fix a highlighting bug, which was fixed
in Vim 7.4.1511 and therefore, we need to correctly detect that the
patch was applied and in that case skip adding those extra groups.

As a bonus, when not using those empty %( %) groups, the
skip_empty_section test will correctly handle this and therefore this
closes #1351
2016-12-13 21:14:51 +01:00
Sam Fuller
7cb5c24151 prevent windows from closing on middle_click
Adding an option to prevent windows from being closed when a buffer in
the tabline is middle clicked and the clicked buffer is currently open
in a window.

When this option is enabled, instead of closing the window a new buffer
will be opened in all of the windows editing the clicked buffer instead.

This is my first pull request AND my first experience with vimscript, so
my apologies if this is a bit sloppy 😄
2016-12-09 13:20:48 +01:00
Christian Brabandt
781b4ea6a2 Merge pull request #1321 from chrisbra/getwininfo
Use getwininfo() for checking quickfix window
2016-12-09 12:59:46 +01:00
Christian Brabandt
0357b4fcbe Merge pull request #1348 from shaunbrady/exclude_at_runtime
Make ...#excludes|exclude_preview runtime configurable
2016-12-06 21:18:38 +01:00
Christian Brabandt
4c39344cc1 Merge pull request #1334 from chrisbra/worktrees
Add Worktrees support
2016-12-06 21:17:51 +01:00
Shaun Brady
718107c107 Make ...#excludes|exclude_preview runtime configurable
airline#extensions#tabline#excludes and
airline#extensions#tabline#exclude_preview previously had no impact if
changed after vim load.  This fixes that.
2016-12-03 23:40:15 -05:00
Christian Brabandt
04be981de9 make ...#fnamemod configurable during runtime
airline#extensions#tabline#fnamemod would be initialized and could not
be changed during runtime, so fix that.

closes #1347
2016-12-02 13:40:34 +01:00
Christian Brabandt
ccdc3d6c60 Merge pull request #1337 from mhartington/master
feat(): allow for buffer index formatting
2016-11-26 14:26:47 +01:00
mhartington
ee8173e41d
feat(): allow for buffer index formatting 2016-11-25 12:36:55 -05:00
Christian Brabandt
53c8aa4fd6 enable wordcount for mail and tex filetypes 2016-11-24 15:20:38 +01:00
Christian Brabandt
b67509189b check for correct variable 2016-11-23 16:35:01 +01:00
Christian Brabandt
d4a239f14a Make airline aware of git worktrees
Currently vim-airline assumes, that the git_dir is part of the path for
the file being edited. This has changed, since git supports worktrees.

So take care of b:git_dir (which is set by fugitive) being a path
differently from the absolute path of the file being edited (however, it
should include the substring worktree in that case).
2016-11-23 16:33:12 +01:00
Richard Russon
4e93a90441 Abbreviate the text for 'po' translation files.
A typical status line for a 'po' (Portable Object) translation file is:

  1152 translated messages, 91 fuzzy translations, 42 untranslated messages.

Adding a substitute(), tidies this to:

  1152 translated, 91 fuzzy, 42 untranslated

which is still informative, but less verbose.
2016-11-22 11:24:10 +00:00
Christian Brabandt
cebfc9a64b Use getwininfo() for checking quickfix window
Since Vim8 we have win_getid() and getwininfo() functions to get
information about the current window. So we can use those functions to
find out, whether the current window is a quickfix or location list
window.

This avoids using a redir() over the :ls command and trying to
manually match the string quickfix and should be faster and also be more
robust, as the redir may fail if done recursively.

fixes #1319
2016-11-16 20:14:27 +01:00
Grzegorz Milka
433d5d8f97 Use neovim's async job's instead of system
This commit makes branch.vim use neovim's async jobs instead of a system()
function. This way we avoid the v:shell_error overwrite bug and allow live
updates of the untracked status.
2016-11-04 19:09:05 +01:00
WADA Takashi
e7056db27a Fix when using vim-lawrencium 2016-11-04 10:54:39 +09:00
Grzegorz Milka
3899f848a7 Adapt data structures of branch.vim to async
* The head string is now calculated iff it has changed.
* The not exists symbol for current file appears as soon as its status is known.
* Fixes various problems with asynchronous status checking, such as:
  * The not exists symbol keeps appearing and disapearing. This happened when
    file was marked as not existing, the untracked cache was invalidated, and
    the cache update is started, but in the meantime, the head string
    calculation used the current (empty) value of the cache.
  * The not exists symbol never appears, because cache keeps getting invalidated
    before b:airline_head is emptied and updated.

closes #1306
2016-11-03 21:03:13 +01:00
Christian Brabandt
02ecb8631d fix missing part of commit 3bd6cb5ee4
There was a part missing of #3bd6cb5ee4981227
add it back
2016-11-03 17:54:50 +01:00
Christian Brabandt
6dae3452db Fix order of statements
Commit #3bd6cb5ee498 causes an error, because a variable was used
before it was declared. Fix this.
2016-11-03 17:26:32 +01:00
Grzegorz Milka
3bd6cb5ee4 Refactor branch.vim to avoid code duplication
* Introduce a config variable that holds the vcs-dependent parts of code.
* Removes `get_*_untracked` duplication by merging their logic together.
* Removes custom checks for 'git' or 'hg'. Functions now rely on provided config
  argument.
* Use loops instead of manually specifying each handled VCS.

closes #1303
2016-11-03 17:19:17 +01:00
Christian Brabandt
516870bf9f Check for correct async condition
fixes #1308
2016-11-02 16:43:47 +01:00
Christian Brabandt
0ea4daa103 Merge pull request #1297 from chrisbra/mq
Add mq status for hg repositories
2016-10-26 20:47:45 +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
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
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
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
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
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
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
Harm te Hennepe
74aacca55d update ctrlspace bufferline to use clickbuf() 2016-06-02 16:00:00 +02:00
ivan tkachenko
5a170c5ef0 add obsession extension 2016-05-30 03:44:39 +08:00
Christian Brabandt
4d39cb6f20 Merge pull request #1175 from chrisbra/1174
vim 7.3 does not allow getwinvar with 3 args
2016-05-22 21:37:10 +02:00
Christian Brabandt
985f3d3eca b:airline_head sometimes undefined
Make sure, b:airline_head variable is set, also it is initially set in
this function earlier. But see #1171 for an error.

Therefore, before checking if the variable is empty, make sure it
exists.

fixes #1171
2016-05-22 21:29:00 +02:00
Christian Brabandt
83b6dd11a8 vim 7.3 does not allow getwinvar with 3 args
use airline#util#getwinvar instead, fixes #1174
2016-05-22 21:26:34 +02:00
Michael Henry
e67b2847ea Add the b:airline_whitespace_disabled feature.
If the per-buffer variable b:airline_whitespace_disabled is defined
and non-zero, whitespace checking will be disabled for that buffer.
2016-05-14 15:56:48 -04:00
Christian Brabandt
bd4cb97e85 Add quickfix title to inactive statusline
fixes #1162
2016-05-13 10:08:54 +02:00
Christian Brabandt
727208d766 Do not draw separators for empty sections
This is a little bit a hack, because by the time the separators are
added, it is not clear, if the following section is empty, therefore
we need to parse the content of the following section and eval the
expressions to find out, if this is empty

Remarks:
- catch all exceptions when eval'ing statusline

- make sure, that the seperators are highlighted
  even when skipping empty regions (highlight group
  names need to be adjusted)

- if a section is defined as empty, it will be removed completly from
  the statusline. This means, it won't be called on the next update
  and may not refresh properly (e.g. when the whitespace check
  triggers, therefore, the whitesapce extension has to call an
  explicit redraw whenever it is supposed to be refreshed)
2016-05-12 21:40:56 +02:00
Christian Brabandt
cf5632bb94 Merge pull request #1152 from chrisbra/1146
Check that default value exists, before accessing it
2016-04-29 09:17:35 +02:00
hanhuanle
a8dfdd40b7 shellescape file path when call "system()"
"system()" called by "get_git_untracked" and "get_hg_untracked" fails
sometimes. It reports error "Can't open file /tmp/***".
The root cause is that the file path for system() contains some unordinary
character and lacks quotes.
2016-04-28 23:14:32 +08:00
Christian Brabandt
057b429b02 Check that default value exists, before accessing it
closes #1146
2016-04-27 20:11:40 +02:00
Daniel Hahler
5652b576b0 Add bang to function definitions
This makes it easier to reload the files, e.g. via vim-scriptease's
`:Runtime`.
2016-04-20 21:10:28 +02:00
John Byrne
a5fab144aa Made c_like_langs customisable via g:airline#extenstions#c_like_langs 2016-04-20 20:44:50 +02:00
Christian Brabandt
3f2247593a Merge pull request #1117 from 987poiuytrewq/middle_click_buffers
Make middle clickable buffers (only Neovim)
2016-04-19 23:33:11 +02:00