Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Popup a diff buffer with C-x v RET #35

Closed
wants to merge 1 commit into from
Closed

Conversation

mrBliss
Copy link

@mrBliss mrBliss commented Jan 12, 2015

I wanted to switch from emacs-git-gutter to diff-hl, but I missed the popup buffer functionality, so I added it 馃槂

@dgutov
Copy link
Owner

dgutov commented Jan 12, 2015

Hmm. Are you sure that you need this feature? C-x v =, when diff-hl-mode is on, already scrolls to and focuses on the current hunk.

Improving that feature would be a bit easier: for instance, somehow better emphasizing the current hunk in the diff buffer.

@mrBliss
Copy link
Author

mrBliss commented Jan 12, 2015

Improving that feature would be a bit easier: for instance, somehow better emphasizing the current hunk in the diff buffer.

That's partly the issue I'm trying to solve, C-x v = gives me too much context, I just want to think about the current hunk/diff.

However, adding (recenter-top-bottom) after the while loop in diff-hl-diff-skip-to makes C-x v = more useable to me.

In what other way do you think the current hunk can be better emphasised in the diff buffer?

@dgutov
Copy link
Owner

dgutov commented Jan 12, 2015

I dunno, maybe add or highlight stronger the border around it?

An alternative approach would be to tone down all surrounding text (for instance, remove diff colors from it), but C-x v = is also used when I want to see the diff for the whole buffer, and in that case it would be an inconvenience.

@katspaugh
Copy link

Such a pity this PR wasn't merged. I also miss this feature from git-gutter.

@dgutov
Copy link
Owner

dgutov commented Sep 28, 2015

There's no merging when the submitter drops out of the discussion.

@katspaugh Why, in your opinion, C-x v = is not enough?

@katspaugh
Copy link

@dgutov I tried C-x v = and it does the job quite well. When I said I missed this feature from git-gutter I actually meant git-gutter:revert-hunk. The equivalent command diff-hl-revert-hunk doesn't highlight the current hook as good as C-x v = does. And then in C-x v = you have to press C-c C-a and then confirm the undo, while with the revert command you just confirm.

As I said C-x v = does work well for me. Thanks for the great package!

@dgutov
Copy link
Owner

dgutov commented Sep 29, 2015

diff-hl-revert-hunk doesn't highlight the current hunk as good as C-x v = does.

But neither of them highlights the hunk. The difference is that diff-hl-revert-hunk shows a hollowed out cursor in the diff buffer (which is a bit harder to notice), because the active cursor is displayed in the prompt. Right?

On the other hand, diff-hl-revert-hunk shows a more focused hunk (diff is cut at both sides of the current piece of changes). These cuts emphasize it rather well, IME.

@katspaugh
Copy link

Maybe I'm using a different version (just installed it from Melpa) or an unsupported color-scheme, but here are the screenshots.

C-x v = highlights the hunk with brighter colors:
screen shot 2015-09-29 at 3 27 09 pm

While diff-hl-revert-hunk is all the same color and I don't see any cut-offs:
screen shot 2015-09-29 at 3 27 30 pm

Edit: Oh, I see what you mean by cuts now. They do help a little.

@dgutov
Copy link
Owner

dgutov commented Sep 29, 2015

Thanks for the screenshots. It's actually the result of (awesome but unrelated) diff-auto-refine-mode.

Due to cutting, diff-hl-revert-hunk ended up having a different hunk refined (the one above; in your example it has no changes, so it's not visible). Should be fixed now.

@dgutov dgutov closed this in 4da5eff Sep 29, 2015
@katspaugh
Copy link

Super, thanks!

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.

None yet

3 participants