mirror of
https://github.com/vim-airline/vim-airline-themes.git
synced 2024-12-03 23:43:45 +08:00
use columns instead of winwidth (#222).
This commit is contained in:
parent
e507f481a2
commit
4d706c5f4a
|
@ -124,12 +124,13 @@ function! s:get_visible_buffers()
|
|||
|
||||
" only show current and surrounding buffers if there are too many buffers
|
||||
let position = index(buffers, cur)
|
||||
if total_width > winwidth(0) && position > -1
|
||||
let vimwidth = &columns
|
||||
if total_width > vimwidth && position > -1
|
||||
let buf_count = len(buffers)
|
||||
|
||||
" determine how many buffers to show based on the longest buffer width,
|
||||
" use one on the right side and put the rest on the left
|
||||
let buf_max = winwidth(0) / max_width
|
||||
let buf_max = vimwidth / max_width
|
||||
let buf_right = 1
|
||||
let buf_left = max([0, buf_max - buf_right])
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user