19 Commits

Author SHA1 Message Date
Christian Brabandt
499ae85357 fern: only change directory if we are in a fern window
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-12-02 14:56:51 +01:00
Christian Brabandt
e06b45a870 fern: handle cases when scheme is not fern of filetype is fern-
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
closes: #2735

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-11-28 12:16:22 +01:00
Will Wills
6b51799f26 fix(tabline): ensure tab_nr updates in buffers.vim (#2734)
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
Previously, when using the rendering in buffers.vim, the tabline only
considered the current buffer and column width when checking for
updates, despite optionally using the tab number in rendering. This
would cause incorrect tabline rendering when switching between tab pages
if the buffer and column width didn't change. This change mimics the
already existent behavior in `tabline/tabs.vim` which caches the current
tab number for comparison when updating. Some other formatting is
changed to align `buffers.vim` to `tabs.vim`.

Fixes: vim-airline/vim-airline#2733
2025-11-04 18:47:56 +01:00
Christian Brabandt
159573187e doc: use tabs as separator between tag and description
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
2025-09-22 19:24:02 +00:00
Stefan Morgenthaler
e40a696db0 feat: allow setting vim-obsession paused indicator (#2730)
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
2025-08-20 22:35:09 +02:00
Christian Brabandt
5ca7f0b7fe whitepace: add whitespace to conflict detection marker
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
closes: #2727

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-14 20:56:14 +02:00
Christian Brabandt
41c5f54507 Add executable status (#2723)
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
closes: #2722
2025-05-11 13:08:53 +02:00
Christian Brabandt
7fc376a4d5 CI: update Github runners to Ubuntu 22.04
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-01 16:48:35 +02:00
Finite State Machine
2e2afc1056 Update airline.txt to correct a typo (#2721)
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
2025-04-30 22:13:22 +02:00
Christian Brabandt
45003f9451 fern: use correct API to parse the fern protocol
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
related: #2717

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-14 07:50:28 +02:00
Christian Brabandt
0694335daa fern: failure when opening a path with spaces
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
Fix this by:
- decode the path using fern#fri#decode()
- use fnameescape() for the 'lcd' command
- add try catch around the 'lcd' command

closes: #2717

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-13 17:03:11 +02:00
Christian Brabandt
7ad8c717c6 tests: fix failing test
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
after c7704c6bc7 the tests fail, because the tests expect '%l'
in the output of `g:airline_section_z`, but it is now actually '%2l'.

So let's change the expected output for the test.

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-13 09:46:50 +02:00
Christian Brabandt
c7704c6bc7 init: use a minimum of 2 columns for the current line number
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
fixes: #2699

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-08 13:27:11 +02:00
ark231
7c7391a1fc fix line number of nvimlsp being off by one (#2713)
The line number vim.diagnostic.get() returns is 0-indexed,
but displayed line numbers are 1-indexed
2025-04-08 13:17:57 +02:00
Christian Brabandt
9884c07966 whitespace: U+2632 changed width to double-width
Whitespace Character U+2632 changed to double-width with Unicode release
16 (Vim patch v9.1.736). This causes issues with the statusline like
adding wrapping.
So let's mark that character back as single width, since that is what
most underlying libraries seem to expect.

closes: #2715
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-08 10:20:16 +02:00
Christian Brabandt
7a552f415c highlighter: remove stale separator entries on buffer unload
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
fixes: #2701

Co-authored-by: Mina Nagy Zaki <mnzaki@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-12-05 06:49:09 +01:00
laburnumT
25635ab504 symbols: Update symbol used for maxlinenr (#2690)
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
U+2630 is a full width character. Replace it with U+2261.

closes: #2691

Signed-off-by: laburnumT <laburnumtec@gmail.com>
2024-11-18 21:07:35 +01:00
Neil Lambert
6c704f4b78 fix vim-airline/fern does not update the branch name as you navigate through fern, and theme fern inactive windows too (#2698)
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
Co-authored-by: Neil Lambert <nlambert@pm.me>
2024-10-30 18:21:02 +01:00
Bob Conan
3ddcab16c2 Update CHANGELOG.md, fix a typo (#2695)
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
2024-10-24 20:56:04 +02:00
13 changed files with 126 additions and 45 deletions

View File

@@ -11,7 +11,7 @@ on:
jobs:
test:
name: Test
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
vim:

View File

@@ -24,6 +24,7 @@ This is the Changelog for the vim-airline project.
- coc extensions can also show additional status messages as well as the current function
- [coc-git](https://github.com/neoclide/coc-git) extension integrated into hunks extension
- rewrote parts using Vim9 Script for performance improvements
- [vim-obsession](https://github.com/tpope/vim-obsession) allow to set paused indicator
- Other
- Changed CI from travis-ci.org to GitHub Actions
- Introduce Vim script static analysis using [reviewdog](https://github.com/reviewdog/action-vint)
@@ -85,7 +86,7 @@ This is the Changelog for the vim-airline project.
- [fugitive](https://github.com/tpope/vim-fugitive) plugin has been refactored
causing adjustments for vim-airline, also uses Fugitives new API calls
- some improvements to Vims terminal mode
- Allow to use alternative seperators for inactive windows ([#1236](https://github.com/vim-airline/vim-airline/issues/1236))
- Allow to use alternative separators for inactive windows ([#1236](https://github.com/vim-airline/vim-airline/issues/1236))
- Statusline can be set to inactive, whenever Vim loses focus (using FocusLost autocommand)
## [0.9] - 2018-01-15
@@ -135,7 +136,7 @@ This is the Changelog for the vim-airline project.
## [0.8] - 2016-03-09
- Changes
- Airline converted to an organization and moved to new [repository](https://github.com/vim-airline/vim-airline)
- Themes have been split into an separate repository [vim-airline-themes](https://github.com/vim-airline/vim-airline-themes)
- Themes have been split into a separate repository [vim-airline-themes](https://github.com/vim-airline/vim-airline-themes)
- Improvements
- Extensions
- branch: support Git and Mercurial simultaneously, untracked files

View File

@@ -7,30 +7,57 @@ if !get(g:, 'loaded_fern', 0)
finish
endif
function! airline#extensions#fern#apply(...) abort
if (&ft =~# 'fern')
let spc = g:airline_symbols.space
let fri = fern#fri#parse(expand('%f'))
call a:1.add_section('airline_a', spc.'fern'.spc)
if exists('*airline#extensions#branch#get_head')
call a:1.add_section('airline_b', spc.'%{airline#extensions#branch#get_head()}'.spc)
else
call a:1.add_section('airline_b', '')
endif
if !(fri.authority =~# '^drawer')
let abspath = substitute(fri.path, 'file://', '', '')
call a:1.add_section('airline_c', spc.fnamemodify(abspath, ':~'))
call a:1.split()
if len(get(g:, 'fern#comparators', {}))
call a:1.add_section('airline_y', spc.'%{fern#comparator}'.spc)
endif
endif
function! airline#extensions#fern#apply_active(...) abort
" check if current buffer is both fern and active
if (&ft =~# 'fern') && a:2.active ==# '1'
call airline#extensions#fern#configure_sections(a:1, a:2)
return 1
endif
endfunction
function! airline#extensions#fern#apply_inactive(...) abort
" check if referenced buffer is both fern and inactive
if getbufvar(a:2.bufnr, '&filetype') ==# 'fern' && a:2.active ==# '0'
call airline#extensions#fern#configure_sections(a:1, a:2)
return 1
endif
endfunction
function! airline#extensions#fern#configure_sections(win, context) abort
let spc = g:airline_symbols.space
let fri = fern#fri#parse(bufname(a:context.bufnr))
let abspath = ''
" Replace uses fern-replacer filetype, do not try to parse in that case
if &ft ==# 'fern' && fri.scheme ==# 'fern'
let abspath = fern#fri#to#filepath(fern#fri#parse(fri.path))
endif
call a:win.add_section('airline_a', spc.'fern'.spc)
if exists('*airline#extensions#branch#get_head')
" because fern navigation changes an internal _fri_ and not the working directory
" we need to give it some help so the branch name gets updated
try
if &ft ==# 'fern'
execute 'lcd' fnameescape(abspath)
endif
catch /^Vim\%((\a\+)\)\=:E344:/
call a:win.add_section('airline_b', '')
endtry
call a:win.add_section('airline_b', spc.'%{airline#extensions#branch#get_head()}'.spc)
else
call a:win.add_section('airline_b', '')
endif
if !(fri.authority =~# '^drawer')
call a:win.add_section('airline_c', spc.fnamemodify(abspath, ':~'))
call a:win.split()
if len(get(g:, 'fern#comparators', {}))
call a:win.add_section('airline_y', spc.'%{fern#comparator}'.spc)
endif
endif
endfunction
function! airline#extensions#fern#init(ext) abort
let g:fern_force_overwrite_statusline = 0
call a:ext.add_statusline_func('airline#extensions#fern#apply')
call a:ext.add_statusline_func('airline#extensions#fern#apply_active')
call a:ext.add_inactive_statusline_func('airline#extensions#fern#apply_inactive')
endfunction

View File

@@ -47,7 +47,7 @@ endfunction
function! s:airline_nvimlsp_get_line_number(cnt, type) abort
let severity = a:type == 'Warning' ? 'Warn' : a:type
let num = v:lua.vim.diagnostic.get(0, { 'severity': severity })[0].lnum
let num = v:lua.vim.diagnostic.get(0, { 'severity': severity })[0].lnum + 1
let l:open_lnum_symbol =
\ get(g:, 'airline#extensions#nvimlsp#open_lnum_symbol', '(L')

View File

@@ -14,10 +14,14 @@ if !exists('g:airline#extensions#obsession#indicator_text')
let g:airline#extensions#obsession#indicator_text = '$'
endif
if !exists('g:airline#extensions#obsession#indicator_text_paused')
let g:airline#extensions#obsession#indicator_text_paused = '' " vim-obsession defaults to 'S'
endif
function! airline#extensions#obsession#init(ext)
call airline#parts#define_function('obsession', 'airline#extensions#obsession#get_status')
endfunction
function! airline#extensions#obsession#get_status()
return ObsessionStatus((g:airline#extensions#obsession#indicator_text . s:spc), '')
return ObsessionStatus((g:airline#extensions#obsession#indicator_text . s:spc), (g:airline#extensions#obsession#indicator_text_paused . s:spc))
endfunction

View File

@@ -4,8 +4,8 @@
scriptencoding utf-8
let s:spc = g:airline_symbols.space
let s:current_bufnr = -1
let s:current_tabnr = -1
let s:current_modified = 0
let s:current_tabline = ''
let s:current_visible_buffers = []
@@ -49,14 +49,15 @@ function! airline#extensions#tabline#buffers#invalidate()
endfunction
function! airline#extensions#tabline#buffers#get()
let curbuf = bufnr('%')
let curtab = tabpagenr()
try
call <sid>map_keys()
catch
" no-op
endtry
let cur = bufnr('%')
if cur == s:current_bufnr && &columns == s:column_width
if !g:airline_detect_modified || getbufvar(cur, '&modified') == s:current_modified
if curbuf == s:current_bufnr && curtab == s:current_tabnr && &columns == s:column_width
if !g:airline_detect_modified || getbufvar(curbuf, '&modified') == s:current_modified
return s:current_tabline
endif
endif
@@ -77,10 +78,10 @@ function! airline#extensions#tabline#buffers#get()
let b.overflow_group = 'airline_tabhid'
let b.buffers = airline#extensions#tabline#buflist#list()
if get(g:, 'airline#extensions#tabline#current_first', 0)
if index(b.buffers, cur) > -1
call remove(b.buffers, index(b.buffers, cur))
if index(b.buffers, curbuf) > -1
call remove(b.buffers, index(b.buffers, curbuf))
endif
let b.buffers = [cur] + b.buffers
let b.buffers = [curbuf] + b.buffers
endif
function! b.get_group(i) dict
@@ -129,7 +130,7 @@ function! airline#extensions#tabline#buffers#get()
endif
endfunction
let current_buffer = max([index(b.buffers, cur), 0])
let current_buffer = max([index(b.buffers, curbuf), 0])
let last_buffer = len(b.buffers) - 1
call b.insert_titles(current_buffer, 0, last_buffer)
@@ -142,7 +143,8 @@ function! airline#extensions#tabline#buffers#get()
call airline#extensions#tabline#add_tab_label(b)
let s:current_bufnr = cur
let s:current_bufnr = curbuf
let s:current_tabnr = curtab
let s:column_width = &columns
let s:current_tabline = b.build()
let s:current_visible_buffers = copy(b.buffers)

View File

@@ -51,7 +51,8 @@ endfunction
function! s:conflict_marker()
" Checks for git conflict markers
let annotation = '\%([0-9A-Za-z_.:]\+\)\?'
" space required for jj conflict marker: #2727
let annotation = '\%([0-9A-Za-z_.: ]\+\)\?'
if match(['rst', 'markdown', 'rmd'], &ft) >= 0
" rst filetypes use '=======' as header
let pattern = '^\%(\%(<\{7} '.annotation. '\)\|\%(>\{7\} '.annotation.'\)\)$'

View File

@@ -186,6 +186,13 @@ if !exists(":def") || !airline#util#has_vim9_script()
call <sid>exec_separator({}, a:from, a:to, a:inverse, '')
endfunction
function! airline#highlighter#remove_separators_for_bufnr(bufnr) abort
" remove all separators, that have the buffer number in their name,
" but do not be too greedy!
let pat = 'c' . a:bufnr . '\(\D\|$\)'
call filter(s:separators, 'v:key !~# pat')
endfunction
function! s:exec_separator(dict, from, to, inverse, suffix) abort
if pumvisible()
return
@@ -529,6 +536,13 @@ else
s:exec_separator({}, from, to, inverse, '')
enddef
def airline#highlighter#remove_separators_for_bufnr(bufnr: string): void
# remove all separators, that have the bufnr in its name, make sure we
# have a full match here
const pat = $'c{bufnr}\(\D\|$\)'
filter(s:separators, (k, v) => k !~# pat)
enddef
def s:exec_separator(dict: dict<any>, from_arg: string, to_arg: string, inverse: bool, suffix: string): void
if pumvisible()
return
@@ -681,5 +695,5 @@ else
endfor
endif
endfor
enddef
enddef
endif

View File

@@ -129,15 +129,21 @@ function! airline#init#bootstrap()
call extend(g:airline_symbols, {
\ 'readonly': "\ue0a2",
\ 'whitespace': "\u2632",
\ 'maxlinenr': "\u2630 ",
\ 'maxlinenr': "\u2261 ",
\ 'linenr': " \ue0a1:",
\ 'colnr': " \u2105:",
\ 'branch': "\ue0a0",
\ 'notexists': "\u0246",
\ 'dirty': "\u26a1",
\ 'crypt': nr2char(0x1F512),
\ 'executable': "\u2699",
\ }, 'keep')
" Note: If "\u2046" (Ɇ) does not show up, try to use "\u2204" (∄)
if exists("*setcellwidths")
" whitespace char 0x2632 changed to double-width in Unicode 16,
" mark it single width again
call setcellwidths([[0x2632, 0x2632, 1]])
endif
elseif &encoding==?'utf-8' && !get(g:, "airline_symbols_ascii", 0)
" Symbols for Unicode terminals
call s:check_defined('g:airline_left_sep', "")
@@ -148,13 +154,14 @@ function! airline#init#bootstrap()
call extend(g:airline_symbols, {
\ 'readonly': "\u229D",
\ 'whitespace': "\u2632",
\ 'maxlinenr': "\u2630",
\ 'maxlinenr': "\u2261",
\ 'linenr': " \u33d1:",
\ 'colnr': " \u2105:",
\ 'branch': "\u16A0",
\ 'notexists': "\u0246",
\ 'crypt': nr2char(0x1F512),
\ 'dirty': '!',
\ 'executable': "\u2699",
\ }, 'keep')
else
" Symbols for ASCII terminals
@@ -172,6 +179,7 @@ function! airline#init#bootstrap()
\ 'notexists': '?',
\ 'crypt': 'cr',
\ 'dirty': '!',
\ 'executable': 'x',
\ }, 'keep')
endif
@@ -184,6 +192,7 @@ function! airline#init#bootstrap()
call airline#parts#define_function('crypt', 'airline#parts#crypt')
call airline#parts#define_function('spell', 'airline#parts#spell')
call airline#parts#define_function('filetype', 'airline#parts#filetype')
call airline#parts#define_function('executable', 'airline#parts#executable')
call airline#parts#define('readonly', {
\ 'function': 'airline#parts#readonly',
\ 'accent': 'red',
@@ -195,7 +204,7 @@ function! airline#init#bootstrap()
endif
call airline#parts#define_raw('path', '%F%m')
call airline#parts#define('linenr', {
\ 'raw': '%{g:airline_symbols.linenr}%l',
\ 'raw': '%{g:airline_symbols.linenr}%2l',
\ 'accent': 'bold'})
call airline#parts#define('maxlinenr', {
\ 'raw': '/%L%{g:airline_symbols.maxlinenr}',
@@ -248,7 +257,7 @@ endfunction
function! airline#init#sections()
let spc = g:airline_symbols.space
if !exists('g:airline_section_a')
let g:airline_section_a = airline#section#create_left(['mode', 'crypt', 'paste', 'keymap', 'spell', 'capslock', 'xkblayout', 'iminsert'])
let g:airline_section_a = airline#section#create_left(['mode', 'crypt', 'paste', 'keymap', 'spell', 'capslock', 'xkblayout', 'iminsert', 'executable'])
endif
if !exists('g:airline_section_b')
if airline#util#winwidth() > 99

View File

@@ -206,3 +206,11 @@ function! airline#parts#ffenc()
return &fenc.bomb.noeolf.ff
endif
endfunction
function! airline#parts#executable()
if exists("*getfperm") && getfperm(bufname('%')) =~ 'x'
return g:airline_symbols.executable
else
return ''
endif
endfunction

View File

@@ -1,4 +1,4 @@
*airline.txt* Lean and mean status/tabline that's light as air
*airline.txt* Lean and mean status/tabline that's light as air
*airline* *vim-airline*
_ _ _ _ ~
__ _(_)_ __ ___ __ _(_)_ __| (_)_ __ ___ ~
@@ -374,6 +374,7 @@ its contents. >
let g:airline_symbols.colnr = ' ㏇:'
let g:airline_symbols.colnr = ' ℅:'
let g:airline_symbols.crypt = '🔒'
let g:airline_symbols.executable = '⚙'
let g:airline_symbols.linenr = '☰'
let g:airline_symbols.linenr = ' ␊:'
let g:airline_symbols.linenr = ' ␤:'
@@ -427,7 +428,7 @@ window.
>
variable names default contents
---------------------------------------------------------------------------
let g:airline_section_a (mode, crypt, paste, spell, iminsert)
let g:airline_section_a (mode, crypt, paste, spell, iminsert, executable)
let g:airline_section_b (hunks, branch)[*]
let g:airline_section_c (bufferline or filename, readonly)
let g:airline_section_gutter (csv)
@@ -998,8 +999,11 @@ vim-obsession <https://github.com/tpope/vim-obsession>
* enable/disable vim-obsession integration >
let g:airline#extensions#obsession#enabled = 1
* set marked window indicator string >
* set marked window indicator string when recording session>
let g:airline#extensions#obsession#indicator_text = '$'
* set marked window indicator string when recording session is paused>
let g:airline#extensions#obsession#indicator_text_paused = ''
<
------------------------------------- *airline-omnisharp*
OmniSharp <https://github.com/OmniSharp/omnisharp-vim>
@@ -1207,7 +1211,7 @@ Note: Not displayed if the number of tabs is less than 1
In default mode, when the variable is 1 Up to 10 mappings will be
exposed. Note: As 10 and 1 have same prefix, we use 0 to replace 10. So,
<leader>0 will jump to tenth buffer. Those mappings are not automatically
created, vim-airline just exposes those `<Plug>AirlineSeelctTab` keys
created, vim-airline just exposes those `<Plug>AirlineSelectTab` keys
for you to map to a convenient key >
let g:airline#extensions#tabline#buffer_idx_mode = 1
@@ -1918,6 +1922,7 @@ The following list of parts are predefined by vim-airline.
* `iminsert` displays the current insert method
* `paste` displays the paste indicator
* `crypt` displays the crypted indicator
* `exectuable` displays the executable indicator
* `spell` displays the spell indicator
* `filetype` displays the file type
* `readonly` displays the read only indicator

View File

@@ -48,6 +48,7 @@ function! s:init()
endfunction
let s:active_winnr = -1
function! s:on_window_changed(event)
" don't trigger for Vim popup windows
if &buftype is# 'popup'
@@ -67,11 +68,20 @@ function! s:on_window_changed(event)
\ && &ft !~? 'gitcommit'
" fugitive is special, it changes names and filetypes several times,
" make sure the caching does not get into its way
if a:event ==# 'BufUnload'
" in the BufUnload event, make sure the cacheing does not prevent
" removing stale entries
call airline#highlighter#remove_separators_for_bufnr(expand('<abuf>'))
endif
return
endif
let g:airline_last_window_changed = l:key
call s:init()
call airline#update_statusline()
if a:event ==# 'BufUnload'
call airline#highlighter#remove_separators_for_bufnr(expand('<abuf>'))
endif
endfunction
function! s:on_focus_gained()

View File

@@ -47,7 +47,7 @@ Describe init.vim
It section z should be line numbers
Assert Match(g:airline_section_z, '%p%%')
Assert Match(g:airline_section_z, '%l')
Assert Match(g:airline_section_z, '%2l')
Assert Match(g:airline_section_z, '%v')
End