Commit Graph

115 Commits

Author SHA1 Message Date
Christian Brabandt a0298263b7
autocomd: do not re-evaluate modelines
fixes #1804
2018-09-25 16:03:30 +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 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
mrmr1993 5907d3909e Add dedicated tabline builder 2018-03-15 16:38:36 +00:00
srini-x 7f1cfb0c3f removing the hard-coded '[' and ']' around the tabline labels. 2018-02-13 17:48:21 -08:00
Christian Brabandt 5db4c408bd
Update copyright notifications 2018-01-05 10:37:59 +01:00
Christian Brabandt 90cf752c90
tabline: add separate highlight group for labels 2018-01-04 18:57:28 +01:00
Christian Brabandt 3b631ef0c4
tabline: refactor label function 2018-01-04 18:43:03 +01:00
Christian Brabandt 45878a7947
tabline: remove l: prefix of function variables 2018-01-04 18:29:51 +01:00
Christian Brabandt 72e457d8c2
tabline: remove static caching of s:vars
rather let them be defined whenever they are needed. They were only used
inside a single function anyhow, so it does not make sense to cache
them. In addition, having the user later change the variable won't work
as expected.
2018-01-04 14:11:13 +01:00
Christian Brabandt 6e2a9e38cd
tabline: force redraw on BufAdd autocommands
closes #1580
2017-10-19 11:37:24 +02:00
Shohei Fujii 7bf1d9b1fb skip toggling ctrlspace tabline plugin 2017-10-16 17:33:40 +09: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 b2f301f73c
tabline: Cache title as tablocal variable 2017-06-27 14:40:31 +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 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
thawk 45d77ca909 Add 'scriptencoding utf-8' to all scripts 2016-09-24 08:16:30 +08: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
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
Joshua Rubin 73146e3e73 Add support for getting tab title from t:title
Uses `gettabvar` to get tab name.
2016-03-22 12:14:47 -06:00
Christian Brabandt f60a8cc7a3 another approach for updating the bufferline on BufAdd 2016-03-01 22:07:52 +01:00
Christian Brabandt 0e70dac030 Disable tabline refresh per configuration
fixes #1049 and should prevent that users see AirlineTabRefresh printed
on their screen.
2016-02-23 20:23:29 +01:00
rosston 63f9abd3f2 Fix highlighting of current/modified buffer.
Fixes broken variable reference caused by e4ef624 (#952).
2016-02-22 23:07:27 -05:00
Christian Brabandt 2c5aa75d5f update according to PR comments 2016-02-11 21:31:42 +01:00
Bailey Ling e4ef624ea8 tabline for combined buffers/tabs
This is a new tabline extension, that displays both the buffers open and
the available tabs. This has been requested by #639 and fixes #639.

This is based on blings work on branch spike.

This uses the new highlight groups tab*_right, so that the separators
have the correct color. Also this makes some configuration variable
obsolete and therefore, they have been removed.

remove unused combined config variable, remove space after tab
2016-02-10 20:22:35 +01:00
Christian Brabandt 08a8779268 do not echo feedkeys() arguments
Try a different approach, that does not echo
the commandline. For that, create a <silent> mapping,
that is called via feedkeys() and as such should update the tabline.

fixes #1011
2016-02-08 21:16:38 +01:00
Christian Brabandt b48b166a22 Merge pull request #911 from sappo/master
Problem: CtrlSpace 5.0 integration (statusline + tabline)
2016-02-08 10:44:01 +01:00
Kevin Sapper a65000211f Problem: Load check variables has changed
Solution: Use the current one from ctrlspace 5.0 + minor style fixes

Problem: CtrlSpace 5.0 does no longer work with airline
Solution: Modify the ctrlspace extension to call the new APIs

The statusline work fine but the custom ctrlspace function
somehow/somewhere gets overridden and I could not figure out where.
Therefore the user must add

let g:CtrlSpaceStatuslineFunction = "airline#extensions#ctrlspace#statusline()"

to its .vimrc.

Problem: Ctrlspace 5.0 does not integrate well into tabline
Solution: Write a tabline extensions for ctrlspace 5.0.

The extensions is capable of showing both tabs and buffers, but only the
buffers of a current tab are shown.
2016-02-08 08:36:25 +01:00
Christian Brabandt af3f209d7a Try to avoid excessive redraws.
Most of them seem to be caused by using :hi statements, although the
highlighting group to be created is exactly the same. Therefore, get the
info from actual definition and only execute :hi when the new group is
actually different.

Also try to avoid to generate :hi statements when the popupmen is
visible. This causes flickers.
2016-02-06 13:55:28 +01:00
Christian Brabandt 73f365cfb9 use feedkeys() with "n" flag 2016-02-06 08:49:50 +01:00
Christian Brabandt 050945f087 update_tabline() may cause E315
This is probably a bug in Vim because redrawing might cause
Vim to actually try to access a line of the buffer, that hasn't
been loaded yet.

Therefore try to update the tabline, by performing a two :set mod!
calls.
2016-02-06 00:03:27 +01:00
Christian Brabandt 87d60febaf fix neovim color mode 2016-02-05 22:47:57 +01:00
Andrea Schiavini ef3746d022 Neovim support 2016-02-05 09:19:31 +01:00
Christian Brabandt 889492e01c fix issue #939 2016-01-26 07:52:42 +01:00
Christian Brabandt 8ae46e989d update tabline on bufadd events 2016-01-21 21:10:25 +01:00
Bailey Ling 048b24a916 happy 2016! 2016-01-14 21:38:38 -05:00
Bailey Ling 8aad42644c integration with taboo.vim; resolves #476 and #575. 2015-02-27 21:12:45 -05:00
Bailey Ling 7394642293 extract buffers view mode into its own file 2015-02-18 21:56:16 -05:00
Bailey Ling 987306dcaf extract tabs view mode to its own file 2015-02-18 21:56:15 -05:00
Bailey Ling 6f9d92df7c extract autoshow logic to its own file 2015-02-18 21:56:15 -05:00
Bailey Ling 8693a525b9 extract buffer listing to its own file 2015-02-18 21:56:15 -05:00
Bailey Ling ca925efdbf move formatters into their own namespace 2015-02-13 21:50:18 -05:00
Bailey Ling 1ca6ffb6d0 happy 2015
resolves #692.
2015-02-13 21:47:43 -05:00
Daniel Hahler 98c2dbd04e tabline: fix cache invalidation for show_buffers=1 with `:bd`
Ref: https://github.com/bling/vim-airline/pull/700#issuecomment-73798679
2015-02-11 02:48:25 +01:00
Daniel Hahler 3c1295bb71 tabline: fix s:current_buffer_list invalidation
Use `s:current_buffer_list` always in `s:get_buffer_list()`, and
invalidate it via BufAdd and BufUnload.

Fixes regression from ce58af7191 (commitcomment-9647487).
2015-02-09 17:44:13 +01:00
Daniel Hahler ce58af7191 Fix get_buffer_list being called always via get()
Vim's `get()` calls the expression for `{default}` always, not only if
the default is going to be used!

This caused `airline#extensions#tabline#get_buffer_name` to not use the
cached value.

Fixes https://github.com/bling/vim-airline/issues/697.
2015-02-07 15:38:02 +01:00
Bailey Ling 13ee9f456a address syntax errors
resolves #683
2015-01-03 19:38:17 -05:00
PsychoMario 527e6661e6 added tabline#show_tabs to disable tab bar 2014-12-26 21:48:06 +00:00