fix(jump): jump sometimes highlights after jumping has stopped#2319
fix(jump): jump sometimes highlights after jumping has stopped#2319abeldekat wants to merge 1 commit intonvim-mini:mainfrom
Conversation
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
|
Thanks for the issue!
If that is the 'mini.files' behavior (which from 2318 it probably is), then it should be fixed on 'mini.files' side. That should not happen. But even with the change from this PR I still don't have "smart jumping" work in 'mini.files'. Which is strange and needs extra attention. |
Yes it is, on The problem is the file preview. On each change, MiniFiles emits |
Details:
As a side-effect of the jump, a function is scheduled that will trigger a
BufLeaveeventAfter the jump, a function is scheduled immediately that will run
H.highlight(0 delay.highlight)On
BufLeave,MiniJump.stop_jumpingis called.That will stop
H.timers.highlight. However, the timer already scheduled the function.Thus,
H.highlightruns and applies the highlighting, althoughstate.jumpingis false.This PR adds an extra early return to
H.highlightResolve #2318