Hi,
this patch sets the close button state according to "Indicating
Changes With the Close Button" in the Apple HIG ( http://
developer.apple.com/documentation/UserExperience/Conceptual/
OSXHIGuidelines/XHIGWindows/chapter_17_section_3.html ).
I haven't tried it but it's good to try to make Vim look like other
Mac
applications.
The implementation is rather brute force.
I'll try to improve it. I like to add proxy icons as well (see above
link too), which deprecates this patch anyways. A proxy icon is a
small icon of the current document (ie. active buffer in active tab)
in the windows toolbar which you can drag to other programs (for
example, to create a link to an opened file, drag its proxy icon to
some folder in the finder). You can Command-click the proxy icon to
display the path to the current document as well. When the current
file isn't saved, the proxy icon is deactivated because it's not
predictable for the user what happens when you drag the icon.
Sadly, you call the same function to change the close button and to
(de)activate the proxy icon, which doesn't work well with
multidocument windows. I looked at several other mac text editors;
they all set the close button to the "document was modified" state
when the active document was modified (to keep the proxy icon for
unmodified buffers activated when such a buffer is selected). I will
try to add this behaviour to mac vim as well (but it will take me
some time, currently I'm busy with exams :-| ).
Bye & sorry for the long mail,
Nico