Azad
13f967f8e7
chore: add type annotations and resolve LSP warnings ( #2555 )
...
* chore: add type annotations to (almost) all functions
* stylua
* Add classes for symlink nodes
* Replace deprecated `@vararg`
* Move node classes to `node` module
* Fix `Symlink*` classes
* add vim and libuv runtime for luals, qualify libuv types
* add scripts/luals-check, not quite ready for CI
* additional nil checks for git/init.lua and git/runner.lua
* additional nil checks for nvim-tree.lua
* wrap vim.cmd-as-a-function calls inside functions
* vim.tbl_filter predicate returns booleans
* Revert "add scripts/luals-check, not quite ready for CI"
This reverts commit c70229cad9 .
* Add `MinimalNode` class in `marks` module
* Fix various LSP warnings
* stylua
* Fix `Explorer` class, update related annotations and add necessary checks
* Add missing annotations to `live-filter`
* Add temporary aliases for `uv.*` types
* Resolve remaining LSP warnings
* Revert changes not related to internal types
* Minor adjustments
* Update doc comments style
* Minor adjustments (pt. 2)
---------
Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-12-09 11:34:35 +11:00
Danie-1
00741206c2
fix: expand and collapse whole folder groups ( #2380 )
...
* fix: expand and collapse whole folder groups
* refactor: rename some usages of `next`
---------
Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-08-26 14:44:38 +10:00
Mohamed Arish
920868dba1
fix( #2370 ): Better "y/N" prompts ( #2377 )
...
* Changed the default y/n prompt to default to N in most cases(all delete cases) and made it so that the copy paste same name conflict defaults to R(ename)
* Removed all No conditions as they are not used and not needed
* Made item_short into lowercase and also fixed prompts in dressing.nvim and telescope-select.nvim
* Fixed the exception which occurs on pressing esc in the prompt and also made rename to be blank or r.*/R.*
2023-08-20 17:34:14 +10:00
Alexander Courtis
904f95cd9d
fix: prompt uses first character of response - allow "yy" ( #2357 )
2023-08-06 13:26:10 +10:00
xundaoxd
0042886db0
select yes default when select_prompts = false in lib.prompt ( #2337 )
...
Co-authored-by: yinchaogao <yinchaogao@deeproute.ai>
Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-08-06 11:14:14 +10:00
Alexander Courtis
b1e074d2b5
feat: add winid parameter for api.tree.open, toggle, find_file ( #2213 )
...
* feat: add winid parameter for api.tree.open, toggle, find_file
* feat: add winid parameter for api.tree.open, toggle, find_file
2023-05-21 17:37:22 +10:00
Zhanibek Adilbekov
d8b154c5f0
fix( #2154 ): find_file doesn't work when group_empty option is enabled ( #2100 )
...
Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-04-29 17:03:20 +10:00
Alexander Courtis
0a144ba50a
fix( #2109 ): floating help window ( #2120 )
...
* fix(#2109 ): floating help window
* fix(#2109 ): floating help window
* fix(#2109 ): floating help window
* fix(#2109 ): floating help window
* fix(#2109 ): floating help window
* fix(#2109 ): floating help window
* fix(#2109 ): floating help window
* fix(#2109 ): floating help window
* help float no border
Co-authored-by: gegoune <69750637+gegoune@users.noreply.github.com>
* Update lua/nvim-tree/help.lua
Co-authored-by: gegoune <69750637+gegoune@users.noreply.github.com>
* Update lua/nvim-tree/help.lua
Co-authored-by: gegoune <69750637+gegoune@users.noreply.github.com>
* Update lua/nvim-tree/help.lua
Co-authored-by: gegoune <69750637+gegoune@users.noreply.github.com>
* Update lua/nvim-tree/help.lua
Co-authored-by: gegoune <69750637+gegoune@users.noreply.github.com>
* fix(#2109 ): floating help window
* fix(#2109 ): floating help window
---------
Co-authored-by: gegoune <69750637+gegoune@users.noreply.github.com>
2023-04-15 14:59:30 +10:00
Alexander Courtis
920d5c8f7e
fix( #2114 ): remove deprecated non-API from lib, events ( #2121 )
2023-04-11 12:11:38 +10:00
Alexander Courtis
fe980baa94
feat(api): api.tree.find_file feature parity with open/toggle, convert all commands to API, document commands ( #2039 )
...
* fix(#1212 ): API find file feature parity
* fix(#2011 ): API find file feature parity
* fix(#2011 ): API find file feature parity
* fix(#2011 ): API find file feature parity
* fix(#2011 ): API find file feature parity
* fix(#2011 ): API find file feature parity
* fix(#2011 ): API find file feature parity
* fix(#2011 ): API find file feature parity
2023-03-13 16:53:20 +11:00
Alexander Courtis
8b8d457e07
fix( #1993 ): always fire TreeOpen event ( #1994 )
2023-02-13 14:57:01 +11:00
Alexander Courtis
f1c2d6d372
feat(api): api.tree.open/toggle: add current_window option ( #1935 )
...
* feat(api): api.tree.open: add current_window option
* feat(api): api.tree.toggle: add current_window option
* feat(api): api.tree.toggle: add current_window option
* doc: api.tree.*
* doc: api.tree.*
2023-01-24 08:30:49 +11:00
Alexander Courtis
e38e061710
feat(api): add api.tree.get_nodes
2022-11-19 15:54:16 +11:00
Wessel Blokzijl
c49499413a
feat(tabs): add tab.sync options ( #1698 )
...
* Sync closing of nvim-tree across tabs
* chore: remove vim.* "requires"
* Sync closing of nvim-tree across tabs
* Fix api.close calls
* Fix issue from merge
* Implement changes
* Finish todos and add close_all_tabs
* silently refactor options, add doc
* fix vinegar example
* Refactor close to work with tabid
* Close nvim tree if last buffer
* close and abandon all tabs on subsequent setup calls
Co-authored-by: Alexander Courtis <alex@courtis.org>
2022-11-19 13:57:45 +11:00
Alexander Courtis
8cc369695b
fix: replace vim.* "requires" with explicit calls to vim functions ( #1701 )
2022-11-06 10:37:33 +11:00
Alexander Courtis
ac8d259bad
fix(prompt): add select_prompts to suit UI decorator plugins such as dressing and telescope
2022-09-22 13:23:49 +10:00
Kiyan
831f1158c3
refactor(actions): move actions into semantic modules ( #1410 )
2022-07-10 09:47:52 +02:00
kiyan
28c4bb01f6
fix: close view before hijacking current window
2022-07-04 10:17:06 +02:00
kiyan
5e900c2f29
refacto: tree explorer root should be absolute_path not cwd
2022-05-29 11:40:06 +02:00
Alexander Courtis
3ba383d591
chore/remove globals ( #1279 )
...
* remove renderer globals: nvim_tree_add_trailing nvim_tree_highlight_opened_files nvim_tree_root_folder_modifier nvim_tree_special_files
* remove renderer globals: nvim_tree_icon_padding
* remove renderer globals: nvim_tree_symlink_arrow
* remove renderer globals: nvim_tree_show_icons, nvim_tree_show_icons
* remove renderer globals: nvim_tree_git_hl
* remove renderer globals: nvim_tree_group_empty
* remove renderer globals: respect_buf_cwd
* remove renderer globals: nvim_tree_create_in_closed_folder
* remove globals: consistency in legacy checks
* remove renderer globals: nvim_tree_special_files
* renderer.icons.symbols -> glyphs
2022-05-28 11:08:40 +10:00
Kiyan
6343813a35
feat(live-filter): add ability to live filter out nodes in the tree ( #1056 )
2022-05-17 10:03:49 +02:00
Alexander Courtis
82ec79aac5
#1216 show diagnostic signs on all folders ( #1244 )
2022-05-10 11:22:11 +10:00
Kiyan
db873b340d
chore(diagnostics): move updates to renderer ( #1218 )
...
should address #1216
2022-05-07 11:14:32 +02:00
Alexander Courtis
0f0f858348
#1157 update lsp diagnostics when the tree state is changed ( #1174 )
2022-04-18 15:46:42 +02:00
kiyan
94ce41ce96
fix: lib.get_node_at_cursor offset when root folder is /
...
fixes #1153
2022-04-11 09:45:39 +02:00
Mauricio Poppe
8340753e26
Preserve cursor position across redraws ( #1132 )
2022-04-03 14:23:07 +02:00
kiyan
1831417f05
refacto: add get_nodes_starting_line core util
2022-03-26 14:46:44 +01:00
kiyan
471afc13fe
refacto: abstract TreeExplorer in core.lua
2022-03-09 22:01:54 +01:00
Kiyan
0816064a8b
chore: add stylua to format the codebase, and run on CI ( #1055 )
2022-03-06 17:33:30 +01:00
Alexander Courtis
ce3604d33c
#972 bug: prev_git_item with hijack_cursor selects icon instead of previous file ( #1025 )
2022-02-28 21:31:23 +01:00
kiyan
f977e5c05a
refacto: make git module interface to wait for job to finish
...
allows simplify the explore/reload/find/initialization by making the
whole code synchronous. No more callback needed.
2022-02-21 19:12:16 +01:00
kiyan
58b81ed9e6
refacto: remove rendering from lib.init
2022-02-20 23:01:25 +01:00
kiyan
e1c6a575c0
fix: wait for init to finish before finding file
...
fixes #1003
2022-02-20 22:20:23 +01:00
kiyan
83f398ee8f
fix: opening tree
...
opening the tree checks bufname is directory properly and do not render
before initializing when tree is nil.
2022-02-20 21:48:46 +01:00
kiyan
209bc3d2ef
fix: properly manage directory and unnamed buffers hijacking
2022-02-20 20:04:05 +01:00
Alexander Courtis
a1937ca079
1007 do not wipe modified buffers when hijack unnamed buffer when opening ( #1009 )
2022-02-20 10:41:47 +01:00
kiyan
e8ecfbf95f
fix: do not hijack unnamed buffer when opening manually
2022-02-17 13:23:08 +01:00
kiyan
f7a6ddb720
fix: do not hijack dashboard window during open
...
fixes #983
2022-02-16 21:10:28 +01:00
kiyan
76d4ed5d77
feat: add ability to not hijack the unnamed buffer
2022-02-16 21:00:28 +01:00
Kiyan
6da7467944
refacto: buffer management, setup fixes, autocmd fixes ( #967 )
2022-02-14 19:16:45 +01:00
kiyan
0f7da146bf
chore: add guards to prepare setup refactoring
2022-02-11 11:06:11 +01:00
eightpigs
c226eaf0bf
fix: bufnr is nil when incomplete setup. ( #955 )
...
fixes #947
2022-02-10 19:07:59 +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
47ccc2913f
refacto: move toggle help and filter toggles into actions
...
also fix explorer to properly remove element on update when filter is
applied
2022-02-07 20:43:24 +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
8a6c7bae3a
refacto: move code ton explorer and simplify some internal apis
2022-02-06 17:58:24 +01:00
kiyan
8b27fd4e61
refacto: move target_winid outside of tree
2022-02-06 17:03:23 +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
Munif Tanjim
7b64075bdf
fix: close_node ( #931 )
2022-02-05 23:09:50 +01:00