Skip to content

'guitablabel' should only be set if user hasn't set it in vimrc. #635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 15, 2018

Conversation

ychin
Copy link
Member

@ychin ychin commented Feb 13, 2018

Right now, the user has to override 'guitablabel' in gvimrc instead of vimrc because MacVim overrides the setting, but this change makes it so that MacVim only sets the defaults if the user hasn't set it already.

…t already in vimrc. Otherwise keep it so user doesn't have to override it again in gvimrc
@splhack splhack merged commit c574994 into macvim-dev:master Feb 15, 2018
@chdiza
Copy link
Contributor

chdiza commented Feb 15, 2018

I would have thought that gvimrc and not vimrc is where settings governing the GUI should go.

@chdiza
Copy link
Contributor

chdiza commented Feb 15, 2018

In other words, what is the problem with having to override guitablabel in gvimrc? That's where one would expect to override it.

@ychin
Copy link
Member Author

ychin commented Feb 15, 2018

That's the best practices as described in the docs (gui.txt), yes, but I think there are people who also just set gui options in vimrc using has("gui_running") checks. Feels to me if the user has already set the option, MacVim's own gvimrc should try to respect that and not stomp the custom value (you can set this option in regular Vim/Gvim's vimrc and it will work, for example). If the user is setting guitablabels in gvimrc as recommended nothing would change.

My understanding of gvimrc is that there are certain GUI work and initialization that happens after vimrc is sourced, which is why you need another file to provide certain GUI customization, but in this case there's no technical limitation on why we should stomp the user's setting flags.

@ychin ychin deleted the guitablabel_defaults branch February 15, 2018 20:54
@ychin ychin restored the guitablabel_defaults branch February 15, 2018 20:56
@ychin
Copy link
Member Author

ychin commented Feb 15, 2018

Oh actually, I made a mistake in the docs then. You need to still override the gvimrc to get the default tab labels back. I'll submit PR for that.

@chdiza
Copy link
Contributor

chdiza commented Feb 15, 2018

but I think there are people who also just set gui options in vimrc using has("gui_running") checks.

There are (though I suspect it's very few), but they're not supposed to be doing that.

I don't see the point of this unless one is desperately trying to avoid needing to have a ~/.gvimrc in the first place. If you already have a ~/.gvimrc, there is no reason not to put your guitablabel setting in it, and there is no reason to put that setting in ~/.vimrc.

Feels to me if the user has already set the option, MacVim's own gvimrc should try to respect that and not stomp the custom value

This would be true for options that have nothing to do with the GUI (e.g., &textwidth). But I can't see why that shouldbe presumed to hold for GUI specific options.

@ychin
Copy link
Member Author

ychin commented Feb 16, 2018

Hmm, I don't really have too strong an opinion of this. I do think it's nice to respect options that was set in vimrc if the user set it somehow but yes they should have been set on the gvimrc instead. There are also other existing vimrc settings you can set like macvim_skip_colorscheme in order to not having to override them in gvimrc. Pinging @splhack in case he has an opinion on this.

@splhack
Copy link
Contributor

splhack commented Feb 16, 2018

I don't have any opinion about that :) and I can revert it #637

@ychin ychin deleted the guitablabel_defaults branch July 31, 2018 06:54
localstatic pushed a commit to localstatic/vimrc that referenced this pull request Oct 3, 2018
This is necessary for this particular setting because MacVim unconditionally stomps on this particular option if it is set in vimrc instead of gvimrc.

macvim-dev/macvim#635
ychin added a commit to ychin/macvim that referenced this pull request Jun 9, 2019
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 macvim-dev#635 but reverted, but macvim-dev#899 raised this
issue again.

Close macvim-dev#899
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants