Commit Graph

154 Commits

Author SHA1 Message Date
kiyan
7a19c3e747 fix: reschedule on_enter and setup autocmd
Wait for nvim to finish before checking buftypes.
Fixes #944
Fixes #942
2022-02-08 21:42:14 +01:00
kiyan
d8bf1adcdc fix: update neovim path when nvim is opened with nvim dir
fixes #945
2022-02-08 21:02:22 +01:00
kiyan
f183c7f311 chore: move last autocmds from view to entrypoint 2022-02-08 20:56:02 +01:00
kiyan
ea92e7bf7c refacto: set tree explorer in the global state
also remove the redraw method and use renderer.draw immediately
2022-02-07 22:07:08 +01:00
kiyan
d1ff893b32 fix: disable update_to_buf_dir when netrw is not disabled
fixes #718
2022-02-07 09:19:44 +01:00
kiyan
9215533382 fix: defer to 100ms empty buffer removal 2022-02-06 21:29:24 +01:00
kiyan
f173d28003 fix: remove schedule for on_enter 2022-02-06 20:09:59 +01:00
kiyan
923e034668 refacto: sort actions declaration, remove close from main file
fixes #921
- use view.close instead of nvim-tree.close
- put preview code inside the execution logic on keypress
- sort keys in keypress_funcs
- remove empty buffer when hijacking window
2022-02-06 19:25:23 +01:00
kiyan
0573c68fd7 fix: check tree exists before hijacking buffer dir
fixes #934
2022-02-06 18:54:57 +01:00
kiyan
8a6c7bae3a refacto: move code ton explorer and simplify some internal apis 2022-02-06 17:58:24 +01:00
kiyan
7829d7c7cf refacto: move set_index_and_redraw -> actions.find-file.fn 2022-02-06 16:32:44 +01:00
kiyan
23c95a674f chore: move refresh/reloaders into actions.reloaders 2022-02-06 16:24:14 +01:00
kiyan
1fe29f8eef chore: move g:nvim_tree_quit_on_open into open_file action config 2022-02-05 18:42:08 +01:00
kiyan
f74dd24c58 refacto: move some code into actions
(non breaking, old assignments link to new assignments)
- move lib.collapse-all into actions/collapse-all
- move lib.dir-up into actions/dir-up
- move lib.change-dir into actions/change-dir
- use setup option for change-dir global (and use the old option for
  setup)
