6 for buf in split(bufsRaw, "\n")[:16]
7 let leftIdx = stridx(buf, '"')
8 let rightIdx = strridx(buf, '"')
9 let filename = substitute(buf[leftIdx + 1 : rightIdx - 1], "%", "%%", "g")
10 let linenum = split(buf[rightIdx:], " ")[-1]
11 let attrs = split(buf[:leftIdx-1], '\s\+')
12 let attrs = map(attrs, 'substitute(v:val, "%", "%%", "g")')
13 let attrs = (len(attrs) == 1) ? attrs[0] : attrs[0] . ":" . join(attrs[1:], "")
14 let attrs = "%#TabLine#" . attrs . "%*"
15 if len(filename) > 20 | let filename = "<" . filename[-(20-1):] | endif
16 let hl = (match(attrs, "%%") == -1) ? "%#TabLine#:" : "%#TabLineSel#"
17 let bufs = add(bufs, attrs . hl . filename . ":" . linenum . "%*")
19 return join(bufs, " ")
23 set tabline=%!BufTabline()