Commit Graph

1167 Commits

Author SHA1 Message Date
Alexander Courtis
59bcb01d3b fix(#2024): help handles empty mapping description 2023-02-27 20:28:10 +11:00
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
Alexander Courtis
9c97e6449b
fix(#1961): stop unnecessary find file refreshes, avoid find file refresh cycles (#2010) 2023-02-21 10:34:01 +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
04f99f14b5
fix(#2003): obey user split command for modified buffers when hidden not set (#2008) 2023-02-20 10:04:55 +11:00
Alexander Courtis
08a0aa1a3b Revert "fix(#1961): cycle detection on refresh, preventing infinite loop (#1996)"
This reverts commit 4222bb875d.
2023-02-15 09:24:12 +11:00
Alexander Courtis
4222bb875d
fix(#1961): cycle detection on refresh, preventing infinite loop (#1996)
* #1961 diagnostic logging refresh_nodes_for_path

* #1961 add cycle detection to refresh_nodes_for_path

* #1961 escape special characters on when path matching during refresh

* #1961 escape special characters on when path matching during refresh
2023-02-14 15:08:41 +11:00
Alexander Courtis
8b8d457e07
fix(#1993): always fire TreeOpen event (#1994) 2023-02-13 14:57:01 +11:00
Alexander Courtis
ba1778e061
fix(#1923): handle empty git icons (#1987) 2023-02-13 10:32:02 +11:00
Alexander Courtis
36e29c3a95
fix(#1970): disable git integration after 5 timeouts (#1990)
* fix(#1970): additional log function gating for efficiency when not logging

* fix(#1970): additional log function gating for efficiency when not logging

* fix(#1970): disable git integration after 10 timeouts

* fix(#1970): disable git integration after 10 timeouts

* fix(#1970): disable git integration after 10 timeouts

* fix(#1970): cleanly kill timed out git processes

* fix(#1970): revert git kill, to be completed via #1974 experiment

* fix(#1970): revert git kill, to be completed via #1974 experiment
2023-02-12 14:28:48 +11:00
Alexander Courtis
b712b82b0c
fix(#1961): harden profiling functions (#1986) 2023-02-11 17:05:01 +11:00
Alexander Courtis
02fdc262eb
fix(#1970): additional log function gating for efficiency when not logging (#1971)
* fix(#1970): additional log function gating for efficiency when not logging

* fix(#1970): additional log function gating for efficiency when not logging
2023-02-06 10:23:20 +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
Alexander Courtis
8505b6ecd8
fix(#1923): handle empty git icons (#1952)
* 1923 skip empty git icons

* 1923 skip empty git icons
2023-02-04 16:27:27 +11:00
Alexander Courtis
215b29bfad
feat(api): api.tree.open feature parity with api.tree.toggle (#1955) 2023-01-31 12:27:10 +11:00
Alexander Courtis
f3b73725c5 stylua: nit 2023-01-30 11:51:30 +11:00
Alexander Courtis
9fcd50d3e1 doc: clarify open/toggle defaults, more robust legacy argument handling 2023-01-30 11:49:21 +11:00
Alexander Courtis
fb775b3353
feat(view): deprecate open_on_setup.* in favour of https://github.com/nvim-tree/nvim-tree.lua/wiki/Open-At-Startup (#1951) 2023-01-30 10:10:41 +11:00
Adam Karim
e14989c0ea
Remove what appears to have been a debug message. (#1949) 2023-01-28 12:51:28 +01:00
Alexander Courtis
8567841b87
fix(#1946): only change vim's global cwd on startup when opening the tree (#1947) 2023-01-28 14:48:05 +11:00
Peter van der Meulen
e05ed6a60f
feat(view): add view.width.padding (#1941)
* fix: variable width accounts for sign/number columns

* Add dynamic sizing padding options

with https://github.com/neovim/neovim/pull/20621 merged in it is now
possible to fully customize the status-column in nvim (the column on the
left containing line-numbers, fold info, signs and borders).

A fair few cool implementations have popped up like:
- https://github.com/CKolkey/config/blob/master/nvim/after/plugin/statuscolumn.lua
- https://github.com/luukvbaal/statuscol.nvim
- and my own personal one (based on CKolkey's fantastic work) https://git.hendrikpeter.net/hendrikpeter/pico-vim/-/blob/main/lua/peva/status_column.lua

The problem with nvim-tree however is that dynamic sizing doesn't take
the custom size of a status column into account and the end of file
names get clipped off. This little patch should fix that (and give some
examples to help other status_column modders get started).

Thanks for looking at this and thanks for making this amazing plugin,
I've been using it for a while and I really like it!

* allow padding function, update docs, rollback readme

* typo in example setup

* help formatting

---------

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-01-28 14:07:14 +11:00
tummetott
55028e30d7
fix(#1942): nvim-tree window options do not trigger OptionSet event (#1945) 2023-01-28 13:31:27 +11:00
Alexander Courtis
9e87ee2d6e fix(#1940): NvimTreeFindFileToggle focus tree 2023-01-26 10:38:47 +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
yioneko
16f2806d59
fix: remove redundant file existence check in create file operation (#1936) 2023-01-23 15:12:45 +11:00
ramezgerges
96506fee49
feat(view): add view.width.min/max replacing adaptive_size, allowing upper bound (#1915)
* feat: max_width for adaptive_size

* view grow calculates size correctly based on sign column visibility

* limit width to a minimum of 20

* adaptive_size -> min/max table

* harden view size calculations against bad user input

* style

* add back an extra column of padding to adaptive resizing

* back out: limit width to a minimum of 20

* revert unnecessary change

* backout: view grow calculates size correctly based on sign column visibility

* remove adaptive_size from help

* backout unnecessary change M.View.config

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-01-21 15:21:18 +11:00
Alexander Courtis
1b13a49f91
fix(#1916): suppress EPERM watcher failures on windows (#1919) 2023-01-16 13:00:57 +11:00
Alexander Courtis
1f0fc8d6e8
feat(event): add au, global: NvimTreeRequired, NvimTreeSetup (#1912)
* feat(even): add autocommands NvimTreeRequired, NvimTreeSetup

* feat(event): add vim.g.NvimTreeRequired, vim.g.NvimTreeSetup
2023-01-15 10:12:50 +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
Telman Babayev
ccb6d8a518
feat: add ui.confirm.remove and ui.confirm.trash, deprecate trash.require_confirm (#1887)
* Implement turning off y/n prompt for file deletion

* Refactor different prompt configs to single ui table

* Remove unused fields

* add ui.confirm doc, format/tidy

* trash.require_confirm -> ui.confirm.trash

* Fix nil value trash field

Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-01-08 17:43:01 +11:00
Alexander Courtis
f43f3110a5
feat(event): add TreeAttachedPost (#1877)
* feat(event): add OnAttachPost

* feat(event): add TreeAttachPost

* feat(event): add TreeAttachPost

* feat(event): TreeAttachedPost fired after all mappings created, not just on_attach
2023-01-07 11:50:41 +11:00
Alexander Courtis
bac962caf4
feat(api): add api.config.mappings.active, api.config.mappings.default (#1876)
* feat(api): add config.mappings.current and config.mappings.default

* feat(api): add config.mappings.current and config.mappings.default

* feat(api): add config.mappings.current and config.mappings.default
2023-01-03 13:13:49 +11:00
Richard Li
cdbd7daf29
fix(#1878): nvim frozen on no name buffer when modified.enable (#1879) 2023-01-03 13:11:14 +11:00
Richard Li
951b6e7e55
fix(#1836): add view.debounce_delay (#1871)
* fix(#1836):add view.debounce_delay to avoid some unnecessary explorer reloads

* fixed BufReadPost & BufUnload nil pointer

* update_focused_file.debouce_delay to view.debounce_delay

* changed docs to be more accurate

* added debounce on modified update

* Using same event for filter buffer

* removed unused View.debounce_delay

* changed docs to be more accurate

Co-authored-by: doot <gugegby@gmail.com>
Co-authored-by: Alexander Courtis <alex@courtis.org>
2023-01-02 07:32:56 +11:00
Alexander Courtis
e322fbb80b chore: remove diagnostic suppressions after tidying nits 2023-01-01 13:27:05 +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
youkwhd
9ad93b6ac0
feat(view): add view.cursorline (#1859)
* feat(#1814): added cursorline config to DEFAULT_OPTS

Extends #1814

Currently, the config cursorline is set to `true` by default.

This behaviour can only be changed by a hacky way of listening to an event, as @alex-courtis mentioned that: "The user can change this default if they want via event".

This PR generalizes the configuration to be easier to config via the function `setup()`.

* doc: add cursorline

Co-authored-by: Alexander Courtis <alex@courtis.org>
2022-12-31 15:27:31 +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
9e4c39572f
fix(#1833): do not find file when view is not visible on the current tab (#1845) 2022-12-23 12:47:39 +11:00
Alexander Courtis
fee6801393 fix(diagnostics): do not show on file/dir with same prefix 2022-12-23 12:44:30 +11:00
Richard Li
3000797e53
fix(diagnostics): do not show on file/dir with same prefix (#1832)
* fix diagnostics showing up on file/dir with same prefix

* using fnamemodify instead of gsub
2022-12-23 12:36:23 +11:00
Alexander Courtis
e14c2895b4
fix(#1841): do not refresh on buffer events when not a file buffer (#1843)
> Haven't had time to dig into #1841

No worries at all; there's no hurry.
2022-12-19 17:18:27 +11:00
Alexander Courtis
4fc74ca321 fix(#1841): do not refresh on buffer events when highlight_opened_files is none 2022-12-19 15:45:07 +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
Alexander Courtis
d949af7245 fix(#1804): do not refresh watched nodes that have been destroyed (deleted) 2022-12-19 14:36:42 +11:00
Ross Wilson
e0cfbbb93d
fix(copy-paste): fix message on clipboard clear (#1838)
* Clear clipboard function was calling utils to
  notify when the clipboard was cleared
* This produced a nil value error
* Replaced with notify
2022-12-19 09:59:38 +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
87409bb4af
fix(#1815): don't schedule find_file calls, debounce update_focused_file with 15ms default (#1828)
* Revert "Revert "fix(#1815): don't schedule find_file calls, debounce update_focused_file with 15ms default (#1820)""

This reverts commit a8d26bb088.

* fix(#1723): find_file for externally created new file results in folder unable to be opened

* fix(#1723): find_file for externally created new file results in folder unable to be opened
2022-12-16 15:35:09 +11:00
David Sierra DiazGranados
d85b6718ce
feat(picker): allow custom function actions.open_file.window_picker.picker (#1782)
* feat: allow passing a custom function as a window picker

WIP

* fix: move logic expression to if statement

If `M.window_picker.custom_function()` returns `nil` then `pick_win_id()`
will run (the or part). We don't want that. More verbose, but better.

* feat(open): add window_picker.picker

* feat(open): add window_picker.picker

* style nit

* feat(open): add window_picker.picker

* docs: add window_picker.picker documentation

* docs: add window_picker.picker documentation

Co-authored-by: Alexander Courtis <alex@courtis.org>
2022-12-16 15:14:33 +11:00
Richard Li
18272f8df3
fix(view): refresh opened files highlight on buffer read, unload (#1827) 2022-12-16 14:36:00 +11:00
Anton
e8ea62c198
fix(#1824): Don't modify jumplist when edit_in_place. (#1825) 2022-12-16 14:08:27 +11:00
Alexander Courtis
cdb40dc42e neovim requirement 0.7.0 -> 0.8.0, remove WinSeparator/VertSplit compatibility shims 2022-12-16 13:45:16 +11:00
Ian Homer
949913f186
feat(api): rename_basename API and action (#1791)
* relative rename action

* 🔥 remove debug print statement

* 🐛 better handling of dot files

Also pickout extension in filename with more one dot

* 🔧 keymap e for relative-rename action

* 📝 update help with relative-rename mapping

*  add API for rename_relative

* 🚨 correct lint warnings

* rename_relative -> rename_root

* stylua

* ♻️ use fnamemodify instead of custom logic

* 💥 refactor renaming api using vim filename modifiers

Rename API now supports filename modifiers as arguments, although
only with limited support of options. The function signature however
will allow improvements going forward. The API signature is backward
compatible, although the behviour has changed as per the next comment.

This change changes the default behaviour of the renames, rename_full is
what rename was, rename now just renames the tail (i.e. the filename)

* 🐛 make api rename, without args, functional

*  allow modifier argument to be used in API call

* 📝 update documentation with new command name

* rename-file.fn takes only a modifier as argument

* add Api.fs.rename_basename, specify modifiers for rename, rename_sub

* add Api.fs.rename_node

* rename-file tidy allowed modifiers

* 🐛 fix bugs after last refactoring

rename ":t" and ":t:r" was moving file to root of project and not
maintaining sub-directory

* 🐛 correct absolute rename

which was loosing sub-directory on rename

* 🔥 remove debug print statements

* stylua

Co-authored-by: Alexander Courtis <alex@courtis.org>
2022-12-16 13:32:48 +11:00
Alexander Courtis
a8d26bb088 Revert "fix(#1815): don't schedule find_file calls, debounce update_focused_file with 15ms default (#1820)"
This reverts commit 623cecb809.
2022-12-16 13:15:32 +11:00
Alexander Courtis
623cecb809
fix(#1815): don't schedule find_file calls, debounce update_focused_file with 15ms default (#1820)
* fix(#1815): don't schedule find file calls

* fix(#1815): debounce BufEnter find_file

* fix(#1815): deprecate nvim-tree.find_file

* fix(#1815): debounce BufEnter find_file

* fix(#1815): debounce BufEnter find_file
2022-12-16 13:01:37 +11:00
Alexander Courtis
95ed588211 fix(#549): add more profiling ~tree init 2022-12-16 12:12:06 +11:00
Alexander Courtis
899ed45602 fix(watcher): only purge on subsequent setup calls, add git_purge log 2022-12-16 11:47:50 +11:00
David
0cd8ac4751
fix: Implicit current buf on centralize selection (#1792) 2022-12-12 13:14:41 +01:00
Anton
a2c75567ad
feat(event): add WillRenameNode (#1821) 2022-12-12 11:56:50 +11:00
Alexander Courtis
8b4aaff783 remove legacy g: option migration 2022-12-12 09:50:52 +11:00
Eric Haynes
7177d95ac0
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>
2022-12-11 14:40:38 +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
Anton
e49fa4e529
feat(event): dispatch Event.NodeRenamed on cut-paste (#1817) 2022-12-10 11:29:05 +11:00
rishabhjain9191
69a07d169a
feat(view): always enable cursorline, users may change this behaviour via Event.TreeOpen (#1814)
* Update view.lua

* set cursorline to true
2022-12-10 11:20:40 +11:00
Richard Li
f8489c9929
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
2022-12-03 14:56:38 +11:00
Richard Li
9d9c5711dc
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>
2022-12-03 14:39:00 +11:00
Richard Li
829e9f68e1
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
2022-11-29 11:12:34 +11:00
baahrens
0b319a1b28
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
2022-11-28 11:17:09 +11:00
Alexander Courtis
b17358ff4d
fix(#1731 #1723 #1716): handle all external file system changes (#1757)
* fix(#1731): watcher refreshes node rather than the first node matching absolute path, profile refresh

* fix(#1731): reload explorer reloads closed folders

* fix(#1731): do not fire folder created event on file create

* fix(#1731): reload profile absolute path, not link to

* fix(#1731): find-file locks/profiles on real path, reloads when watchers disabled

* Revert "fix(#1731): reload explorer reloads closed folders"

This reverts commit 5dfd8bd2fa.

* fix(#1731): tidy watch reload

* fix(#1731): move refresh_node from watch to reload

* fix(#1731): find-file reloads all nodes for the containing directory

* fix(#1731): create-file refreshes synchronously

* fix(#1731): remove unused watch node

* fix(#1731): find-file refreshes root

* fix(#1716): create-file invokes find-file

* fix(#1731): refresh path walks down the tree to the targedt
2022-11-26 14:19:09 +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
Ibrahim Abdelkareem
68a2a0971e
feat(diagnostics): add diagnostics.severity (#1755)
* feat: Support diagnostics severity

* fix: Revert Hunk

* feat: Supports min/max severity

* feat: Supports min/max severity: tidy doc

* feat: Supports min/max severity: tidy doc

* feat: Supports min/max severity: tidy doc

Co-authored-by: Alexander Courtis <alex@courtis.org>
2022-11-21 09:09:09 +11:00
Alexander Courtis
cc18122be1 fix(notify): log file notice info->debug 2022-11-20 12:26:59 +11:00
Alexander Courtis
e38e061710 feat(api): add api.tree.get_nodes 2022-11-19 15:54:16 +11:00
Alexander Courtis
a65063cb0a fix(notify): remove unused varargs, log file notice debug->info 2022-11-19 14:34:39 +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
yazdani kiyan
1837751efb fix(paste): allow pasting into empty root directory
assign main explorer when node name is `..` to allow pasting into the
root directory when its empty.
Fixes #1736
2022-11-16 13:41:35 +01:00
yazdani kiyan
059e4cadd6 fix(paste): paste into empty root directory 2022-11-16 13:40:48 +01:00
Alexander Courtis
9d241e5f58 fix(system-open): use notify for system-open failures and tidy messages 2022-11-15 13:01:15 +11:00
Maxim Sokolov
cf908370fb
fix(#1740): Error while running :NvimTreeCollapseKeepBuffers (#1741) 2022-11-13 15:52:44 +11:00
Alexander Courtis
e204a7d819
fix(#1728): escape cwd changes to prevent environment variable expansion (#1729) 2022-11-12 14:50:14 +11:00
Alexander Courtis
bcb2a5a80d
fix(#1720): .git watch only FETCH_HEAD, HEAD, HEAD.lock, config, index (#1732)
* fix(#1720): .git watch only HEAD, config and index

* fix(#1720): .git watch only FETCH_HEAD, HEAD, HEAD.lock, config, index
2022-11-12 14:38:33 +11:00
Alexander Courtis
7e892767bd Revert "fix(#1716): focus file/directory when created in a sub-directory, don't dispatch FolderCreated on file creation (#1722)"
This reverts commit bdc4ec6abd.
2022-11-06 13:32:24 +11:00
Alexander Courtis
d91f885819 Revert "fix(#1723): find_file for externally created new file results in folder unable to be opened"
This reverts commit be2ccd4b1a.
2022-11-06 13:21:24 +11:00
Alexander Courtis
8cc369695b
fix: replace vim.* "requires" with explicit calls to vim functions (#1701) 2022-11-06 10:37:33 +11:00
Tomohiro Endo
6d6a44626d
fix(watcher): failure on watcher teardown message (#1726) 2022-11-06 10:30:12 +11:00
Alexander Courtis
bdc4ec6abd
fix(#1716): focus file/directory when created in a sub-directory, don't dispatch FolderCreated on file creation (#1722)
* fix(#1716): focus file/directory when created in a sub-directory, don't dispatch FolderCreated on file creation

* fix(#1716): focus file/directory when created in a sub-directory

* fix(#1716): focus file/directory when created in a sub-directory
2022-11-06 10:08:32 +11:00
Alexander Courtis
be2ccd4b1a
fix(#1723): find_file for externally created new file results in folder unable to be opened
* fix(#1723): find_file for externally created new file results in folder unable to be opened

* fix(#1723): find_file for externally created new file results in folder unable to be opened
2022-11-05 16:34:41 +11:00
Alexander Courtis
a0f3e99b2d
feat(watcher): tear down watcher on failue, warning the user (#1707) 2022-11-05 10:25:14 +11:00
Alexander Courtis
ed9db632a8
feat(watcher): add filesystem_watchers.ignore_dirs (#1705) 2022-11-05 10:24:25 +11:00
Alexander Courtis
33ce8e3c73
fix(#1711): open in a new window when no window picker and no available window (#1715) 2022-11-05 10:23:03 +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
David Brouwer
ada2c6441d
fix(#1712): invalid window ID on colorscheme (#1714) 2022-11-01 10:04:47 +11:00
wyrid
cd2f7569db
feat(api): add api.marks.clear (#1708) 2022-11-01 08:46:56 +11:00
wyrid
cbb5313f90
feat(api): add api.fs.clear_clipboard (#1706)
* feat: command to clear the clipboard

* feat: command to clear the clipboard: stylua

* feat: command to clear the clipboard: add to :help

Co-authored-by: Alexander Courtis <alex@courtis.org>
2022-10-31 15:48:05 +11:00
Sabu Siyad
fba97517bb
fix(#1679): renderer.full_name correctly shows for one character outside (#1688)
ref: `:h getwininfo()`

Signed-off-by: Sabu Siyad <hello@ssiyad.com>

Signed-off-by: Sabu Siyad <hello@ssiyad.com>
2022-10-31 15:38:09 +11:00
wyrid
3845039c1a
fix: use pcall to prevent live-filter regex errors (#1689)
* fix: use pcall to prevent live-filter regex errors

Wrap live filter's match function in pcall to prevent errors caused by
invalid regex while typing.

* nit: use ok for pcall rc

* nit: stylua fix

Co-authored-by: Alexander Courtis <alex@courtis.org>
2022-10-29 14:22:14 +11:00
Alexander Courtis
dd90bfa155
fix(#1671): split with no window picker will always find an available window (#1677) 2022-10-29 13:42:56 +11:00
kiyan
65c2ba8952 fix(colorscheme): update winhl on colorscheme change
fixes #1696
2022-10-28 14:19:01 +02:00
Alexander Courtis
49c32c0dda Revert "fix(#1676) case insensitive mapping key remove and override (#1682)"
This reverts commit 5a798b3be0.
2022-10-25 08:00:17 +11:00
Ofir Gal
23c0fe9a0a
Added NvimTreeLineNr higlight (#1684) 2022-10-24 19:53:13 +00:00
Alexander Courtis
5a798b3be0
fix(#1676) case insensitive mapping key remove and override (#1682)
* fix(#1676): remove_keymaps matches case insensitively

* fix(#1676): mappings.list.n.key matches case insensitively for overrides
2022-10-24 14:51:07 +11:00
Alexander Courtis
e94f517798 fix(#1675): open-file sanity check mode 2022-10-22 14:40:20 +11:00
Alexander Courtis
2b970635d1 fix(#1668): update issue link 2022-10-18 11:34:26 +11:00
Alexander Courtis
3a2f68b9d5 fix(#1668): revert all startup behaviour changes back to 540055b 2022-10-18 11:14:35 +11:00
Alexander Courtis
4e24505e2b
fix(#1664): respect hijack_directories.enable on startup when not open_on_setup (#1665) 2022-10-17 14:49:57 +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
Ali Almohaya
c995ce0878
fix(#1643): preview on floating window (#1648)
* fix: preview on floating window

* chore: redrawing the tree after setting current win

* chore: ignore winleave autocmd on preview action

* fix: typo in comment

* chore: call correct window id

* chore: revert changes in focus method

* chore: check if float window is enabled before ignoring WinLeave
2022-10-16 12:17:17 +11:00
Alexander Courtis
c446527056
chore(#1649): remove workaround for https://github.com/neovim/neovim/issues/17395 which was fixed in nvim 0.7.0 (#1650) 2022-10-15 13:49:13 +11:00
Alexander Courtis
55aa0062b9 fix(#1270): ensure explorer exists at startup before propagating FS changes 2022-10-15 12:44:59 +11:00
emmanueltouzery
187388b7f5
fix(#1632): autocenter: avoid use of feedkeys (#1632) 2022-10-15 11:10:42 +11:00
Alexander Courtis
c4ac723a83
fix(#1626): obey splitright/below when splitting existing windows (#1641) 2022-10-15 10:22:03 +11:00
Ali Almohaya
b01e7beaa6
fix(#1628): quit_on_open e: do not open in the tree's window (#1637)
* fix: prevent quit_on_open from opening in same window

* chore: remove condition for quit_on_open

* fix: prevent opening file in a new window on floting nvim-tree

* stylua

Co-authored-by: Alexander Courtis <alex@courtis.org>
2022-10-11 10:28:30 +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
kiyan
3d58a9b2cf fix(fs): create file failure when reloading watch path for node
because node can be a file or a symlink.
fixes #1633
2022-10-08 16:11:34 +02:00
kiyan
b4d704e88d chore: replace urls from kyazdani42 -> nvim-tree 2022-10-08 11:31:57 +02:00
emmanueltouzery
79f631bc1d
feat(view): add float.quit_on_focus_loss, float respects actions.open_file.quit_on_open (#1621) 2022-10-08 14:35:20 +11:00
Alexander Courtis
be2b4f58e6
fix(#1615): focus created file when command line prompt requires confirmation (#1622)
* fix(#1615): focus created file when command line prompt requires confirmation

* fix(#1615): focus created file when command line prompt requires confirmation
2022-10-08 14:26:31 +11:00
Alexander Courtis
c5536db0b7
fix(#1270): open_on_setup_file does not override open_on_setup, hijack_directories does not override startup behaviour (#1618) 2022-10-08 14:25:38 +11:00
longguzzz
7282f7de8a
feat: add NvimTreeCursorLineNr (#1616) 2022-10-01 12:51:22 +02:00
rapan931
45d386a359
fix: remove unnecessary conditions (#1614) 2022-09-30 13:37:31 +02:00
kiyan
4aef454cd2 fix(styling): empty line 2022-09-29 13:59:05 +02:00
rapan931
11b524899f
fix: restore eventignore (#1612) 2022-09-29 13:55:24 +02:00
Xyhlon
9914780cba
fix(#1547): pass explicit system arguments to for git toplevel and untracked actions
* the nice fix

* fix(#1547): pass git toplevel cwd unescaped, pass git untracked arguments as per toplevel

Co-authored-by: Maximilian Philipp <philipp@student.tugraz.at>
Co-authored-by: Alexander Courtis <alex@courtis.org>
2022-09-25 12:58:05 +10:00
Alexander Courtis
0417d9148b feat: focus_empty_on_setup 2022-09-22 15:15:03 +10:00
Alexander Courtis
540055be5f
chore: document :NvimTreeFindFile! and add bang :NvimTreeFindFileToggle! 2022-09-22 14:18:49 +10:00
Alexander Courtis
fbd421da71 chore: remove non-functional sides bottom/top 2022-09-22 13:53:09 +10: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
Alexander Courtis
5cb87c037d
fix(#1553): set correct side on vim open directory (#1594) 2022-09-22 09:06:23 +10:00
KuuWang
3676e0b124
feat(sorters): allow user sort_by
* feat: Mixin Sorter (#1565) Self Solved

adding `mixin` sort options for `rust` like package systems

```

package.rs
package/
  __inside__

lib.rs
lib/
  _inside_

a.rs
b.rs
module.rs

```

* feat: sort_by, after_sort options for more convinient using

```
*nvim-tree.sort_by*
Changes how files within the same directory are sorted.
Can be one of 'name', 'case_sensitive', 'modification_time' or 'extension',
'function'.
>
  sort_by = function(a, b)
    if not (a and b) then
      return true
    end
    if a.nodes and not b.nodes then
      return true
    elseif not a.nodes and b.nodes then
      return false
    end

    return a.name:lower() <= b.name:lower()
  end

  end
  Type: `string | function(a, b)`, Default: `"name"`

*nvim-tree.after_sort*
Related to nvim-tree.sort_by, this function runs without mergesort.
Can be defined by your own after-sort works.
  Type: `function(table)`, Default: `disable`

>
  after_sort = function(t)
    local i = 1

    while i <= #t do
      if t[i] and t[i].nodes then
        local j = i + 1
        while j <= #t do
          if t[j] and not t[j].nodes and t[i].name:lower() == t[j].name:lower():match "(.+)%..+$" then
            local change_target = t[j]
            table.remove(t, j)
            table.insert(t, i, change_target)
            break
          end
          j = j + 1
        end
      end
      i = i + 1
    end
  end

```

* remove: after_sort ( misunderstood feature )

sort_by parameter can be function.

``` lua
  sort_by = function(t)
    local sorters = require "nvim-tree.explorer.sorters"
    local comparator = sorters.retrieve_comparator("name")
    sorters.split_merge(t, 1, #t, comparator) -- run default merge_sort
    local i = 1

    while i <= #t do
      if t[i] and t[i].nodes then
        local j = i + 1
        while j <= #t do
          if t[j] and not t[j].nodes and t[i].name:lower() == t[j].name:lower():match "(.+)%..+$" then
            local change_target = t[j]
            table.remove(t, j)
            table.insert(t, i, change_target)
            break
          end
          j = j + 1
        end
      end
      i = i + 1
    end
  end,

```

* try-fix: change existing merge_sort function, call user's sort_by

hope.. like it...?

* doc: explain function parameter and return, add more complex example

* fix: reorder with user-comparator exceed memory limit

apply merge_sort
check nil & type for senitize

* fix: user_index based sorting ( create index )

for performance, create index once,
using index to re-ordering

* fix: fence problems

* doc & fix: merge_sort problem fix & nil sorting

add complex example

* fix: sort_by detect and use string and nil

* doc: revert sort_by to simple

* fix: sort_by does not return anything

Co-authored-by: Alexander Courtis <alex@courtis.org>
2022-09-18 16:00:49 +10:00
Alexander Courtis
e282420111
fix(#1564): reset &bufhidden when opening an existing (maybe previewed) buffer (#1573) 2022-09-05 10:10:58 +10:00
ADoyle
951e10a64e
fix(#1568): show relative path of symlink destination (#1569) 2022-09-04 12:23:56 +10:00
Krzysztof Cieśla
d753a1da9a
fix(view): file filter and info popup above floating view
Co-authored-by: Krzysztof Cieśla <krzysztof.marcin.ciesla@cern.ch>
2022-09-03 14:29:18 +10:00
Mivort
e8bf3d778a
feat(renderer): add renderer.indent_width (#1505)
* feat: add config option for a tree indent width

add 'indent_width' option to configure visible indent for tree nesting
levels (default is 2).

* add 'bottom' char for a corner extension

* apply stylua formatting

* provide value constraints in documentation

* limit minimal indent width

* make marker symbols have one utf8 char width

* match stylua formatting

* add the commentary regarding utf-8 first symbol match
2022-08-30 09:44:30 +10:00
Bryan Baron
757951ba6b
feat(view): floating window's optional adaptive size specification (#1559) 2022-08-30 08:50:18 +10:00
Krzysztof Cieśla
07f59e7450
fix(#1539): Fix closing nvim-tree float when file is removed (#1546)
* Fix closing nvim-tree float when file is removed

* Revert changes for non-float

Co-authored-by: Krzysztof Cieśla <krzysztof.marcin.ciesla@cern.ch>
2022-08-30 08:47:13 +10:00
Piotr Doan
4a725c0ca5
fix(#1555): incorrect exe highlight in Windows filesystem from WSL (#1557) 2022-08-29 10:53:23 +10:00
Krzysztof Cieśla
ce5d0a6b7d
fix(#1543): Do not resize nvim-tree window if float is enabled (#1556)
Co-authored-by: Krzysztof Cieśla <krzysztof.marcin.ciesla@cern.ch>
2022-08-27 13:36:26 +10:00
Alexander Courtis
c272c88daf fix(#1551): handle git status TT as staged 2022-08-27 11:58:16 +10:00
Alexander Courtis
c3ea264947
feat(view): allow function for view.float.open_win_config (#1538) 2022-08-23 17:14:23 +10:00
Alexander Courtis
259efeee62 fix(#1540): watcher ignore directories with name exactly '.git' 2022-08-23 10:29:45 +10:00
Alexander Courtis
e3353c4cb4
fix(#1529): ensure tree window exists before closing (#1537) 2022-08-22 16:58:41 +10:00
Sebastian Volland
90dcf42bba
fix(#1533): make toggle_mark ignore non-togglable nodes. (#1534) 2022-08-22 14:24:25 +10:00
Sebastian Volland
049cdd3073
fix(#1518): sort_by=modification_time not reordering on refresh. (#1519) 2022-08-22 14:19:06 +10:00
Sebastian Volland
c5fba1ec18
fix(#1520): file type changes are not detected. (#1521) 2022-08-22 11:41:11 +10:00
Alexander Courtis
81eb718394 fix: inverted diagnostic navigation keymaps 2022-08-20 14:40:09 +10:00
Jonathan Gollnick
9fd7b7ae29
fix(#1514): inverted git navigation keymaps (#1515) 2022-08-20 14:37:51 +10:00
Alexander Courtis
d9edddb849
fix(#1503): focus last win before close (#1509) 2022-08-20 14:32:28 +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
Carlos Castillo
b314b3a699
fix(#1500): focusing directories with a trailing slash in their path doesn't work (#1501) 2022-08-14 15:00:04 +10:00
Alexander Courtis
261a5c380c
fix(#1480): break symlink cycle on find-file, search-node (#1482)
* fix(#1480): break symlink cycle on find-file

* fix(#1480): break symlink cycle on search-node

* fix(#1480): break symlink cycle on search-node

* fix(#1480): break symlink cycle on find-file
2022-08-08 12:46:09 +10:00
Hoang Nguyen
a73d0d4800
feat(file-popup): add actions.file_popup.open_win_config
* file-popup: add nvim_open_win configuration

* docs: update file-popup configuration
2022-08-08 10:52:14 +10:00
Alexander Courtis
ff6e7966f3 fix(#1484): better error handling in git utils get_toplevel 2022-08-07 12:16:03 +10:00
Krzysztof Cieśla
7323c81bd6
feat(view): Floating nvim tree window #1377 (#1462)
* Simple mock-up of floating nvim-tree window

* Passing whole table to nvim_open_win()

* Run update-help.sh

* Use vim.api alias

* Add comment to float options

* Added `anchor` to float options

* Enabling float window enforces `actions.open_file.quit_on_open`

* Added documentation

* add view.float.open_win_config, skipping validation

* Made nvim-tree window closes when float is enabled

* Close nvim-tree window when out of focus

* Update help

Co-authored-by: Krzysztof Cieśla <krzysztof.marcin.ciesla@cern.ch>
Co-authored-by: Alexander Courtis <alex@courtis.org>
2022-08-06 15:40:07 +10:00
Alexander Courtis
1685484738
doc: reinstate mapping doc, mark on_attach as experimental (#1481) 2022-08-02 13:59:51 +02:00
Alexander Courtis
cfc4692a3f fix(#1479): apply remove_keymaps to default mappings 2022-08-02 09:29:57 +10:00
kiyan
451901ca9c chore(keymap): extract filtering into function 2022-07-31 12:32:55 +02:00
kiyan
9bbf95e616 fix(keymaps): get_keymaps takes remove_keymaps as parameter 2022-07-30 10:50:10 +02: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
Austin Harris
7fcb48c852
feat: add option for folder arrows to be inline with indent markers (#1468) 2022-07-28 11:49:23 +02:00
kiyan
ac90664001 fix(watchers): disable watchers on kernel filesystems
fixes #1465
2022-07-28 11:45:47 +02:00
Kian-Meng Ang
2928f8fe31
fix(docs): typos (#1470) 2022-07-27 13:48:14 +02:00
kiyan
e632ac7c81 fix(create-file): when node is nil, create the file at root
fixes #1467
2022-07-27 09:33:01 +02:00
Kiyan
64cc3c17e1
feat(mapping): deprecate user mappings and add on_attach (#1424) 2022-07-26 11:09:39 +02:00
kiyan
5f30a7bee4 chore(config): enable filesystem watchers by default 2022-07-26 10:46:59 +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
e5222970d9 chore(api): add missing functions 2022-07-25 15:02:55 +02:00
kiyan
e95bfbfc2d fix(api): use copy.node instead of copy.name
ref #1461
2022-07-25 14:35:01 +02:00
kiyan
a0448184af fix(api): copy is a table, copy -> copy.name
fixes #1461
2022-07-25 13:38:28 +02:00
Alexander Courtis
86b9da5ca5
chore(git): get_project_root cache cwd_to_project_root after checking existence (#1457) 2022-07-25 11:27:12 +02:00
Kiyan
e7832785d2
feat(api): add public API module (#1432) 2022-07-25 11:11:48 +02:00
John Fred Fadrigalan
d927e89aa9
refactor(actions): remove linefeed on info messages. (#1450) 2022-07-22 10:10:58 +02:00
kiyan
79434c2b3c feat(tab_change): introduce new option to filter buffer by bufname or ft
Also fixes changing tab by deferring the call on tab enter.
New option `ignore_buf_on_tab_change` to avoid opening for some tabs.
Some example could be neogit, vim fugitive, man pages ...
2022-07-21 11:14:40 +02:00
FotiadisM
1e3c578eeb
fix: count unicode codepoints instead of bytes (#1445) 2022-07-20 23:05:44 +02:00
kiyan
630305c233 fix(executable): prevent nil extensions in executable check
fix on windows
fixes #1444
2022-07-19 14:11:53 +02:00
yehy4
c964fa24d0
fix(git): fix inverted condition logic introduced in #1433 (#1443) 2022-07-19 11:48:32 +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
Klesh Wong
b754eb8359
fix(explorer): reload executable stat (#1427) 2022-07-19 11:25:41 +02:00
Alexander Courtis
f85b4d9952
chore(git): profile git toplevel and untracked calls (#1435) 2022-07-19 17:44:24 +10:00
yehy4
203bb7e176
fix(git): prevent execution of git commands when git integration is disabled (#1433) 2022-07-19 17:44:05 +10:00
Alexander Courtis
ecca8118f8 doc: remove fs_poll interval and update doc 2022-07-19 09:39:03 +10:00
kiyan
2edbe759cd fix(open-file): vim.op -> vim.opt 2022-07-18 15:44:52 +02:00
kiyan
ba5c18dc2b feat: add confirmation kind to select y/n 2022-07-18 14:38:32 +02:00
kiyan
1018a83e10 fix(create-file): pass file in parameter 2022-07-18 14:34:10 +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
2d629cab78 feat(remove-file): use vim.ui.select 2022-07-18 14:28:08 +02:00
kiyan
7cffe14743 feat(trash): use vim.ui.select for confirmation 2022-07-18 14:25:52 +02:00
kiyan
1b667bc99e feat(search-node): use vim.ui.input 2022-07-18 14:20:55 +02:00
kiyan
69aec67edb feat(copy-paste): use vim.ui from prompting 2022-07-18 14:17:25 +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
kiyan
ec530e73be fix(wipe): wipe all nvim-tree rogue buffers
also prevent find_file if bufnr is not valid
fixes #1438
2022-07-18 13:29:56 +02:00
Alexander Courtis
16753d5e25 doc: add help hint to invalid config warning 2022-07-18 10:13:16 +10: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
26512c369f
feat(marks): add bulk move action (#1419) 2022-07-17 08:25:11 +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
b32c88333f
feat(movement): allow circular movement for sibling next and prev (#1416) 2022-07-16 10:39:24 +02:00
kiyan
449b5bd0cb fix(renderer): padding indent with folders only 2022-07-15 18:09:28 +02:00