Commit Graph

1838 Commits

Author SHA1 Message Date
Christian Brabandt
a96681d459
highlighter: Cache syntax highlighting attributes
Should in theory improve performance by quiet a lot.
2017-08-11 11:26:35 +02:00
Christian Brabandt
e9a7a12d9e
highlighter: improve performance of get_array() function 2017-08-11 11:05:56 +02:00
Christian Brabandt
c65d7fe36b
highlighter: slight performance increase
do not access get() function twice. We can assign the result to a
variable and use it a second time. Should speed up the highligther part
of the code by a bit.

Since I was already touching s:Get(), also get rid of the default
parameter, as it always has been the empty string.
2017-08-11 10:46:03 +02:00
Christian Brabandt
96352f9b53
doc: fix typo 2017-08-08 16:03:11 +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
Christian Brabandt
711f50a567 Merge pull request #1524 from tenfyzhong/master
Fixes #1515. The tabline will no update when use ctrlspace together.
2017-08-08 09:34:11 +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
Christian Brabandt
4e24036782 Merge pull request #1523 from rlue/hotfix
Hotfix: Autoswitch theme for colorschemes with funny casing (like PaperColor)
2017-08-07 07:46:19 +02:00
Ryan Lue
039fd6b50f Fix airline#switch_matching_theme() to accommodate camelcased colorscheme names 2017-08-07 12:42:22 +08:00
Christian Brabandt
a2e20bc3ca
spell: Display spelling language
fixes: #1521
2017-08-01 19:25:20 +02:00
Christian Brabandt
0c307d5f73
Better way to check for terminal buffer 2017-07-30 18:57:05 +02:00
Christian Brabandt
d54613d2dd
Check for existence of term_list()
fixes #1518
2017-07-30 18:55:52 +02:00
Christian Brabandt
846d85aaa1
main: support for Vims terminal mode
Currently this is a hack, to get terminal mode from Vim.

However there is no better solution yet, since the API is not stable
here. Until then, just use the hack with
index(term_list(), bufnr('')) > -1
2017-07-30 09:51:23 +02:00
Christian Brabandt
72e5f04f7c Merge pull request #1513 from rdnetto/master
Neomake integration: if loclist is empty, fallback to quickfix
2017-07-21 12:28:55 +02: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
e03afa1733
doc: linenr and maxlinenr are swapped in documentation
fixes #1507
2017-07-07 22:33:47 +02:00
Christian Brabandt
afcda0510e
Ale: Removing caching
fixes #1506
2017-07-06 12:14:49 +02:00
Christian Brabandt
b78c2ec475
Always enable airline by setting laststatus=2
Previously the user was expected to set 'laststatus' himself to 2 if he
wanted to have airline be shown by default.

However it doesn't make much sense to have airline installed but not
display the statusline. Therefore, set the 'laststatus' to 2, if it
isn't set to it already.
2017-07-02 20:42:32 +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
Christian Brabandt
0205baa963 Merge pull request #1504 from d10n/fix-typo
Fix typo
2017-07-01 21:43:03 +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
Christian Brabandt
72ca1c344f Merge pull request #1502 from DavidAntaramian/master
Fix misspelling of trailing_fmt
2017-07-01 07:18:02 +02: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
583ae3d5f9
highlighter: skip create hi groups for inactive mode if not needed
This will skip creation of highlighting groups, if there are no inactive
windows.
2017-06-26 22:30:48 +02:00
Christian Brabandt
560092a9ec
highligher: fix the comparison before redefining hi group
The comparison in airline#highlighter#exec() was there to prevent to
call out to too many :hi calls by making sure that the newly to be
defined highlighting group will be actually different from the current
existing one.

However, that did not work, as the returned old highlight
group did never match the newly to be created one, since it
intentionally left the cterm attributes out for the gui and the gui
attributes for the terminal.

Therefore, fix the comparasion and make it compare the actual values
that we have.

This should make vim-airline a bit faster (hopefully!)
2017-06-26 22:27:01 +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
Christian Brabandt
811360a095 Merge pull request #1497 from w0rp/update-ale-extension
Update the ALE extension
2017-06-26 09:56:32 +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
e7d18fe427
Updated README.md mention correct Vundle repo 2017-06-24 17:05:24 +02: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
ac032b752a Fix missing backquote 2017-06-24 13:43:46 +02:00
Christian Brabandt
b101175683 Mention minpac installation 2017-06-24 13:42:13 +02:00
Christian Brabandt
fde2511201
Syntastic: remove unused variable 2017-06-22 09:47:01 +02:00
Christian Brabandt
57e564b227
Add termguicolor check for is_win32term
closes #1259
2017-06-21 15:44:58 +02:00
Christian Brabandt
7d082c03b2
Do not clear intro screen
if airline is initialized too early and some :hi commands are run,
this will force a redraw in Vim which will result in the intro screen
being cleared.

Currently, this does not work for gvim, not sure why.

closes #1476 (well only partly, until i have discovered, why for gvim it
doesn't work).
2017-06-21 13:21:13 +02:00
Christian Brabandt
87cdf8f6c4
highlighter: Make sure hi group exists and is valid
previously we only checked, that the group exists, however
if loading a new color scheme, this might lead to the group becoming
cleared. That means it still exists, but the highlighting group would
not show anything. Therefore, also check that the group is not cleared.

closes #1483
2017-06-21 09:19:51 +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
258f3e5630
fix failing test by defining all default sections
previous commit 2e3055541e broke the unit tests, since it renamed
the syntastic section. Fix that and also test correctly the other
sections, that have been added (and which have not been tested until
now).
2017-06-20 22:38:56 +02:00