Commit Graph

68 Commits

Author SHA1 Message Date
Alexander Courtis
74959750f7
feat: automated migration from view.mappings.list to on_attach, see https://github.com/nvim-tree/nvim-tree.lua/wiki/Migrating-To-on_attach (#1579)
* chore(mappings): migrate legacy mappings under the hood

* chore(mappings): POC for help and :help on_attach keymaps

* chore(mappings): POC for help and :help on_attach keymaps

* chore(mappings): add desc to all mappings, show in help, reformat help

* chore(mappings): add desc to all mappings

* chore(mappings): add desc to all mappings

* chore(mappings): escape help keys

* chore(mappings): migrate legacy mappings under the hood: map keymap to legacy mappings

* chore(mappings): migrate legacy mappings under the hood: remove dispatch

* Revert "chore(mappings): migrate legacy mappings under the hood: remove dispatch"

This reverts commit f6f439ba59.

* chore(mappings): migrate legacy mappings under the hood: pass node to action_cb

* chore(mappings): migrate legacy mappings under the hood: remove dispatch

* chore(mappings): migrate legacy mappings under the hood: replace mappigns with keymaps in help

* chore(mappings): generate on_attach from user's legacy mappings

* chore(mappings): generate on_attach from user's legacy mappings

* chore(mappings): merge cleanup

* chore(mappings): use default mappings when on_attach not present, log legacy migration

