Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Back action in FzfxFileExplorer does not restore cursor position #508

Open
savchenko opened this issue Dec 22, 2023 · 1 comment
Open

Back action in FzfxFileExplorer does not restore cursor position #508

savchenko opened this issue Dec 22, 2023 · 1 comment

Comments

@savchenko
Copy link
Contributor

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.

@linrongbin16
Copy link
Owner

linrongbin16 commented Dec 25, 2023

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).

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

No branches or pull requests

2 participants