general todo: add popup-menues, drawer: change tab before context
menu is closed!!
Vim Mac GUI tabline
There are several ways to implement gui tabs in mac vim:
- Segmented view
- Tabs like you expect them
- Doesn't need much space
- Need OS X 10.3
- needs compositing enabled
- seems that this needs a standard event handler on the main
window, which makes resizing and maximizing choke. Without the
standard handler, clicking the tab bar doesn't work...perhaps
this can be fixed without a standard handler?
There are two ways this can be implemented:
- Put the segmented view in the root view of the window.
This has the advantage that it works with less effort and
gives more vertical room for vim (but makes moving the window
with the mouse somewhat harder). Another problem is that
no title bar text is available, this is annoying if you use Expose
- Put the segmented view in the content view of the window. This
requires more changes (vim's text window has to be converted to
a view, which are only supported from 10.2 on), but it's what
you'd normally expect. Plus, if the text area is a view, this gives
us the ability to add a toolbar as well; it should also improve
drawing performance and is recommended by apple as the
The segmented view should change its size when the window is resized,
if there are a lot of tabs, they should be made smaller so that
they are all visible. Alternatively, left/right arrows can be
added after a certain minimal tab size (see this page for an example).
It looks like this:
todo: make tabs clickable ( gui_mac_doMouseDownEvent ?),
make tabs smaller if they don't fit otherwise, resize max toolbar size
when window is resized
- works with older mac os x versions (10.2)
- Doesn't need vertical screen space
- has room for a lot of tabs. the drawer could display
tabs hierarchically, this way you could have whole trees open.
- other gui stuff could be added to the drawer
- needs some horizontal screen space
- according to this, data browser doesn't work with compositing on 10.2, but drawers need compositing. so this might not really work on 10.2 :-(
It looks like this:
crashes when -p *.h is used (stl=1, close all but the first tab,
open new tab) (might be fixed by now, was unable to reproduce this),
if the window size is set to a smaller than minmal
height with :set lines=10 the display looks really strange,
scrollbar flashes black on tab change, context menu close is only
applied after mouse move
- One window for each tab
Use a separate window for each tab. This would be very maccy, but has
probably some problems because the windows can have different sizes.
- External tab lib
Use this tab control.
- Looks good, is what you'd expect
- maintained by others, and used in other apps (iterm,colloquy, adium
want to use it too)
- The lib is in cocoa, so we need a wrapper to call it from C.
- Needs views as well
Other stuff that could be improved in mac vim:
- add proxies to the title bar
- improved atsui stuff (utf16_1-3.txt don't work)
- (more than one window per session...)
- generate "Press Enter or enter command..." message, tab, cmd-tab:
more messages are generated
- trackpad scrolling is currently a bit jittery because
left/right movement scrolls as well (so left/down movement
- ctrl-click for context menu, then click somewhere else -
another popup is opened
- (not mac specific) when a file is selected in :e . , the :pwd part
should be stripped if the file is somewhere below pwd
- use carbon events
- use hiview?
- :tabe äö (this killed a few of my vims)
- :tabe aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa (check what happens with long file names...should be shortened somehow)