From 499cf07e6ddd1306e948f128f78c3abba6e7fc6e Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Sun, 9 Jun 2019 15:40:56 -0700 Subject: [PATCH] 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 --- runtime/doc/gui_mac.txt | 8 +++++--- src/MacVim/gvimrc | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/runtime/doc/gui_mac.txt b/runtime/doc/gui_mac.txt index f502c980bb..6a6cd3bd13 100644 --- a/runtime/doc/gui_mac.txt +++ b/runtime/doc/gui_mac.txt @@ -105,9 +105,11 @@ dropping two more, and switching back to the first tab would cause weird strings like "((3) of 2)" to appear in the window title. *macvim-tablabel* -Tab labels only show the tail of the file name to make the tabs more readable -when editing files in deeply nested folders. Add the line "set guitablabel=" -to your .gvimrc file to revert back to the default Vim tab label. +By default, tab labels only show the tail of the file name to make the tabs +more readable when editing files in deeply nested folders. Add the line "set +guitablabel=" to your .gvimrc file to revert back to the default Vim tab +label. Setting 'guitablabel' to anything in your .vimrc will also prevent +this default from taking effect. *macvim-options* These are the non-standard options that MacVim supports: diff --git a/src/MacVim/gvimrc b/src/MacVim/gvimrc index 58f10c5824..2d42b23944 100644 --- a/src/MacVim/gvimrc +++ b/src/MacVim/gvimrc @@ -28,7 +28,9 @@ endif " To make tabs more readable, the label only contains the tail of the file " name and the buffer modified flag. -set guitablabel=%M%t +if empty(&guitablabel) + set guitablabel=%M%t +endif " Send print jobs to Preview.app. This does not delete the temporary ps file " that is generated by :hardcopy.