Skip to content
New issue

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

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

Already on GitHub? # to your account

git-gutter:hide-gutter only respected if global-git-gutter-mode is active #153

Open
NateEag opened this issue Mar 26, 2018 · 4 comments
Open
Labels
enhancement new feature requested

Comments

@NateEag
Copy link

NateEag commented Mar 26, 2018

If you don't activate git-gutter by calling (global-git-gutter-mode), git-gutter:hide-gutter is not respected.

This is because of the implementation of git-gutter:reset-window-margin-p, which explicitly ignores the variable if global-git-gutter-mode is not active.

What is that logic intended to achieve? Is there a way of doing it that doesn't break git-gutter:hide-gutter?

@gonewest818 gonewest818 added the question general questions label Mar 24, 2020
@gonewest818
Copy link
Collaborator

At first glance, it seems the logic is "if the mode isn't active then why would you need to reset anything?" Can you explain a little further what it is you're trying to do?

@NateEag
Copy link
Author

NateEag commented Mar 25, 2020

Sure.

I call git-gutter-mode in the hooks where I know I'll likely want it - prog-mode and text-mode.

That way I don't pay the cost of initializing it until I actually want to use it.

git-gutter:hide-gutter only working if the package is kicked off with global-git-gutter-mode and not when it's started by git-gutter-mode feels like a bug to me.

Why should one supported start mechanism work, but not the other?

@gonewest818
Copy link
Collaborator

Ok, now I see. Well, I went back through the logs and found using the global mode forces the gutters to be displayed always, and has been that way since at least 2013.

There used to be a setting called git-gutter:always-show-gutter that would also force the display when not using the global mode. This was replace by git-gutter:hide-gutter in this commit:
bffe95f#diff-0e0367812f9b0c9888d30842b9cbdee6L277-R280

And in that change it seems to me, the intentional choice was made to continue with the rule that the global mode forces the display of the gutter. So given that this package has gone unchanged for a while, I'm reluctant to break compatibility or change default behavior right out of the gate.

I agree it makes sense to optionally hide the gutter, so I'll look at ways to deprecate/transition to a new set of semantics without causing people too much disruption.

@gonewest818 gonewest818 added enhancement new feature requested and removed question general questions labels Mar 25, 2020
@NateEag
Copy link
Author

NateEag commented Mar 29, 2020

Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement new feature requested
Development

No branches or pull requests

2 participants