Skip to content

Comments

Some polish for diff-hl-show-hunk#239

Merged
dgutov merged 4 commits intomasterfrom
show-hunk-updates
May 19, 2025
Merged

Some polish for diff-hl-show-hunk#239
dgutov merged 4 commits intomasterfrom
show-hunk-updates

Conversation

@dgutov
Copy link
Owner

@dgutov dgutov commented May 10, 2025

Hi @alvarogonzalezsotillo, please check this out if you have the time and you're still using the features.

I made a pass at the code to make the rendering backends more similar in behavior (wrt positioning), and less "blinky" with the posframe backend.

It removes a couple of workarounds which mention Gnome but I couldn't reproduce (with version 46 anyway) - to fix the side-effects, which both had. Would be great if you could test and see if those were still necessary.

dgutov added 4 commits May 10, 2025 04:44
* Move posframe one line up, so its popup starts right after the hunk.
* Add the same exception for `deletion` that inline-popup has.
* Use `before-string` and `cursor` in inline popup, for correct positioning
of it with `deletion` hunks as well. And of cursor, which it overlaps.
Couldn't reproduce the problem, and this code caused the original frame to be
selected after several calls to diff-hl-show-hunk-next, for example (because
after the first one diff-hl-show-hunk--frame becomes non-nil, so we got a timer
which goes back to the original frame).
* Don't call diff-hl-show-hunk--posframe-hide when (re)showing hunk, let the
rendering code take care of that.

* Move point to beginning of indentation in
diff-hl-show-hunk--goto-hunk-overlay.  Less chance to trigger show-paren-mode
highlights, and a more logical position anyway.

* Don't select-frame-set-input-focus at the end of diff-hl-show-hunk-posframe.
Removes the cursor blink between the frames, while keys and button pressed still
get processed the same.
The avoids the big blank space when the hunk is short.
@dgutov
Copy link
Owner Author

dgutov commented May 14, 2025

Hi @wyuenho could you test out these changes as well? As I see you use the show-hunk feature.

This should help me with progressing in the nearby PRs too.

@alvarogonzalezsotillo
Copy link
Contributor

Hi @dgutov ,

Im currently away of my computer, so i can not check these changres

I will check them next week, but they look good to me. Feel free to merge them if you need it.

@wyuenho
Copy link
Contributor

wyuenho commented May 17, 2025

I've manually applied the patch to #228 with some small adjustments due to naming changes, it works well. However, I don't use show-hunk-posframe, so I only tested show-hunk-inline. Based on what I see, works well.

@dgutov
Copy link
Owner Author

dgutov commented May 19, 2025

Thank you both, merging.

@dgutov dgutov merged commit d3b4a40 into master May 19, 2025
6 checks passed
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