2022-02-05 17:42:40 +01:00
kiyan
96650c801f BREAKING: rename populate -> explorer
- rename populate.lua to explorer.lua
- rename refresh_entries to refresh in explorer.lua
- rename populate to explore in explorer.lua
2022-02-05 16:56:42 +01:00
kiyan
14461373e0 refacto: move all keybind logic to actions/init 2022-01-21 12:21:23 +01:00
kiyan
2b2bf0721d refacto: move keypress to actions/init 2022-01-21 12:07:54 +01:00
kiyan
4d22f9487d refacto: move open-file to actions
move all logic to open file from lib to actions/open-file
2022-01-21 12:01:17 +01:00
kiyan
dc5eae6512 refacto: remove fs folder and move code to actions
- remove file moved to actions.remove-file.lua
- rename file moved to actions.rename-file.lua
2022-01-21 11:54:35 +01:00
kiyan
45671e94be refacto: extract create_file into actions module 2022-01-21 11:45:52 +01:00
Wen Jun
2e25ba5958 feat(preview): enhanced preview to toggle folder (#907)
Co-authored-by: MusiCool <wenjun.super@bytedance.com>
2022-01-21 11:29:17 +01:00
kiyan
1248bcec86 refacto: create actions folder and move some code to it
- move trash.lua into actions
- move system-open from root file to actions
- move copypasta code from fs to actions
- add file_exists in utils
- add rename_loaded_buffers in utils (might need to move that in the
  future).
2022-01-21 11:25:49 +01:00
Carlos Coves Prieto
fa8bb09de4 custom node keymaps (#855) 2022-01-21 11:03:49 +01:00
Michael
9e2f6b6f25 feat: add exclude filter list (#878) 2022-01-21 10:48:58 +01:00
kiyan
0a2f6b0b6b fix(dirchange): do not change dir when switching windows
- Avoid changing dir when switching windows, except when
changing tabpage.
- Load nvim-tree with passed directory when opening with `nvim DIR`

Fixes #858 #720
2021-12-24 14:50:20 +01:00
Reviakin Evgeny
239f2d6fea show diagnostics on parent dirs if nodes with diagnostics are not visible (#862) 2021-12-24 12:47:23 +01:00
shikun
65b8b19c8b fix: idx passed to api.nvim_win_set_cursor may be -1 (#821)
This causes out of range error on CursorMoved event is fired if hijack_cursor option is set to true.
Although I don't know why it fixes the issue, but it has been working fine for me.

Potentially fix #783, #803
2021-12-05 22:27:20 +01:00
Raafat Turki
e842f08884 feat: add trashing (#749) 2021-11-28 15:26:24 +01:00
Kiyan
6662b60a2b feat/chore: rewrite git with job and some other fixes (#743)
* feat/chore: rewrite git with job and some other fixes

* fix: fs clear window, rename echo_warning -> warn

also fix renaming and add an event blocker to avoid running many events
at the same time
2021-11-27 16:02:54 +01:00
kiyan
b853e1083c Revert "fix: remove buffer when its empty when hijacking"
This reverts commit 0babcb4f2c.
2021-11-27 14:08:46 +01:00
kiyan
0babcb4f2c fix: remove buffer when its empty when hijacking 2021-11-27 13:54:17 +01:00
kiyan
a6c1d45dd6 chore: refacto populate filtering
move `nvim_tree_ignore` and `nvim_tree_hide_dotfiles` to setup
2021-10-30 12:25:09 +02:00
kiyan
f92b7e7627 fix: hijack current dir when doing :edit .
fixes #756
2021-10-30 11:35:44 +02:00
M.A
fd3969ec98 feat: add hide_root_folder (#728) 2021-10-24 16:48:57 +02:00
figsoda
514619897f feat: add NvimTreeFindFileToggle (#735) 2021-10-23 15:35:28 +02:00
kiyan
fda5b82bdf fix: lsp diagnostics user autocmd setup 2021-10-10 17:02:34 +02:00
kiyan
94b8604e86 chore: complete the diagnostic setup migration
Colors groups and icons are now in diagnostics.lua. They are defined on
setup which allows an easier configuration and better documentation.
`lsp_diagnostics` boolean value has been moved into a table `diagnostics`
with `enable` and `icons` as properties.
2021-10-10 11:42:22 +02:00
kiyan
7ca37f824b fix: run find_file on DirChanged if update_focused_file is enabled
fixes #690
2021-10-05 17:51:48 +02:00
kiyan
fb32f35d7f chore: allow configuring height
also fixes window management for top and bottom tree side
2021-10-03 14:13:10 +02:00
kiyan
6416ea3562 chore: add old option detection in plugin/nvim-tree.lua 2021-10-02 14:05:50 +02:00
kiyan
137628acb6 chore: update_to_buf_dir allow auto_open configuration
also improve the documentation with doc references
2021-10-02 13:53:51 +02:00
kiyan
1fe211eda0 fix: update to buf directory implementation 2021-10-01 14:04:07 +02:00
kiyan
9282944078 fix: add option update_to_buf_dir in setup
avoid hijacking the tree for use case of users using vim-dirvish
2021-09-30 12:43:20 +02:00
kiyan
e2e7720caa fix: properly hijack netrw, don't always open on dir
- fix hijack netrw logic
- do not open on directory if open_on_setup is false, but do if the
  window is open.
2021-09-30 12:26:55 +02:00
Sávio Carlos Martins Costa
12e61dd057 fix 'system_open' keypress callback (#655) 2021-09-29 21:16:10 +02:00
kiyan
3633e728e0 chore: refacto view setup and simplify the code 2021-09-26 14:55:49 +02:00
kiyan
591f5d436d fix: remove buffer when replacing window 2021-09-26 12:42:13 +02:00
kiyan
db547dcd41 fix: defer the options check
the new setup refactoring might have some issues when users require the
tree before setting up global options, which might result in a startup
check not detecting those out of date options.
2021-09-26 12:14:20 +02:00
kiyan
1edebb7894 chore: lsp diagnostics setup 2021-09-26 11:56:44 +02:00
kiyan
0ca87178b6 fix: open view on NvimTreeFindFile 2021-09-26 11:36:57 +02:00