Skip to content

FEATURE: Enhancement for the set_root command #1419

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

Closed
1 task done
xvzc opened this issue Mar 30, 2024 · 1 comment
Closed
1 task done

FEATURE: Enhancement for the set_root command #1419

xvzc opened this issue Mar 30, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@xvzc
Copy link
Contributor

xvzc commented Mar 30, 2024

Did you check the docs?

  • I have read all the docs.

Is your feature request related to a problem? Please describe.

No

Describe the solution you'd like.

Hi, I've been using my custom command called "sync_root" which looks like below.

  commands = {
    sync_root = function(state)
      if state.search_pattern then
        fs.reset_search(state, false)
      end

      local node = state.tree:get_node()
      local id = node.type == "directory" and node.id or node._parent_id
      fs._navigate_internal(state, id, nil, nil, false)
    end,
  },

While the built in set_root command allows us to run it only when the neovim cursor is pointing to directories, the sync_root function above allows us to set the current directory as root regardless of the location of cursor.

So my question is, would you be interested if i make a PR that enhances the set_root commands for filesystem and buffer?

Describe alternatives you've considered.

No response

Additional Context

No response

@xvzc xvzc added the enhancement New feature or request label Mar 30, 2024
@cseickel
Copy link
Contributor

Sure, I don't see how it can hurt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants