fix(jump): jump sometimes highlights after jumping has stopped#2319
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 |
|
The original 'mini.files' issue should be soon resolved, but I think checking |
Great! |
Yeah, that is a good idea. Should be part of the Through trial and error in other modules, there is a more or less established in 'mini.nvim' approach for creating an autocommand for interactive feature that should only be executed in the current buffer: |
|
Super! |
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