Skip to content

Commit

Permalink
Fix cwd setting to use .stylua.toml if stylua.toml is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
ponko2 committed Jan 12, 2025
1 parent 6c337ad commit 76ed800
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions autoload/ale/fixers/stylua.vim
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ function! ale#fixers#stylua#GetCwd(buffer) abort
for l:possible_configfile in ['stylua.toml', '.stylua.toml']
let l:config = ale#path#FindNearestFile(a:buffer, l:possible_configfile)

return !empty(l:config) ? fnamemodify(l:config, ':h') : '%s:h'
if !empty(l:config)
return fnamemodify(l:config, ':h')
endif
endfor

return ''
return '%s:h'
endfunction

function! ale#fixers#stylua#Fix(buffer) abort
Expand Down

0 comments on commit 76ed800

Please sign in to comment.