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

QUESTION: Is there a way to keep the cursor in its current position when opening a new window? #1579

Open
zebra-f opened this issue Oct 12, 2024 · 0 comments

Comments

@zebra-f
Copy link

zebra-f commented Oct 12, 2024

Normally cursor jumps to a newly opened window, but I would like it to stay in its current location (i.e Neotree).
Can't find anything in the docs.
I've also tried this workaround

...
        event_handlers = {
          {
            event = "file_open_requested",
            handler = function()
              require("neo-tree.command").execute({ action = "close" })
              vim.cmd("Neotree")
            end
          },
        }
...

but it doesn't work as expected. It opens the tree, but the cursor stays where it was, even though, this:

...
            handler = function()
              require("neo-tree.command").execute({ action = "close" })
              -- vim.cmd("Neotree")
            end
...

+ :Neotree would work.

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

1 participant