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

Commitb9d7f56

Browse files
authored
Use FindNearestFileOrDirectory, perl languageserver (#5038)
Update to use mentioned function to find both .git/ directories and .gitworktree files.Co-authored-by: cos <cos>
1 parent6d8e4a6 commitb9d7f56

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎ale_linters/perl/languageserver.vim‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function! ale_linters#perl#languageserver#GetProjectRoot(buffer) abort
99
" Makefile.PL, https://perldoc.perl.org/ExtUtils::MakeMaker
1010
" Build.PL, https://metacpan.org/pod/Module::Build
1111
" dist.ini, https://metacpan.org/pod/Dist::Zilla
12-
letl:potential_roots= ['Makefile.PL','Build.PL','dist.ini','.git' ]
12+
letl:potential_roots= ['Makefile.PL','Build.PL','dist.ini' ]
1313

1414
forl:rootinl:potential_roots
1515
letl:project_root=ale#path#FindNearestFile(a:buffer,l:root)
@@ -19,6 +19,12 @@ function! ale_linters#perl#languageserver#GetProjectRoot(buffer) abort
1919
endif
2020
endfor
2121

22+
letl:project_root=ale#path#FindNearestFileOrDirectory(a:buffer,'.git')
23+
24+
if!empty(l:project_root)
25+
returnfnamemodify(l:project_root .'/',':p:h:h')
26+
endif
27+
2228
returnfnamemodify(expand('#' .a:buffer .':p:h'),':p:h')
2329
endfunction
2430

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp