linrongbin16/fzfx.nvim

Back action in `FzfxFileExplorer` does not restore cursor position

savchenko opened this issue · 1 comments

When moving up one level, I'd expect cursor to be positioned on the folder I have just exited.
Currently it tends to jump towards the beginning of the file listing.

looks like current engine cannot support such use case. ~ _ ~!

For now the cd and upper keys are Interactions, and engine is running follow below steps when you press cd or upper keys:

  1. running the lua script with the nvim -l xxx.lua shell command, which is binding to the fzf binary when launch the FzfxFileExplorer popup window.
  2. inside the xxx.lua lua script, send request to the nvim editor (e.g. the parent process of the xxx.lua), to ask nvim editor to do the interactions, e.g. the cd and upper lua function hooks.
  3. refresh provider/previewer, e.g. refresh the searching results and preview new results.

To restore the cursor position, it need to execute the pos fzf actions (see: https://man.archlinux.org/man/fzf.1.en#AVAILABLE_ACTIONS: , the pos actions) after refreshing searching results.

Looks like we have add 1 more hooks to emit the pos fzf actions after refresh search results (also maintain the engine architecture clean).