mk12 / vscode-better-git-line-blame

VS Code extension that decorates lines with git blame information.
https://marketplace.visualstudio.com/items?itemName=mk12.better-git-line-blame
MIT License
39 stars 3 forks source link

Provide configuration setting to disable showing commit message #4

Closed admushka closed 3 months ago

admushka commented 3 months ago

Today, when you first click on a line of code, and then hover over it, the extension appends the commit message to the regular details it shows on hover. For example, when hovering over a function name, extensions usually show any comments/docstring associated with the function.

I find this very confusing and information overloading, as I usually first click on a line before hovering it and get a pop up with multiple lines of text , some of them are actual comments and some of them are from the commit message. Or you get a popup on very simple lines of code, where you don't expect to see any popups at all, which can be distracting.

I would like the option to not see the commit message if I didn't explicitly chose to see it. Would be useful to have a setting to override the default behavior in one of two ways:

mk12 commented 3 months ago

Thanks for reporting this. You're totally right, it's confusing when different hover messages get combined.

I've fixed this in 0.2.5, taking your first suggestion and only showing the hover message when you hover over the blame annotation.

As I mention in ed92fe5082be082d9f019199895bae867db1d41a, there is a small downside: when joining lines there can be a brief flicker where the annotation appears in the middle of the line. However, it's barely noticeable, so I think this is worth it.

Also, you will still see combined hover messages if there's another hover message for something at the end of the line, e.g. in a line like #include "foo.h", if your cursor is at the end, it will show the commit info and the foo.h info. But GitLens does the same thing so that seems unavoidable.

mk12 commented 3 months ago

Ahh now I remember why I had done that. The problem of the annotation appearing in the middle of the line is a lot more noticeable in a remote project. I still think it's worth it to fix this issue, but maybe I should add a config for it.

mk12 commented 3 months ago

In 0.2.6 I added a config betterGitLineBlame.annotateWholeLine to go back to the old behavior (false by default), with a new FAQ Why do annotations flicker when I delete or join lines? in the README.