Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit915e36a

Browse files
author
skywind3000
committed
Add detection for file paths in NvimTree and defx plugins, and adjust handling for oil file paths in asyncrun#locator#nofile_buffer_path function
1 parent44a5e8a commit915e36a

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

‎autoload/asyncrun/locator.vim‎

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,19 +105,34 @@ function! asyncrun#locator#nofile_buffer_path() abort
105105
catch
106106
endtry
107107
endtry
108+
elseif &ft=='NvimTree'
109+
try
110+
lett=luaeval('require("nvim-tree.api").tree.get_nodes().absolute_path')
111+
returnt
112+
catch
113+
endtry
114+
elseif &ft=='defx'
115+
ifexists('b:defx')
116+
try
117+
lett=b:defx.paths[0]
118+
returnt
119+
catch
120+
endtry
121+
endif
108122
endif
109123
ifexists('b:git_dir')
110124
returnb:git_dir
111125
endif
112-
endif
113-
if &ft=='oil'&& &bt!=''
114-
let name=bufname('%')
115-
if name=~'\v^oil\:[\\\/][\\\/]'
116-
lett=strpart(name,s:windows?7 :6)
117-
ifs:windows&&t=~'\v^\w[\\\/]'
118-
lett=strpart(t,0,1) .':' .strpart(t,1)
126+
elseif &bt!=''
127+
if &ft=='oil'
128+
let name=bufname('%')
129+
if name=~'\v^oil\:[\\\/][\\\/]'
130+
lett=strpart(name,s:windows?7 :6)
131+
ifs:windows&&t=~'\v^\w[\\\/]'
132+
lett=strpart(t,0,1) .':' .strpart(t,1)
133+
endif
134+
returnt
119135
endif
120-
returnt
121136
endif
122137
endif
123138
return''

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp