Skip to content

refacto: buffer management, setup fixes, autocmd fixes #967

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

Merged
merged 8 commits into from
Feb 14, 2022

Conversation

kyazdani42
Copy link
Member

@kyazdani42 kyazdani42 commented Feb 12, 2022

Buffer management rewritten to be completely wiped out when closing the view.
Buffer is properly intanciated when needed.
Started to make a proper api for the view, to avoid mutating the internals from the outside (and thus leaking abstractions to the callers).

The autocmds have been a bit cleaned up, less indirections.
Renamed update_to_buf_dir to hijack_directories wich makes more sense.
Sessions with a tree buffer will open with the tree (without the state saved).
Also added ability to open with a path like :NvimTreeOpen /some/dir.
Renamed view.win_open to view.is_visible (BREAKING).
Doesn't load the directory on setup when not needed, which should improve startuptime.

Fixes #601
Fixes #488
Fixes #965
Fixes #238 (possible to setup open_on_setup to false and hijack_directories with auto open and enable to true will do this behavior)
Fixes #502
Fixes #193
Fixes #592

And maybe even more issues could be closed.
Please people tagged in these issue, try this PR and confirm it works well.

Buffer management rewritten to be completely wiped out when closing the
view. Buffer is properly intanciated when needed.
The setup autocmd have been a bit cleaned up, less indirections.
Renamed update_to_buf_dir to hijack_directories wich makes more sense.
Sessions with a tree buffer will open with the tree (without the state
saved).
Also added ability to open with a path like `:NvimTreeOpen /some/dir`.
Renamed view.win_open to view.is_visible.
Started to make a proper api for the view, to avoid mutating the
internals from the outside (and thus leaking abstractions to the
callers).
Allows not initializing nvim-tree at all during setup which should make
startup time better for people not using the open_on_setup or not
opening on directory.
also run find_file when preventing buffer override
@kyazdani42 kyazdani42 force-pushed the refacto/rewrite-buffer-management branch from 870ac07 to 48818d5 Compare February 13, 2022 12:45
@tobiassen
Copy link

tobiassen commented Feb 13, 2022

Just tested this branch, at least the intro screen (#193) works as expected, thanks for fixing so quickly!

@folliehiyuki
Copy link
Contributor

Can confirm that the error on #965 doesn't happen anymore. Thanks for the hard work!

@kyazdani42
Copy link
Member Author

merging this then, there might new issues coming up, will see :) The codebase will soon be in a state where testing might become a reality 😄

@kyazdani42 kyazdani42 merged commit 6da7467 into master Feb 14, 2022
@kyazdani42 kyazdani42 deleted the refacto/rewrite-buffer-management branch February 14, 2022 18:16
@rockyzhang24
Copy link

Errors occur after this merge.

image

@tobiassen
Copy link

Same here, every time I open a file this error occurs.
Did anything change on this refacto/rewrite-buffer-management branch after I tested yesterday? did not have this issue then.

@tobiassen
Copy link

reinstalled plugin, not seeing the errors anymore.

@kyazdani42
Copy link
Member Author

not sure, but i forgot to guard the diagnostic code against the tree not being initialized (which can happen). I just pushed a fix this morning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment