Loading ...
Sorry, an error occurred while loading the content.

GUI Tab Tooltip: list buffers

Expand Messages
  • Chris Lott
    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
    Message 1 of 1 , Oct 31, 2012
    • 0 Attachment
      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@...>

      --
      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
    Your message has been successfully submitted and would be delivered to recipients shortly.