Skip to content

fix(jump): jump sometimes highlights after jumping has stopped#2319

Open
abeldekat wants to merge 1 commit intonvim-mini:mainfrom
abeldekat:jump_fix_bufleave_highlighting
Open

fix(jump): jump sometimes highlights after jumping has stopped#2319
abeldekat wants to merge 1 commit intonvim-mini:mainfrom
abeldekat:jump_fix_bufleave_highlighting

Conversation

@abeldekat
Copy link
Member

Details:

  • As a side-effect of the jump, a function is scheduled that will trigger a BufLeave event

  • After the jump, a function is scheduled immediately that will run H.highlight(0 delay.highlight)

On BufLeave, MiniJump.stop_jumping is called.
That will stop H.timers.highlight. However, the timer already scheduled the function.
Thus, H.highlight runs and applies the highlighting, although state.jumping is false.

This PR adds an extra early return to H.highlight

Resolve #2318

Details:

- As a side-effect of the jump, a function is scheduled that will
trigger a `BufLeave` event

- After the jump, a function is scheduled immediately that will run
`H.highlight`(0 delay.highlight)

On `BufLeave`, `MiniJump.stop_jumping` is called.
That will stop `H.timers.highlight`. However, the timer already
scheduled the function.
Thus, `H.highlight` runs and applies the highlighting, although
`state.jumping` is false.

This PR adds an extra early return to `H.highlight`

Resolve nvim-mini#2318
@abeldekat abeldekat requested a review from echasnovski March 18, 2026 20:30
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.

Jump sometimes highlights after jumping has been stopped

1 participant