tabline: only map keys if not done yet

Should improve performance by not steadily remapping keys
This commit is contained in:
Christian Brabandt 2017-06-27 14:44:03 +02:00
parent b2f301f73c
commit 62952b3887
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -97,6 +97,9 @@ function! airline#extensions#tabline#tabs#get()
endfunction
function! airline#extensions#tabline#tabs#map_keys()
if exists("s:airline_tabline_map_key")
return
endif
noremap <silent> <Plug>AirlineSelectTab1 :1tabn<CR>
noremap <silent> <Plug>AirlineSelectTab2 :2tabn<CR>
noremap <silent> <Plug>AirlineSelectTab3 :3tabn<CR>
@ -109,4 +112,5 @@ function! airline#extensions#tabline#tabs#map_keys()
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>
let s:airline_tabline_map_key = 1
endfunction