Skip to content

Commit 499cf07

Browse files
committed
Only override 'guitablabel' if user hasn't already set it
If guitablabel is already set in .vimrc, don't have the MacVim default gvimrc override it. Even though Vim's docs recommend putting GUI settings in gvimrc, that's mostly for technical reasons, and MacVim should still aim to respect settings that a user has already set. This also makes it behave more similarly with Vim (you can set 'guitablabel' in vimrc or gvimrc and it would still work). This was previously done in #635 but reverted, but #899 raised this issue again. Close #899
1 parent a9c8cc6 commit 499cf07

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

runtime/doc/gui_mac.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,11 @@ dropping two more, and switching back to the first tab would cause weird
105105
strings like "((3) of 2)" to appear in the window title.
106106

107107
*macvim-tablabel*
108-
Tab labels only show the tail of the file name to make the tabs more readable
109-
when editing files in deeply nested folders. Add the line "set guitablabel="
110-
to your .gvimrc file to revert back to the default Vim tab label.
108+
By default, tab labels only show the tail of the file name to make the tabs
109+
more readable when editing files in deeply nested folders. Add the line "set
110+
guitablabel=" to your .gvimrc file to revert back to the default Vim tab
111+
label. Setting 'guitablabel' to anything in your .vimrc will also prevent
112+
this default from taking effect.
111113

112114
*macvim-options*
113115
These are the non-standard options that MacVim supports:

src/MacVim/gvimrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ endif
2828

2929
" To make tabs more readable, the label only contains the tail of the file
3030
" name and the buffer modified flag.
31-
set guitablabel=%M%t
31+
if empty(&guitablabel)
32+
set guitablabel=%M%t
33+
endif
3234

3335
" Send print jobs to Preview.app. This does not delete the temporary ps file
3436
" that is generated by :hardcopy.

0 commit comments

Comments
 (0)