Commit Graph

83 Commits

Author SHA1 Message Date
Alexander Courtis
03ae60313b
refactor(#2875): multi instance renderer (#2900)
* refactor(#2875): multi instance renderer

* refactor(#2875): multi instance renderer

* refactor(#2875): multi instance renderer

* refactor(#2875): multi instance renderer

* refactor(#2875): deal with some cyclic require

* refactor(#2875): multi instance renderer

* refactor(#2875): multi instance renderer

* refactor(#2875): multi instance renderer

* refactor(#2875): multi instance renderer

* refactor(#2875): multi instance renderer

* refactor(#2875): multi instance renderer

* refactor(#2875): multi instance renderer

* refactor(#2875): multi instance renderer

* refactor(#2875): multi instance renderer

* refactor(#2875): multi instance renderer

* refactor(#2875): multi instance renderer
2024-09-21 10:41:35 +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
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
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
Alexander Courtis
26632f496e
chore(#2731): neovim luadoc 0.10 compliance (#2786)
* refactor(#2731): resolve warnings

* refactor(#2731): resolve warnings

* refactor(#2731): resolve warnings

* refactor(#2731): resolve warnings, type gymnastics

* refactor(#2731): resolve warnings, type gymnastics

* refactor(#2731): resolve warnings

* refactor(#2731): resolve warnings

* refactor(#2731): handle cwd unavailable when opening

* refactor(#2731): resolve warnings

* refactor(#2731): resolve warnings

* refactor(#2731): resolve warnings

* refactor(#2731): resolve warnings, type gymnastics

* refactor(#2731): resolve warnings

* refactor(#2731): resolve warnings

* refactor(#2731): style

* refactor(#2731): add _meta library, explicit check disables

* refactor(#2731): add lua-language-server manual install instructions

* refactor(#2731): resolve warnings

* refactor(#2731): explicitly set all diagnostics, reduce deprecated to hint

* Revert "refactor(#2731): resolve warnings"

This reverts commit 9c0526b7b0.

* Revert "refactor(#2731): resolve warnings"

This reverts commit f534fbc606.

* refactor(#2731): handle directory unavailable when deleting

* refactor(#2731): resolve warnings

* refactor(#2731): resolve warnings

* refactor(#2731): resolve warnings

* refactor(#2731): resolve warnings

* refactor(#2731): resolve warnings

* refactor(#2731): resolve warnings

* refactor(#2731): resolve warnings

* refactor(#2731): handle directory unavailable when creating explorer

* refactor(#2731): add all nvim lua libraries

* refactor(#2731): resolve warnings

* refactor(#2731): remove vim global

* refactor(#2731): disable deprecated until we have a 0.9->0.10 story
2024-06-01 15:24:03 +10:00
Alexander Courtis
fbee8a69a4
fix(#2643): correctly apply linked highlight groups in tree window (#2653)
* fix(#2643): correctly apply linked highlight groups in tree window

* fix(#2643): recreate and apply combined highlight groups on colorscheme change
2024-01-29 12:42:19 +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
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
zootedb0t
94e572e141
fix(#2450): apply NvimTreeImageFile for webp and jxl files (#2451) 2023-10-08 11:37:20 +11: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
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
Alexander Courtis
323f65cb9c
feat(#1917): add diagnostic highlighting and icon placement (#2396)
* feat(#1917): add renderer.highlight_diagnostics

* feat(#1917): add renderer.highlight_diagnostics

* feat(#1917): add enderer.icons.diagnostics_placement

* feat(#1917): add renderer.icons.show.diagnostics

* feat(#1917): document highlight overrides
2023-09-03 12:29:33 +10:00
Stefano Stoduto
3b62c6bf2c
feat(event): add TreeRendered (#2324)
* add TreeRendered event

* pass bufnr and winnr to TreeRendered event

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-07-16 17:22:45 +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
b712b82b0c
fix(#1961): harden profiling functions (#1986) 2023-02-11 17:05:01 +11:00
Richard Li
dcc344cc72
feat(view): indicate modified buffers (#1835)
* Outlined new options

* highlight_modified is highlight_opened_files

* prototype with autocmd

* moved modified into glyphs

* show_on_dirs and show_on_open_dirs

* icon placement before & after

* _get_filename_offset

* fixed :wq doesn't update modified indicator

* highlight_modified, signcolumn modified_placement

Refactored to make everything use HighlightedString to remove all the complex `insert_highlight` calculation.
Not tested.

* updated doc to match the reality of no multi char for glyphs.modified

* fixed git signcolumn doesn't show

* fixed highlight_modified gets replaced by highlight_opened_files

* fixed renderer.icons.show.modified = false crash

* updated doc to reflect empty icon not breaking rendering

* removed debounce_delay to implement in a later PR

* doc nit: order placement

* change modified dirs default to be consistent with git

* illegal git & modified placement changed to default

* don't assume icon exist

* nit remove comment

* Noted in doc that glyphs can't have more than 2 characters if in signcolumn

* Don't sign_define if placement isn't signcolumn

Co-authored-by: Alexander Courtis <alex@courtis.org>
2022-12-31 15:54:04 +11:00
Richard Li
18272f8df3
fix(view): refresh opened files highlight on buffer read, unload (#1827) 2022-12-16 14:36:00 +11:00
David Aguilera
99d713644d
feat(renderer): add renderer.root_folder_label (#1746)
* Add new renderer setting `add_root_updir` to fix #1743.

* Fix default value in docs.

* Remove proposed “add_root_updir” and rename “root_folder_modifier” to “root_folder_label”. Also, “root_folder_label” can be also a function now.

* chore: warn users about breaking change

* fix(#1743): use silent migration of root_folder_modifier

* fix(#1743): add example, document previous renderer.root_folder_modifier

* Add check to validate return type of “root_folder_label” is string.

* Change “root_folder_label” default value to “:~:s?$?/..?”.

* Add missing keyword “local” to local variable “label”.

Co-authored-by: David Aguilera <david.aguilera@neliosoftware.com>
Co-authored-by: gegoune <dev@clog.rocks>
Co-authored-by: Alexander Courtis <alex@courtis.org>
2022-11-26 14:02:05 +11:00
Alexander Courtis
8cc369695b
fix: replace vim.* "requires" with explicit calls to vim functions (#1701) 2022-11-06 10:37:33 +11:00
Kiyan
df92f1527f
feat(bookmarks): add bookmark feature (#1412) 2022-07-11 10:00:12 +02:00
Alexander Courtis
fd562ede63
fix(#1406): allow nvim-tree.renderer.icons.show.folder_arrow
* fix(#1406): allow nvim-tree.renderer.icons.show.folder_arrow when not folder

* fix(#1406): allow nvim-tree.renderer.icons.show.folder_arrow when indent markers enabled

* fix(builder): highlight first iteration for arrow column

* fix stylua

Co-authored-by: kiyan <yazdani.kiyan@protonmail.com>
2022-07-10 12:14:18 +10:00
Alexander Courtis
b81ab199a5 fix(help): clear git signs before draw 2022-07-09 11:44:39 +10:00
Toby O'Sullivan
38fabe86cb
Optionally suppress the symlink destination (#1396) 2022-07-05 10:05:21 +02:00
lu5je0
821f050fda
feat: full-name of node in floating window (#1305) 2022-06-06 11:15:03 +02:00
Kiyan
2002b21be7
feat(resize): add ability to grow and shrink the tree when drawing (#1293)
Will adapt the view size based on the longest line.
fixes #865
2022-05-31 09:05:00 +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
Kiyan
f8312cd06f
feat(renderer): add ability to set git icons in signcolumn (#1242) 2022-05-14 09:54:27 +02:00
Kiyan
a1600e57f2
feat(renderer): allow placing git icons after filename (#1203)
This feature allows placing git icons after the filename.
2022-05-07 14:05:51 +02:00
Kiyan
db873b340d
chore(diagnostics): move updates to renderer (#1218)
should address #1216
2022-05-07 11:14:32 +02:00
kiyan
ce2cf7131f refactor(renderer): refactor git handling
Concat and apply git highlight inside the builder.
This allows to not leak private data from builder to the git component.
This will also now allow us to customize git icon placement.
2022-04-26 22:59:16 +02:00
kiyan
785761591f stylua 2022-04-24 14:43:41 +02:00
kiyan
2bf6241989 fix(renderer): render hl should take a table of saved highlights
fixes #1190
2022-04-24 11:20:23 +02:00
kiyan
ec6ccf33ff refactor(renderer): abstract configuration related code
- vim.g variables passed as configuration for builder in
  renderer/init.lua.
- pass special and pictures maps during configuration
2022-04-23 15:27:30 +02:00
kiyan
d44742bee5 refactor(renderer): line creation into a builder pattern
- use a builder pattern to mount the lines / highlights
- i think we lost a little performance, but gain in design
- code for file/folder icons is abstracted in components/icons.lua
- should also fix the issues where vim.g variables where loaded before
  setup.
2022-04-23 15:15:10 +02:00
kiyan
d4d02cd4d1 fix: formatting 2022-04-23 12:34:56 +02:00
kiyan
3ecf22ced1 refactor(renderer): icon_state under module table and code smells
- remove line / hl builder from module table and rename function
- icon_state -> M.icon_state
- extract should_show_arrows
2022-04-23 11:58:33 +02:00
kiyan
73fe08d241 refactor(renderer): simplify loop and builders
- do not recur inside folder builder
2022-04-23 11:52:57 +02:00
kiyan
d369ddccb3 refactor(renderer): extract opened file highlighting 2022-04-23 11:42:32 +02:00
kiyan
a419da1f2c refactor(renderer): reorganize file for further refacto 2022-04-23 11:35:04 +02:00
kiyan
df41b0c586 refactor(renderer): extract folder builder 2022-04-23 11:22:28 +02:00
kiyan
018ba086d4 refactor(renderer): extract file builder 2022-04-23 11:20:03 +02:00
kiyan
de49bf4da6 refactor: extract symlink function 2022-04-23 11:17:25 +02:00
kiyan
3084e483ae chore: refacto file placement of renderer components 2022-04-23 11:14:16 +02:00
kiyan
ce463a53ae Revert "chore: use api to check if buf is loaded"
This reverts commit db91909f5b.
fixes #1182
2022-04-21 21:31:42 +02:00
kiyan
db91909f5b chore: use api to check if buf is loaded 2022-04-21 20:46:24 +02:00
Alexander Courtis
cdbc210d92
#1172 add renderer.icons.webdev_colors default true (#1175) 2022-04-18 15:45:14 +02:00
Alexander Courtis
d5e4f0655b
add view.indent_markers (#1134) 2022-04-10 15:40:29 +02:00