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.
473
473
show_on_open_dirs = true,
474
474
disable_for_dirs = {},
475
475
timeout = 400,
476
+ cygwin_support = false,
476
477
},
477
478
diagnostics = {
478
479
enable = false,
@@ -1118,6 +1119,10 @@ Kills the git process after some time if it takes too long.
1118
1119
Git integration will be disabled after 10 git jobs exceed this timeout.
1119
1120
Type: `number ` , Default: `400 ` (ms)
1120
1121
1122
+ *nvim-tree.git.cygwin_support*
1123
+ Use `cygpath` if available to resolve paths for git.
1124
+ Type: `boolean ` , Default: `false`
1125
+
1121
1126
==============================================================================
1122
1127
5.8 OPTS: DIAGNOSTICS *nvim-tree-opts-diagnostics*
1123
1128
Original file line number Diff line number Diff line change @@ -496,6 +496,7 @@ local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
496
496
show_on_open_dirs = true ,
497
497
disable_for_dirs = {},
498
498
timeout = 400 ,
499
+ cygwin_support = false ,
499
500
},
500
501
diagnostics = {
501
502
enable = false ,
@@ -794,6 +795,7 @@ function M.setup(conf)
794
795
require (" nvim-tree.diagnostics" ).setup (opts )
795
796
require (" nvim-tree.explorer" ).setup (opts )
796
797
require (" nvim-tree.git" ).setup (opts )
798
+ require (" nvim-tree.git.utils" ).setup (opts )
797
799
require (" nvim-tree.view" ).setup (opts )
798
800
require (" nvim-tree.lib" ).setup (opts )
799
801
require (" nvim-tree.renderer" ).setup (opts )
Original file line number Diff line number Diff line change 1
- local M = {}
2
1
local log = require " nvim-tree.log"
3
2
local utils = require " nvim-tree.utils"
4
3
5
- local has_cygpath = vim .fn .executable " cygpath" == 1
4
+ local M = {
5
+ use_cygpath = false ,
6
+ }
6
7
7
8
--- Retrieve the git toplevel directory
8
9
--- @param cwd string path
@@ -35,7 +36,7 @@ function M.get_toplevel(cwd)
35
36
-- git always returns path with forward slashes
36
37
if vim .fn .has " win32" == 1 then
37
38
-- msys2 git support
38
- if has_cygpath then
39
+ if M . use_cygpath then
39
40
toplevel = vim .fn .system (" cygpath -w " .. vim .fn .shellescape (toplevel ))
40
41
if vim .v .shell_error ~= 0 then
41
42
return nil , nil
@@ -112,4 +113,10 @@ function M.file_status_to_dir_status(status, cwd)
112
113
return r
113
114
end
114
115
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
+
115
122
return M
You can’t perform that action at this time.
0 commit comments