Commit Graph

34 Commits

Author SHA1 Message Date
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
Alexander Courtis
53b0bcaada
chore: stylua column width 120 -> 140 (#2448)
* chore: stylua column width 120 -> 140

* chore: stylua column width 120 -> 140, tidy

* Revert "chore: stylua column width 120 -> 140, tidy"

This reverts commit 8a0524d6bd.

* chore: stylua column width 120 -> 140, tidy watcher.lua

* chore: stylua column width 120 -> 140, tidy diagnostics.lua

* chore: stylua column width 120 -> 140, tidy git.lua

* chore: stylua column width 120 -> 140, tidy open-file.lua

* chore: stylua column width 120 -> 140, tidy system-open.lua

* chore: stylua column width 120 -> 140, tidy runner.lua
2023-10-08 11:40:58 +11:00
Alexander Courtis
4e36850811
fix(#2301): various git folder status fixes (#2373)
* fix(#2301): reloader handles grouped

* fix(#2301): explore uses correct git project for grouped

* fix(#2301): update parent status correctly across repositories

* fix(#2301): missing require
2023-08-20 12:53:41 +10:00
Alexander Courtis
6ad5c26f4d
feat(#2079): sort_by may return predefined sort (#2123)
* feat(#2079): prefactor

* feat(#2079): sort_by may return a predefined string
2023-04-15 15:53:40 +10:00
Alexander Courtis
b712b82b0c
fix(#1961): harden profiling functions (#1986) 2023-02-11 17:05:01 +11:00
Alexander Courtis
7eb33d2a6d
fix(#1831): remove instrumentation (#1969) 2023-02-04 16:57:05 +11:00
Alexander Courtis
e0166d1469
fix(#1831): remove instrumentation (#1968) 2023-02-04 16:54:36 +11:00
gegoune
3ce0a8e770
feat(git): support DA state, fix(#1822): test directory capable of watching before presenting it (#1905)
* fix(#1822): test directory capable of watching before presenting it (#1901)

* feat(git): support `DA` state

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-01-10 13:32:53 +11:00
Alexander Courtis
3c4958ab3d
fix(#1831): remove windows executable functionality due to occasional vim freeze and performance concerns (#1868)
* #1831 exploratory testing: disable file executable checks

* fix(#1831): remove windows executable functionality
2022-12-31 12:34:55 +11:00
Alexander Courtis
547db6e929 fix(#1831): remove error messages that were previously unreachable and add no value 2022-12-19 15:11:12 +11:00
Richard Li
29788cc32a
fix(git): git folder fixes and improvements (#1809)
* coding style

* outlined git.show_on_open_dirs behavior

* show some icon on opendir even if show_on_open_dir=false

and show all children's status on parent

* fixed renamed icon not showing

* sorted icons

* removed DU from deleted as file will show up in tree

* fixed update_git_status in reloaders not tested

* fixed Api.git.reload()

Tested update_git_status in reloaders.lua

* sort icon only if not git signcolumn

* fixed crashing when root dir isn't git dir

* made git.show_on_dirs doc more concise

* git_statuses -> git_status for consistency

* explorer/common.lua -> explorer/node.lua

* fixed #1784 conflict

* don't order icons

* Revert "don't order icons"

This reverts commit 23f6276ef7.
2022-12-17 17:05:33 +11:00
Alexander Courtis
89c79cb33b fix(#1831): improve fs_scandir error handling, add profiling 2022-12-17 16:59:09 +11:00
Alexander Courtis
95ed588211 fix(#549): add more profiling ~tree init 2022-12-16 12:12:06 +11:00
Alexander Courtis
c5dc80c36b
feat(view): add filters.git_clean, filters.no_buffer (#1784)
* feat(view): add filters.git_clean

* feat(view): add filters.git_clean

* feat(view): add filters.no_buffer

* feat(view): filters.no_buffer misses unloaded, handles buffer in/out

* feat(view): filters.no_buffer matches directories specifically

* feat(view): filters.no_buffer clarify targets

* feat: add placeholder filters.diagnostics_ok, refactor filters

* feat(view): remove placeholder filters.diagnostics_ok
2022-12-10 15:55:33 +11:00
Alexander Courtis
8cc369695b
fix: replace vim.* "requires" with explicit calls to vim functions (#1701) 2022-11-06 10:37:33 +11:00
kylo252
6ca6f99e76
feat(notify): add notify.threshold (#1693)
* feat: configurable notification level

add `notify.threshold` to setup opts

* feat: configurable notification level: add threshold example doc

* feat: configurable notification level: log always comes last

Co-authored-by: Alexander Courtis <alex@courtis.org>
2022-11-01 10:24:40 +11:00
kiyan
665813b9e6 fix(perf): explorer was creating new table for each new entry
augment performance on large folder by a factor of 10.
my /nix/store explorer goes from ~12sec to ~1.5sec.
2022-07-29 09:35:15 +02:00
kiyan
18447132fc feat(notify): switch all print/nvim_*write statements to utils.notify 2022-07-18 14:04:48 +02:00
kiyan
5e900c2f29 refacto: tree explorer root should be absolute_path not cwd 2022-05-29 11:40:06 +02:00
Alexander Courtis
c3b7be8d19
add .luarc.json for lua-language-server and fix a couple of nits (#1296) 2022-05-28 11:16:54 +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
f85af83f13
#1217 show git status for link targets, when no status on the link itself (#1263) 2022-05-14 09:34:53 +02:00
kiyan
95a5c2d4bc fix: add parent ref to nodes
also refactor movement go to parent
fixes #1148
2022-04-21 20:39:14 +02:00
Alexander Courtis
1bdef08cfa
#1059 protect against duplicates (#1143) 2022-04-09 14:59:38 +02:00
Kiyan
0816064a8b
chore: add stylua to format the codebase, and run on CI (#1055) 2022-03-06 17:33:30 +01:00
kiyan
76d181d480 refacto: move filters and sorters in their own modules
Also exclude filters is taken into account in git ignore
fixes #892
2022-03-06 14:14:56 +01:00
kiyan
ec7043c53f refacto: extract functions in explorer 2022-02-20 15:24:23 +01:00
kiyan
527d88d54e refacto: simplify interface of reload and explore
also make common group empty check in explorer utils
2022-02-20 15:08:36 +01:00
kiyan
e42a4337d0 fix: do not group empty at root 2022-02-07 21:16:59 +01:00
kiyan
7fec0f658b chore: simplify reloader and start fixing group nodes refresh 2022-02-06 22:59:37 +01:00
kiyan
b76602182f refacto: simplify explorer and make it a bit faster
Also fixes #933
2022-02-06 18:51:17 +01:00
kiyan
8a6c7bae3a refacto: move code ton explorer and simplify some internal apis 2022-02-06 17:58:24 +01:00
kiyan
74791bb624 refacto: split explorer module into multiple files 2022-02-06 17:01:18 +01:00