Skip to content

feat: Sync nvim-tree across tabs #1662

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
wants to merge 0 commits into from

Conversation

rwblokzijl
Copy link
Contributor

This PR syncs nvim tree across tabs if open_on_tab is set.

Previously:

  • On tab change this would open nvim-tree
  • When having closed nvim-tree it would still open nvim tree on tab change

Now:

  • when having closed nvim-tree it will sync this on tab change
  • if nvim-tree is closed (using :quit) this is also synced across tabs
  • if nvim-tree is the final window in a tab, the tab is closed (if this is the last tab, vim is closed)

@rwblokzijl rwblokzijl changed the title Sync nvim-tree across tabs feat: Sync nvim-tree across tabs Oct 16, 2022
@alex-courtis
Copy link
Member

  • if nvim-tree is the final window in a tab, the tab is closed (if this is the last tab, vim is closed)

This was present in the past however was removed as it is unavoidably problematic. #1005 (comment)

You may implement this functionality yourself: https://github.com/nvim-tree/nvim-tree.lua#tips--tricks

@@ -88,6 +88,7 @@ end

function M.open(cwd)
cwd = cwd ~= "" and cwd or nil
vim.g.nvim_tree_tab_open = 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not use global variables to track nvim-tree state.

Please test via something like:

  • iterate windows on tab
  • test utils.is_nvim_tree_buf

Copy link
Member

@alex-courtis alex-courtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've not tested nor fully reviewed yet.

Please:

@rwblokzijl
Copy link
Contributor Author

Closed by force push i think. See #1698

@alex-courtis
Copy link
Member

Please don't force push. Rebase or merge your branch instead.

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

Successfully merging this pull request may close these issues.

2 participants