Skip to content

Make diff-hl-timer buffer-local - #300

Merged
dgutov merged 1 commit into
dgutov:masterfrom
NicholasBHubbard:diff-hl-timer-buffer-local
Sep 9, 2026
Merged

Make diff-hl-timer buffer-local#300
dgutov merged 1 commit into
dgutov:masterfrom
NicholasBHubbard:diff-hl-timer-buffer-local

Conversation

@NicholasBHubbard

Copy link
Copy Markdown
Contributor

This PR makes diff-hl-timer buffer-local so a pending timer in one buffer does not prevent diff-hl-update-once from scheduling an update in another.

I discovered this while using (setq diff-hl-update-async t) and I noticed that newly opened buffers would not receive highlights until their first save.

I added a test that verifies that diff-hl-update-once schedules an independent timer for each buffer.

@dgutov
dgutov merged commit fbc04eb into dgutov:master Sep 9, 2026
6 checks passed
@NicholasBHubbard
NicholasBHubbard deleted the diff-hl-timer-buffer-local branch September 9, 2026 00:37
dgutov added a commit that referenced this pull request Sep 9, 2026
@dgutov

dgutov commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Hi! Thanks for this.

I've added a small follow-up which ensures that the update is only done once. Otherwise each applicable major mode in derived-mode chain invokes it (debouncing this is the reason the timer was introduced in the first place).

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.

2 participants