Skip to content

Commit 295acb2

Browse files
authored
Merge pull request #96 from bjagg/jsbeautify-javascript-to-js
fix(js-beautify): Use correct type for javascript filetype.
2 parents 8bae55b + 8e54240 commit 295acb2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

autoload/codefmt/jsbeautify.vim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ function! codefmt#jsbeautify#GetFormatter() abort
4141
" @throws ShellError
4242
function l:formatter.FormatRange(startline, endline) abort
4343
let l:cmd = [s:plugin.Flag('js_beautify_executable'), '-f', '-']
44-
if &filetype != ""
44+
if &filetype is# 'javascript' || &filetype is# 'json'
45+
let l:cmd = l:cmd + ['--type', 'js']
46+
elseif &filetype != ""
4547
let l:cmd = l:cmd + ['--type', &filetype]
4648
endif
4749

0 commit comments

Comments
 (0)