Open TinusgragLin opened 1 year ago
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
I was still able to reproduce this just a few minutes ago with the latest version and neovim 0.10.0, following the steps mentioned above.
Still, the problem seems to be specific to auto-jump mode as using lua require('flash').jump {}
and pressing the select key manually works as expected.
I did a quick debugging without going too deep into the code base, the cause seems to be that before we call self:jump()
here:
https://github.com/folke/flash.nvim/blob/ec0bf2842189f65f60fd40bf3557cac1029cc932/lua/flash/state.lua#L399-L402
self.target
was still nil
because it seems to be only updated with a target within the current window. Combining this with the fact that self:jump()
would take the control flow to the fourth branch here:
https://github.com/folke/flash.nvim/blob/ec0bf2842189f65f60fd40bf3557cac1029cc932/lua/flash/state.lua#L142-L152
the code would behave as if we did not find any match anywhere.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Still reproducible with the setup given above, although I would say the problem does not bother me too often.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Since @folke is busy with his other projects, and this is a relatively minor issue, I will just post my own workaround here and let the bot does its job if this goes inactive for another month:
-- autojump if only one result
if #self.results == 1 and self.opts.jump.autojump then
-- self:jump()
++ self:jump(self.results[1])
return
end
return true
Did you check docs and existing issues?
Neovim version (nvim -v)
0.10.0
Operating system/version
Linux
Describe the bug
When autojump is set and the jump is cross-window, the jump is not carried out.
Steps To Reproduce
Simply
lua require('flash').jump { jump = { autojump = true } }
and type 'c'. (or the other way around)Expected Behavior
After the step 2, the cursor should be directly moved to the character 'c' in the other window. But instead no movement is carried out.
Repro