Commit Graph

930 Commits

Author SHA1 Message Date
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