Wednesday, October 31, 2012

GUI Tab Tooltip: list buffers

I pilfered the following code that is supposed to show a buffer list
as the tooltip on the tabs, but it is not working. Any ideas?

I can see the buffers with :buffers and with ctrlP buffer list, so I
know they are there, but they are not showing as the tooltip. Am I not
understanding what this code *should* do?

***


"make those tooltips cool by showing buffer names within them
function! GuiTabToolTip()
let tip = ''
let bufnrlist = tabpagebuflist(v:lnum)
for bufnr in bufnrlist
" separate buffer entries
if tip!=''
let tip .= " \n "
endif
" Add name of buffer
let name=bufname(bufnr)
if name == ''
" give a name to no name documents
if getbufvar(bufnr,'&buftype')=='quickfix'
let name = '[Quickfix List]'
else
let name = '[No Name]'
endif
endif
let tip.=name
" add modified/modifiable flags
if getbufvar(bufnr, "&modified")
let tip .= ' [+]'
endif
if getbufvar(bufnr, "&modifiable")==0
let tip .= ' [-]'
endif
endfor
return tip
endfunction

"show tooltips on tabs
set guitabtooltip=%{GuiTabToolTip()}

***

c
--
Chris Lott <chris@chrislott.org>

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment