File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed
Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -473,6 +473,7 @@ Following is the default configuration. See |nvim-tree-opts| for details.
473473 show_on_open_dirs = true,
474474 disable_for_dirs = {},
475475 timeout = 400,
476+ cygwin_support = false,
476477 },
477478 diagnostics = {
478479 enable = false,
@@ -1118,6 +1119,10 @@ Kills the git process after some time if it takes too long.
11181119Git integration will be disabled after 10 git jobs exceed this timeout.
11191120 Type: `number ` , Default: `400 ` (ms)
11201121
1122+ *nvim-tree.git.cygwin_support*
1123+ Use `cygpath` if available to resolve paths for git.
1124+ Type: `boolean ` , Default: `false`
1125+
11211126==============================================================================
11221127 5.8 OPTS: DIAGNOSTICS *nvim-tree-opts-diagnostics*
11231128
Original file line number Diff line number Diff line change @@ -496,6 +496,7 @@ local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
496496 show_on_open_dirs = true ,
497497 disable_for_dirs = {},
498498 timeout = 400 ,
499+ cygwin_support = false ,
499500 },
500501 diagnostics = {
501502 enable = false ,
@@ -794,6 +795,7 @@ function M.setup(conf)
794795 require (" nvim-tree.diagnostics" ).setup (opts )
795796 require (" nvim-tree.explorer" ).setup (opts )
796797 require (" nvim-tree.git" ).setup (opts )
798+ require (" nvim-tree.git.utils" ).setup (opts )
797799 require (" nvim-tree.view" ).setup (opts )
798800 require (" nvim-tree.lib" ).setup (opts )
799801 require (" nvim-tree.renderer" ).setup (opts )
Original file line number Diff line number Diff line change 1- local M = {}
21local log = require " nvim-tree.log"
32local utils = require " nvim-tree.utils"
43
5- local has_cygpath = vim .fn .executable " cygpath" == 1
4+ local M = {
5+ use_cygpath = false ,
6+ }
67
78--- Retrieve the git toplevel directory
89--- @param cwd string path
@@ -35,7 +36,7 @@ function M.get_toplevel(cwd)
3536 -- git always returns path with forward slashes
3637 if vim .fn .has " win32" == 1 then
3738 -- msys2 git support
38- if has_cygpath then
39+ if M . use_cygpath then
3940 toplevel = vim .fn .system (" cygpath -w " .. vim .fn .shellescape (toplevel ))
4041 if vim .v .shell_error ~= 0 then
4142 return nil , nil
@@ -112,4 +113,10 @@ function M.file_status_to_dir_status(status, cwd)
112113 return r
113114end
114115
116+ function M .setup (opts )
117+ if opts .git .cygwin_support then
118+ M .use_cygpath = vim .fn .executable " cygpath" == 1
119+ end
120+ end
121+
115122return M
You can’t perform that action at this time.
0 commit comments