* on_attach is default or user only, legacy and generation includes defaults (#1777)

* chore(mappings): remove mappings via vim.keymap.del instead of filtering mappings, to allow for multiple ways of specifying a key

* doc: specify that the terminal emulator must be configured to use the patched font

* feat(renderer): add NvimTreeOpenedFolderIcon NvimTreeClosedFolderIcon (#1768)

* feat: Add highlight group for opened folder

closes #1674

* docs: Add NvimTreeOpenedFolderIcon default

* feat: Add NvimTreeClosedFolderIcon highlight group

Defaults to NvimTreeFolderIcon

* feat: add diagnostics.show_on_open_dirs git.show_on_open_dirs (#1778)

* feat(diagnostics): only show diagnostic on closed folder

* feat(git): only show git icon on closed folder

* docs: Update feature_request.md (#1788)

* Update feature_request.md

Closes #1654

* Update feature_request.md

Co-authored-by: Alexander Courtis <alex@courtis.org>

* 1786 git next prev land on dirs (#1787)

* Filtered dir with git status that are open when show_on_open_dir is false

* refactored for single source of truth of existence of git status on a node

Putting `has_git_status()` in `explorer.common` because that's where node.status is constructed
Or at least I think that's where it's constructed

* 1786 semantic nit

Co-authored-by: Alexander Courtis <alex@courtis.org>

* fix(git): git rename not showing up for the renamed file (#1783)

* fixed git rename not showing up for the renamed file

* considered " -> " being a part of the filename

Fixed -> pattern to escape -
Fixed "\"" and "\\" in filename

* using string.find(, , true) to match plain ->

* Using -z and removed unnecessary logic

* feat(view): always enable cursorline, users may change this behaviour via Event.TreeOpen (#1814)

* Update view.lua

* set cursorline to true

* feat(event): dispatch Event.NodeRenamed on cut-paste (#1817)

* 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

* doc: consolidate and clarify :help examples

* doc: format help

* feat: paste and create always target closed folder, remove create_in_closed_folder (#1802)

* Fix default for file creation in closed directories

* Make paste in closed directories consistent with create

* doc: clarify create_in_closed_folder

* Remove create_in_closed_folder option

* doc: clarify create_in_closed_folder removal message (whoops)

Co-authored-by: Alexander Courtis <alex@courtis.org>

* on_attach is user's or default, nothing else; legacy generated on_attach includes defaults

Co-authored-by: baahrens <bahrens@compeon.de>
Co-authored-by: Richard Li <38484873+chomosuke@users.noreply.github.com>
Co-authored-by: gegoune <69750637+gegoune@users.noreply.github.com>
Co-authored-by: rishabhjain9191 <rishabh.jain9191@gmail.com>
Co-authored-by: Anton <14187674+antosha417@users.noreply.github.com>
Co-authored-by: Eric Haynes <ehaynes99@gmail.com>

* on_attach_default hardcoded

* format default_on_attach

* source default on_attach directly

* remove human mappings help

* simplified on_attach generation

* simplified on_attach generation

* generate default on_attach

* generate default on_attach

* split out keymap_legacy

* add recently introduced mappings

* legacy api.config.mappings.active and default

* legacy api.config.mappings.active and default

* on_attach help and readme

* legacy generate handles action = ""

* legacy generate handles action =

* legacy generate gives defaults when no user mappings

* legacy generate handles action = ""

* legacy generate api handles overrides

* legacy generate handles subsequent setup, on_attach retains deep copies of legacy config

* add wiki link to generated on_attach

* add opts helper function for on_attach, prefixing 'nvim-tree: '

---------

Co-authored-by: kiyan <yazdani.kiyan@protonmail.com>
Co-authored-by: baahrens <bahrens@compeon.de>
Co-authored-by: Richard Li <38484873+chomosuke@users.noreply.github.com>
Co-authored-by: gegoune <69750637+gegoune@users.noreply.github.com>
Co-authored-by: rishabhjain9191 <rishabh.jain9191@gmail.com>
Co-authored-by: Anton <14187674+antosha417@users.noreply.github.com>
Co-authored-by: Eric Haynes <ehaynes99@gmail.com>
2023-02-27 14:19:50 +11:00
Kai Ting
66c15afd13
fix(#2004): relative path detection handles regex magic (#2005)
* fix(#2004): Change path_relative to use string find and substring to avoid using regex.

- This removed the original gsub with unintentional captures in path_to_matching_str
- The original regex based code captures create a limit where input path cannot
  have more than 32 special charactors ( `.`  , `_` or `-`)

* style nit

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-02-20 10:15:42 +11:00
Alexander Courtis
e0166d1469
fix(#1831): remove instrumentation (#1968) 2023-02-04 16:54:36 +11:00
Alexander Courtis
e322fbb80b chore: remove diagnostic suppressions after tidying nits 2023-01-01 13:27:05 +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
89c79cb33b fix(#1831): improve fs_scandir error handling, add profiling 2022-12-17 16:59:09 +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
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
Alexander Courtis
48992fd3e8
fix(#1639): ensure tree autocommands match filetype as well as name (#1640)
* fix(#1629): nvim start with file named *NvimTree* opens tree instead of buffer

* Revert "fix(#1629): nvim start with file named *NvimTree* opens tree instead of buffer"

This reverts commit e7136078f7.

* fix(#1629): nvim start with file named *NvimTree* treats file as tree

* fix(#1629): nvim start with file named *NvimTree* treats file as tree

* fix(#1639): ensure tree autocommands match filetype as well as name

* fix(#1639): fix bad merge

* fix(#1639): ensure tree autocommands match filetype as well as name
2022-10-17 12:31:41 +11:00
Alexander Courtis
55aa0062b9 fix(#1270): ensure explorer exists at startup before propagating FS changes 2022-10-15 12:44:59 +11:00
Alexander Courtis
c66cbdfc25
fix(#1629): nvim start with file named *NvimTree* opens tree instead of buffer (#1634)
* fix(#1629): nvim start with file named *NvimTree* opens tree instead of buffer

* Revert "fix(#1629): nvim start with file named *NvimTree* opens tree instead of buffer"

This reverts commit e7136078f7.

* fix(#1629): nvim start with file named *NvimTree* treats file as tree

* fix(#1629): nvim start with file named *NvimTree* treats file as tree
2022-10-11 10:00:03 +11:00
Piotr Doan
4a725c0ca5
fix(#1555): incorrect exe highlight in Windows filesystem from WSL (#1557) 2022-08-29 10:53:23 +10:00
axlauri
09a51266bc
fix(#1494): git showUntracked value and log (#1504)
* should_show_untracked correctly evaluates status.showUntrackedFiles

* git.Runner:_run_git_job removes nils before logging args
2022-08-15 14:30:22 +10: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
Kian-Meng Ang
2928f8fe31
fix(docs): typos (#1470) 2022-07-27 13:48:14 +02:00
Kiyan
64cc3c17e1
feat(mapping): deprecate user mappings and add on_attach (#1424) 2022-07-26 11:09:39 +02:00
Alexander Courtis
eff1db341c
chore(watchers): Watcher shares single fs_event from Event, node watchers use unique path prefixed debounce context (#1453) 2022-07-26 10:43:58 +02:00
kiyan
8dc2144e87 refactor: use vim.ui.input for y/n selections
also add clear_prompt again.
fixes #1441
2022-07-19 11:31:09 +02:00
kiyan
1ee6a3ea65 feat(create-file): use vim.ui.select for confirmation
fixes #1434
fixes #1294
2022-07-18 14:32:19 +02:00
kiyan
18447132fc feat(notify): switch all print/nvim_*write statements to utils.notify 2022-07-18 14:04:48 +02:00
kiyan
21fadc1f38 chore: move nvim-tree.utils.warn -> notify.warn
add notify.error and notify.info
2022-07-18 13:46:11 +02:00
Alexander Courtis
06e48c29c4
chore(watchers): refactor events and make debouncer safe
- fs poll -> fs events
- make debouncer safe and fix diagnostics events
2022-07-17 08:50:24 +02:00
kiyan
4900d66370 fix(open-file): focus file if already opened 2022-07-16 15:38:50 +02:00
Kiyan
89becc7604
feat(marks): add navigation (next, previous, select) (#1415) 2022-07-16 10:40:47 +02:00
kiyan
078a9e5bf9 chore: move focus_file to utils 2022-07-11 16:55:33 +02:00
kiyan
90bf14014e fix(file rename): edit buffer when renaming to reset filetype
fixes https://github.com/kyazdani42/nvim-tree.lua/issues/1404
2022-07-10 09:39:11 +02:00
kiyan
4bd919a75f fix(get-node-from-path): group dirs should be returned before nodes 2022-07-06 14:00:43 +02:00
Kiyan
f43b8af8f4
chore(iterators): create Iterator module and migrate iterators to use it (#1392) 2022-07-04 14:13:14 +02:00
Alexander Courtis
e401a4c957 feat(watcher): debounce FS watchers 2022-06-28 11:18:22 +10:00
Alexander Courtis
0c13bd76a8
chore: update_root, sync_root_with_cwd, refactor with move_missing_val (#1359)
* chore: opts.update_focused_file.update_cwd -> update_root

* chore: opts.update_cwd -> sync_root_with_cwd

* chore: refactor options with utils move_missing_val

* chore: refactor options with utils move_missing_val

* chore: refactor options with utils move_missing_val

* chore: refactor options with utils move_missing_val

* chore: refactor options with utils move_missing_val

* chore: refactor options with utils move_missing_val
2022-06-26 12:18:14 +10:00
Kiyan
b0d27c09b6
feat(explorer): add filesystem watchers (#1304)
* feat(explorer): add experimental watchers

This commit introduces watchers to update the tree.
This behavior is introduced behind an "filesystem_watchers" option
which should prevent instabilities.
It will become the default at some point.

Co-authored-by: Alexander Courtis <alex@courtis.org>
2022-06-05 12:39:39 +02: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
ebf73f0a9d fix: formatting 2022-04-23 12:45:53 +02:00
kiyan
d4d02cd4d1 fix: formatting 2022-04-23 12:34:56 +02:00
Alexander Courtis
1bdef08cfa
#1059 protect against duplicates (#1143) 2022-04-09 14:59:38 +02:00
Alexander Courtis
51d1af4ee2 stylua indent 2022-04-02 12:59:06 +11:00
Alexander Courtis
1352cb312c naming fix for luacheck 0.26.0 2022-03-26 12:29:01 +11:00
Eli W. Hunter
6492d43fae
Rename child buffers when renaming directory (#1095) 2022-03-22 20:23:16 +01: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
Andreas Bissinger
ceadf83809
feat: add file size in popup (#1049) 2022-03-06 11:26:35 +01:00
Alexander Courtis
9b03ab40e8
remove table_tostring (#1036) 2022-03-02 07:57:44 +01:00
Alexander Courtis
97717d8d23
G migration mechanism (#1030) 2022-03-01 19:54:12 +01:00
Lopi-py
5f047bc5f9
fix: close windows properly (#924) 2022-02-17 08:19:42 +01:00
Xavier Young
121f5c9037
fix: use canonical path in windows (#977) 2022-02-15 08:36:53 +01:00
Xavier Young
fdf63e572d
fix: use fs_realpath to normalize path (#978) 2022-02-15 08:33:11 +01:00
Steve Vermeulen
da59247db9
Fixed some trailing slash bugs (#957)
* Fixed issue where user would have to trigger dir-up action multiple times to get it to work

* Fix to path_join to ensure the result does not have a double slash
2022-02-10 08:56:05 +01:00
kiyan
92a64daf27 fix: normalize cwd with '..' 2022-02-08 21:36:46 +01:00