gitkraken / vscode-gitlens

Supercharge Git inside VS Code and unlock untapped knowledge within each repository — Visualize code authorship at a glance via Git blame annotations and CodeLens, seamlessly navigate and explore Git repositories, gain valuable insights via rich visualizations and powerful comparison commands, and so much more
http://gitkraken.com/gitlens
Other
8.96k stars 1.3k forks source link

Closing the blame sidebar also hides the gutter heatmap #782

Open jrheard opened 5 years ago

jrheard commented 5 years ago

GitLens version: 9.8.2 VS Code version: Code 1.35.1 (c7d83e57cd18f18026a8162d042843bda1bcf21f, 2019-06-12T14:29:22.216Z) OS version: Darwin x64 18.6.0

Steps to Reproduce:

I have "Toggle File Blame Annotations" bound to cmd+option+g b and "Toggle File Heatmap Annotations" bound to cmd+option+g h.

  1. Be in a file that has an associated git history
  2. Press cmd+option+g h to show the gutter heatmap
  3. Press cmd+option+g b to show blame sidebar
  4. Press cmd+option+g b to hide the blame sidebar

Hiding the blame sidebar hides the gutter heatmap, so the gutter heatmap is no longer visible after step 4 - but I didn't want to hide the heatmap, I just wanted to hide the blame sidebar.

Is this intended behavior? Is there a known workaround? Am I doing something wrong?

Thank you!

eamodio commented 5 years ago

That is the intended behavior -- each type of file decoration is mutually exclusive, so turning on one turns off the other.

eamodio commented 5 years ago

While I can't see changing this behavior anytime soon (because of the work involved), I can see the desire to decouple at least the heatmap from the others, so I will leave this open.

eamodio commented 5 years ago

Although another option (that might be easier to implement), is to keep a stack of the decoration providers. So while they will still be mutually exclusive, it could restore the previous one in the stack.

So doing the following:

  1. turn on heatmap
  2. turn on blame, would turn off the heatmap first
  3. turn off blame, would restore the heatmap

Might not be exactly what is intended, but could be close enough?

jrheard commented 5 years ago

The proposal in your last comment would work fine for my use case! Right now I live in a world where every so often I toggle off the heatmap without meaning to, and afterward I don't notice for an hour or two and then I have to toggle it back on by hand; I would love to instead live in a world where it's toggled back on instantly without me having to remember to do it :D

eamodio commented 3 years ago

This isn't something that I will likely add myself, but if the community wants to champion it and provide a PR (after discussing) I'm certainly open to it -- of course, depending on the complexity and scope of the changes required.