tabline: add forgotten changes from commit cd1d8c2a96

I accidentally missed including some more changes for buffer_idx_mode=2.
So add those files now.
This commit is contained in:
Christian Brabandt 2019-02-07 08:17:33 +01:00
parent cd1d8c2a96
commit 05572482b8
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
3 changed files with 28 additions and 6 deletions

View File

@ -9,6 +9,8 @@ This is the Changelog for the vim-airline project.
- Improvements
- The statusline can be configured to be shown on top (in the tabline)
Set the `g:airline_statusline_ontop` to enable this experimental feature.
- If `buffer_idx_mode=2`, up to 89 mappings will be exposed to access more
buffers directly (issue #1823)
## [0.10] - 2018-12-15
- New features

View File

@ -104,9 +104,16 @@ function! airline#extensions#tabline#tabs#map_keys()
if maparg('<Plug>AirlineSelectTab1', 'n') is# ':1tabn<CR>'
return
endif
let bidx_mode = get(g:, 'airline#extensions#tabline#buffer_idx_mode', 1)
if bidx_mode == 1
for i in range(1, 9)
exe printf('noremap <silent> <Plug>AirlineSelectTab%d :%dtabn<CR>', i, i)
endfor
else
for i in range(10, 99)
exe printf('noremap <silent> <Plug>AirlineSelectTab%d :%dtabn<CR>', i, i-9)
endfor
endif
noremap <silent> <Plug>AirlineSelectPrevTab gT
" tabn {count} goes to count tab does not go {count} tab pages forward!
noremap <silent> <Plug>AirlineSelectNextTab :<C-U>exe repeat(':tabn\|', v:count1)<cr>

View File

@ -859,9 +859,10 @@ with the middle mouse button to delete that buffer.
* enable/disable displaying index of the buffer.
When enabled, numbers will be displayed in the tabline and mappings will be
exposed to allow you to select a buffer directly. Up to 11 mappings will be
exposed. >
`buffer_idx_mode` allows 2 different modes to access buffers from the
tabline. When enabled, numbers will be displayed in the tabline and mappings
will be exposed to allow you to select a buffer directly.
In default mode, when the variable is 1 Up to 11 mappings will be exposed: >
let g:airline#extensions#tabline#buffer_idx_mode = 1
nmap <leader>1 <Plug>AirlineSelectTab1
@ -875,6 +876,18 @@ with the middle mouse button to delete that buffer.
nmap <leader>9 <Plug>AirlineSelectTab9
nmap <leader>- <Plug>AirlineSelectPrevTab
nmap <leader>+ <Plug>AirlineSelectNextTab
<
In mode 2, (when the variable is 2) 89 mappings will be exposed
(Note: To avoid ambiguity, there won't be <Plug>AirlineSelectTab1
- <Plug>AirlineSelectTab9 maps): >
let g:airline#extensions#tabline#buffer_idx_mode = 2
nmap <Leader>10 <Plug>AirlineSelectTab10
nmap <Leader>11 <Plug>AirlineSelectTab11
nmap <Leader>12 <Plug>AirlineSelectTab12
nmap <Leader>13 <Plug>AirlineSelectTab13
...
nmap <Leader>99 <Plug>AirlineSelectTab99
<
The <Plug>AirlineSelect<Prev/Next>Tab mapping handles counts as well,
so one can handle arbirtrarily number of buffers/tabs.