Commit graph

409 commits

Author SHA1 Message Date
Kyle Beede
bd4881660b
fix: safely close last tree window (#2913)
fix: safely close tree window with pcall and debug logging

Co-authored-by: Alexander Courtis <alex@courtis.org>
2024-09-14 16:34:36 +10:00
Alexander Courtis
03f737e574
feat(#2430): use vim.ui.open as default system_open, for neovim 0.10+ (#2912)
* feat(#2430): use vim.ui.open as default system_open, for neovim 0.10+

* feat(#2430): use vim.ui.open as default system_open, for neovim 0.10+
2024-09-14 15:15:44 +10:00
Alexander Courtis
cb57691536
docs: clarify node parameters in API, use of function {rhs} in on_attach (#2899)
* docs: specify node parameters for all API

* docs: clarify need to use a custom functions in on_attach
2024-09-08 15:11:02 +10:00
Alexander Courtis
43c3c36c7a doc(#2891): remove unused option hidden.enable 2024-09-01 14:52:25 +10:00
Alexander Courtis
e962e97cab
refactor(#2830): multi instance marks (#2873)
* refactor(#2830): multi instance marks

* refactor(#2830): multi instance marks

* refactor(#2830): multi instance marks
2024-08-25 12:32:09 +10:00
Everton Jr.
e25eb7fa83
feat(#2225): add renderer.hidden_display to show a summary of hidden files below the tree (#2856)
* feat(icon_placement): Allow right_align icon_placemente for decorator using ext_marks nvim api

* feat(icon_placement): Allow right_align icon_placemente for decorator using ext_marks nvim api

feat(icon_placement): Allow right_align icon_placemente for decorator using ext_marks nvim api

* feat(icon_placement): consolidate doc

* fix: extra namespace added to avoid colision between right_align and full_name features

* feat(hidden_display): Allow fine grained rendering of hidden files in
a folder

* feat(hidden_display): update defaults in Builder to allow rendering

* feat(hidden_display): Rename opts function name for the feature

* feat(#2349): add "right_align" option for renderer.icons.*_placement (#2846)

* feat(icon_placement): Allow right_align icon_placemente for decorator using ext_marks nvim api

* feat(icon_placement): Allow right_align icon_placemente for decorator using ext_marks nvim api

feat(icon_placement): Allow right_align icon_placemente for decorator using ext_marks nvim api

* feat(icon_placement): consolidate doc

* fix: extra namespace added to avoid colision between right_align and full_name features

* style: rename namespace_id

---------

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

* docs: update docs

* feat(hidden_display): Simplification and better performance by not sorting and grouping virtual lines

* Update doc/nvim-tree-lua.txt

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

* style: hidden_stats is better

* docs: change to hidden_stats

* add separate namespace for virtual lines

* help: add highlight group

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2024-08-10 11:36:30 +10:00
Everton Jr.
48d0e82f94
feat(#2349): add "right_align" option for renderer.icons.*_placement (#2846)
* feat(icon_placement): Allow right_align icon_placemente for decorator using ext_marks nvim api

* feat(icon_placement): Allow right_align icon_placemente for decorator using ext_marks nvim api

feat(icon_placement): Allow right_align icon_placemente for decorator using ext_marks nvim api

* feat(icon_placement): consolidate doc

* fix: extra namespace added to avoid colision between right_align and full_name features

* style: rename namespace_id

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2024-07-28 13:26:22 +10:00
Mateusz Russak
1aa9852cad
docs: removed entry about macos rename (#2848) 2024-07-27 12:58:02 +10:00
Everton Jr.
48a9290757
feat: add renderer.highlight_hidden, renderer.icons.show.hidden and renderer.icons.hidden_placement for dotfile icons/highlights (#2840)
* feat(hidden_decorator): Allow hidden (dotfiles) to be highlighted, both icon and name (this not related to git highlights).

Better defaults

squashed

docs(hidden)

docs(hidden)

docs(hidden)

* fix(typo): small typo on hl groups

* feat(hidden_dotfile_highlight): make a file that has a dotfile parent be also a dotfile

* docs: update docs on hidden highlight

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2024-07-21 16:00:34 +10:00
Alexander Courtis
b2640685a8 Revert "feat(#2349): add "right_align" option for renderer.icons.*_placement (#2839)"
This reverts commit 1d629a5d3f.
2024-07-21 15:22:24 +10:00
Everton Jr.
1d629a5d3f
feat(#2349): add "right_align" option for renderer.icons.*_placement (#2839)
* feat(icon_placement): Allow right_align icon_placemente for decorator using ext_marks nvim api

* feat(icon_placement): Allow right_align icon_placemente for decorator using ext_marks nvim api

feat(icon_placement): Allow right_align icon_placemente for decorator using ext_marks nvim api

* feat(icon_placement): consolidate doc

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2024-07-21 14:49:10 +10:00
Vladimir Levin
2ede0de67b
feat(#2598): add api.tree.resize (#2811)
* feat(#2598): Implemented API `tree.resize`

* rely on  when resize

* Fix docs

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2024-07-11 15:15:40 +10:00
Epheien
869c064721
feat(#2127): add experimental.actions.open_file.relative_path to open files with a relative path rather than absolute (#2805)
* temp workaround for issue #2803

* fix #2127 and #2803

* chore(#2127): read the configuration correctly

* feat(#2127): add help

* feat(#2127): normalise relative_path in config hierarchy

* feat(#2127): update help

---------

Co-authored-by: eph <eph@MacBook-Pro.local>
Co-authored-by: Alexander Courtis <alex@courtis.org>
2024-07-07 12:51:43 +10:00
Alexander Courtis
8b2c5c678b
feat(#2799): filesystem_watchers.ignore_dirs and git.disable_for_dirs may be functions (#2800)
feat(#2799): filesystem_watchers.ignore_dirs and git.disable_for_dirs may be functions
2024-06-23 11:44:45 +10:00
Alexander Courtis
8704b6f7fc
chore(#2787): minimum nvim version 0.9, replace 0.10 deprecated, enable deprecated warnings (#2788)
* refactor(#2787): replace deprecated

* refactor(#2787): enable deprecated checks

* refactor(#2787): replace deprecated

* refactor(#2787): replace deprecated

* refactor(#2787): replace deprecated

* refactor(#2787): replace deprecated

* refactor(#2787): use inline deprecation disabling

* refactor(#2787): replace deprecated

* refactor(#2787): replace deprecated

* refactor(#2787): replace deprecated

* refactor(#2787): replace deprecated

* refactor(#2787): replace deprecated

* refactor(#2787): replace deprecated

* refactor(#2787): replace deprecated

* refactor(#2787): replace deprecated

* refactor(#2787): replace deprecated

* refactor(#2787): deprecated are now warnings

* refactor(#2787): 0.9 is the minimum supported version

* Revert "refactor(#2787): replace deprecated"

This reverts commit b6b4c32fcb.

* refactor(#2787): suppress deprecated until 0.11

* refactor(#2787): minimum nvim version 0.8 -> 0.9

* refactor(#2787): reset globals

* refactor(#2787): explicitly check for vim.diagnostic.is_enabled function presence
2024-06-09 12:24:35 +10:00
Ava Harris
e20966ae55
feat: add update_focused_file.exclude (#2673)
* Add update_focused_file.exclude and move update_focused_file.ignore_list to update_focused_file.update_root.ignore_list

* Pass ci checks

* Add config migration for update_root and ignore_list

* Missed one mention of update root in find_file.lua

* Update migration code

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

* make docs consistent

* match on filename instead of entire path

* exclude as a function

* fix docs

* default exclude value

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2024-03-25 15:41:05 +11:00
Denys Lytviak
f7c09bd72e
feat: add api.tree.toggle_enable_filters (#2706)
* feat: toggle filters

* naming refactoring

* change name to enable

* fix default opt

* fix api name

* update doc

* remove default keybinding, toggle live filter

* add API doc

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2024-03-16 12:35:13 +11:00
Rami Elwan
8f2a50f1cd
feat: add api.fs.copy.basename, default mapping ge (#2698)
* feat: add copy basename

* fix: change keymap for copy basename

* fix: use double quotes

* fix: add missing help

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2024-03-14 16:57:46 +11:00
Alexander Courtis
d52fdeb0a3
docs: add help indexes (#2684)
* docs: add nvim-tree-index-api

* docs: add nvim-tree-index-opts

* docs: add nvim-tree-index-api

* docs: sort indices

* docs: less verbose

* docs: use dictionary sort for indices
2024-02-24 17:53:25 +11:00
Alexander Courtis
7efaa339d3
docs: :help nvim-tree-legacy (#2679)
doc: add help nvim-tree-legacy
2024-02-24 15:50:10 +11:00
Alexander Courtis
030defdb65
docs: add highlight examples to quickstart, document pre-overhaul SpellCap groups (#2680)
* docs: add highlight examples to quickstart, document pre-overhaul SpellLocal groups

* docs: add highlight examples to quickstart

* docs: document pre-overhaul SpellCap groups

* docs: document pre-overhaul SpellCap groups
2024-02-20 13:24:37 +11:00
darcy
4a87b8b46b
feat(#2654): filters.custom may be a function (#2655)
* feat(#2654): add `binaries` field to `filters`

* feat(#2648): allow functions in `filters.custom`

* ci: fix: stylua check

* ci: fix: add new keybind and config to docs

* fix: replace os-specific binary filter with `vim.fn.executable`

* fix: remove function and mapping for `binaries` filter

* fix: add `node` parameter to custom filter function

* fix: update doc for custom filter function signature

* fix: add custom filter to `ACCEPTED_TYPES`

* fix: accept single function for custom filter

* fix: change custom filter on `ACCEPTED_TYPES`

* fix: revert to using `path` for custom filter function

* fix: use `function` type for custom filter

* fix: type for custom filter in help

* fix: custom filter single function no longer mutates `M.config.filter_custom`

* fix: remove dead `if` statement in custom filter

* fix: separate custom filter function from `M.ignore_list`

* doc nit

---------

Co-authored-by: darcy <44690813+darccyy@users.noreply.github.com>
Co-authored-by: Alexander Courtis <alex@courtis.org>
2024-02-11 17:18:40 +11:00
Alexander Courtis
b278fc25ae
feat(#2415): add :NvimTreeHiTest (#2664)
* feat(#2415): add :NvimTreeHiTest

* feat(#2415): split out appearance diagnostics
2024-02-11 14:41:40 +11:00
Zeta
8cbb1db8e9
feat: add node.open.toggle_group_empty, default mapping L (#2647)
* feat: ungrouping empty directories

* add a new api to toggle empty folders

* solve comments

* solve comments

* update help

---------

Co-authored-by: juefei yan <juefeiyan@juefeis-MacBook-Air.local>
Co-authored-by: Alexander Courtis <alex@courtis.org>
2024-02-04 16:48:56 +11:00
Confidenceman02
f39f7b6fcd
fix(#2415): nvim 0.8 highlight overhaul support, limited to only show highest highlight precedence (#2642)
* fix: Add support for get_hl_defs in nvim 0.8

nvim-tree is using `nvim_get_hl` which was introduced in nvim 0.9 to
replace the unstable `get_hl_defs` in the following [commit](https://github.com/neovim/neovim/pull/22693/files).

Unfortunately this raises an error in 0.8 nvim versions due to the
function not existing.

```
Failed to run `config` for nvim-tree.lua
...are/nvim/lazy/nvim-tree.lua/lua/nvim-tree/appearance.lua:199: attempt to call field 'nvim_get_hl' (a nil value)
stacktrace:
  - ~/.config/nvim/lua/confidenceman02/plugins/nvim-tree.lua:14 _in_ **config**
  - ~/.config/nvim/lua/confidenceman02/lazy.lua:14
```

- Fall back to get_hl_defs when detecting 0.8
- Set the 'link' property to nil to emulate `link = false` in
  `builder.lua`

* fix(#2415): nvim 0.8 highlight overhaul support, limited to only show highest highlight precedence

---------

Co-authored-by: Jaime Terreu <jaime@terreu.com>
Co-authored-by: Alexander Courtis <alex@courtis.org>
2024-01-30 10:37:32 +11:00
Alexander Courtis
d9cb432d2c
fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul (#2639)
* fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul

* fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul

* fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul

* fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul

* fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul

* fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul

* fix(#2415): disambiguate highlight groups, see :help nvim-tree-highlight-overhaul
2024-01-29 12:43:02 +11:00
Alexander Courtis
e9c5abe073
feat(#2415): colour and highlight overhaul, see :help nvim-tree-highlight-overhaul (#2455)
* feat(#2415): granular highlight_diagnostics, normalise groups (#2454)

* chore: normalise colours and enable cterm (#2471)

* feat(#2415): granular highlight_git, normalise git groups (#2487)

* docs: update CONTRIBUTING.md (#2485)

* feat(#2415): granular highlight_git, normalise git groups

* feat(#2415): normalise and add modified groups

* feat(#2415): create Decorator class for modified and bookmarks

* feat(#2415): create DecoratorDiagnostics

* feat(#2415): create DecoratorGit

* feat(#2415): create DecoratorGit

* add DecoratorCopied DecoratorCut

* add DecoratorOpened

* remove unloaded_bufnr checks as the view debouncer takes care of it

* Add `renderer.highlight_git` to accepted strings

* fix(#2415): builder refactor (#2538)

* simplify builder signs

* decorators take care of themselves and are priority ordered

* simplify builder hl groups

* refactor builder for icon arrays

* builder use decorators generically

* fix(#2415): harden sign creation (#2539)

* fix(#2415): harden unicode signs

* Decorator tidy

* normalise git sign creation and tidy

* tidy builder

* NvimTreeBookmarkIcon

* tidy HL doc

* tidy HL doc

* tidy HL doc

* tidy builder doc

* standardise on '---@param'

* DiagnosticWarning -> DiagnosticWarn

* annotate decorators

* limit to two highlight groups for line rendering

* style

* apply #2519

* feat(#2415): combined hl groups (#2601)

* feat(#2415): create combined highlight groups

* feat(#2415): create combined highlight groups

* feat(#2415): create combined highlight groups

* ci: allow workflow_dispatch (#2620)

* one and only one hl namespace, required winhl removal

* small tidies

* colors.lua -> appearance.lua

* full-name uses one and only namespace

* don't highlight fast, just apply to namespace, safer win_set_hl

* gut builder (#2622)

collapse Builder

* fix group_empty function check

* feat(#2415): highlight-overhaul release date

---------

Co-authored-by: Akmadan23 <azadahmadi@mailo.com>
2024-01-20 16:12:13 +11:00
Antonin Godard
5d13cc8205
feat(#1389): api: recursive node navigation for git and diagnostics (#2525)
* feat(#1389): add next recursive for git and diag moves

The recurse opt can be used to directly go to the next item showing
git/diagnostic status recursively.

Signed-off-by: Antonin Godard <antoningodard@pm.me>

* refactor: status logic in single function

Rename get_status to status_is_valid.

Use status_is_valid function in multiple place to avoid duplicating
code.

Signed-off-by: Antonin Godard <antoningodard@pm.me>

* feat(#1389): add prev recursive for git and diag moves

Signed-off-by: Antonin Godard <antoningodard@pm.me>

* fix(#1389): next recursive: take root node into account

The root node cannot have a status. Previously if moving from the root
node, status_is_valid was trying to fetch the status from it and errored.

Signed-off-by: Antonin Godard <antoningodard@pm.me>

* fix(#1389): doc: remove show_on_open_dirs limitation

Signed-off-by: Antonin Godard <antoningodard@pm.me>

* feat(#1389): move find_node_line to utils

Signed-off-by: Antonin Godard <antoningodard@pm.me>

* feat(#1389): doc: note recursive moves are to files only, tidy

---------

Signed-off-by: Antonin Godard <antoningodard@pm.me>
Co-authored-by: Alexander Courtis <alex@courtis.org>
2024-01-07 09:08:58 +11:00
Devansh Sharma
dc839a72a6
feat: add kind param to vim.ui.select function calls (#2602)
* feat: add kind param to vim.ui.select function calls

* feat: add kind param to prompts for bookmark actions

* docs: add section for prompts

* docs: add section for prompts

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-12-31 15:37:16 +11:00
Azad
50f30bcd8c
feat: add option to skip gitignored files on git navigation (#2583)
* feat: add option to skip gitignored files on git navigation

* Add API bindings

* stylua: ignore
2023-12-19 11:29:01 +01:00
Alexander Courtis
8f92e1edd3
feat(#1850): add "no bookmark" filter (#2571)
* feat(#1850): add no bookmark filter

* feat(#1850): add no bookmark filter - style
2023-12-19 16:18:24 +11:00
Alexander Courtis
7e5c673180
docs(#285): clarify api.fs.create directory creation (#2572)
docs(#285): clarify api.fs.create directory creation
2023-12-04 11:32:03 +11:00
Alexander Courtis
d5cc938ab0 refactor: api and command focus call tree.open(), soft deprecate tree.focus() 2023-11-27 14:24:55 +02:00
Alexander Courtis
db796fc74e
docs: complete API calls for commands (#2556)
doc: complete API calls for commands
2023-11-25 13:21:34 +11:00
John Hui
8c534822a7
feat(#2544): add api.tree.winid (#2545)
* feat(#2544): add API for querying win ID, api.tree.winid()

* Document winid() opts

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

* Fix winid() docs

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

* Handle case where tabpage = 0

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-11-21 16:04:43 +11:00
Azad
a2aaf8b430
feat(#2515): add option to change grouped folders name with custom function (#2521)
* Add option to change grouped folders name with custom function

* Fix docs

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-11-09 11:20:29 +01:00
Azad
c1568568b3
feat(#2498): delete, trash prompts default N, added ui.confirm.default_yes option to override this behaviour (#2500)
Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-10-30 12:28:29 +11:00
Azad
78a9ca5ed6
feat: mapping and options to sort entries in help window (#2482)
* feat: add option to sort entries in help window

* stylua

* Add keymap to toggle sorting methods

* Bug fix

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-10-23 08:57:49 +11:00
Alexander Courtis
db8145c27d
fix(#2459): disable cygwin git support by default, see :help nvim-tree.git.cygwin_support to enable (#2486) 2023-10-21 16:34:34 +11:00
Alexander Courtis
40b9b887d0
fix(#2473): remove problematic <S-Tab> default mapping (#2475) 2023-10-17 10:00:56 +11:00
umlx5h
aaee4cd896
feat: api.node.open.preview_no_picker with default mapping <S-Tab> (#2464)
* feat: add preview with no window picker action

* feat: preview_no_window_picker -> preview_no_picker

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-10-15 14:04:04 +11:00
Benoit Charles
0882354517
feat(#2148): api.fs.rename_full (#2461)
* feat(#2148): add rename_full in API

* feat(#2148): add default mapping 'u' for rename_full

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-10-15 13:40:40 +11:00
Bram Reyniers
e153d9f599
fix(#2440): view.width.padding may be a number or function returning a number (#2442)
* fix validation view.width.padding

* fix docs for view.width.padding

* fix docs for view.width.padding

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-10-07 12:21:13 +11:00
Alexander Courtis
7dcda5d3b6
doc(#2440): view.width.padding may only be a string (#2441) 2023-10-02 14:38:11 +11:00
Alexander Courtis
07eb5b4059
docs: notify deprecated hide_root_folder (#2431) 2023-09-24 15:15:19 +10:00
Alexander Courtis
d49a284236
feat(#2411): add renderer.highlight_bookmarks, renderer.icons.bookmarks_placement (#2412)
* feat(#1079): add highlight NvimTreeCopiedText and NvimTreeCutText

* feat(#1079): add highlight NvimTreeCopiedText and NvimTreeCutText

* feat(#1079): node may not be present in copy and cut

* feat(#2411): bookmark highlight and icon placement

* feat(#1079): add renderer.highlight_clipboard

* feat(#1079): add renderer.highlight_clipboard

* feat(#2411): bookmark highlight and icon placement

* feat(#2411): bookmark highlight and icon placement

* style

* feat(#2411): bookmark highlight and icon placement

* feat(#2411): bookmark highlight and icon placement

* feat(#2411): bookmark highlight and icon placement

* feat(#2411): bookmark highlight and icon placement
2023-09-24 15:07:02 +10:00
Azad
914a6868cb
docs: add missing quotes (#2424) 2023-09-23 12:06:48 +10:00
Alexander Courtis
a3aa3b47ea
feat(#1079): add renderer.highlight_clipboard default name, defaults to undercurls (#2410)
* feat(#1079): add highlight NvimTreeCopiedText and NvimTreeCutText

* feat(#1079): add highlight NvimTreeCopiedText and NvimTreeCutText

* feat(#1079): node may not be present in copy and cut

* feat(#1079): add renderer.highlight_clipboard

* feat(#1079): renderer.highlight_clipboard takes options, style cut/copy HL

* feat(#1079): renderer.highlight_clipboard takes options, style cut/copy HL

* feat(#1079): use an enum for highlight position

* feat(#1079): diagnostics uses _append_highlight
2023-09-17 16:08:04 +10:00
pr4th4m
7f7665a17b
feat: api.marks.bulk.trash (#2391)
* Feature: Bulk trash api

* Update docs

* Follow documentation syntax

* Remove unnecessary refresh

* doc spacing

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-09-16 15:10:36 +10:00
Alexander Courtis
b7f6600bc2
feat(#2197): git and diagnostics folder highlight groups (#2409)
* feat(#2197): add git folder highlight groups

* feat(#2197): add diagnostics folder highlight groups
2023-09-09 15:13:14 +10:00