From c149d27fe80ef782c9f989db7e622e0d560f043a Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Tue, 28 Jul 2020 17:15:21 +0300 Subject: [PATCH] Limit filename size only --- vim/.vim/plugin/buftabline.vim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vim/.vim/plugin/buftabline.vim b/vim/.vim/plugin/buftabline.vim index 2c28fd3..46f6d33 100644 --- a/vim/.vim/plugin/buftabline.vim +++ b/vim/.vim/plugin/buftabline.vim @@ -10,12 +10,13 @@ function! BufTabline() if len(ent) == 0 | continue | endif let ents = add(ents, substitute(ent, "%", "%%", "g")) endfor - let ents[-3] = ents[-3] . ":" . ents[-1] - let ents = ents[:-3] + let linenum = ents[-1] + let ents = ents[:-3] " strip message with line number if len(ents) == 4 | let ents = [ents[0], ents[1] . ents[2], ents[3]] | endif if len(ents) == 3 | let ents = [ents[0] . ":" . ents[1], ents[2]] | endif let ents[0] = "%#TabLine#" . ents[0] . "%*" - if len(ents[1]) > 20 | let ents[1] = "<" . ents[1][-19:] | endif + if len(ents[1]) > 20 | let ents[1] = "<" . ents[1][-(20-1):] | endif + let ents[1] = ents[1] . ":" . linenum if match(ents[0], "%%") == -1 let ents[1] = "%#TabLine#:" . ents[1] . "%*" else -- 2.44.0