Skip to content

Commit

Permalink
xmllint fixer must read from stdin - not buffer filename
Browse files Browse the repository at this point in the history
The current xmllint fixer reads and formats the file that a buffer is
associated with from disk instead of accepting input from stdin. This
has the side effect that if the filename is changed in the buffer, but
not saved yet, the fixer discards all the pending changes and replaces
the buffer contents with the formatted text from the file contents on
disk.
  • Loading branch information
cyberang3l committed Dec 22, 2024
1 parent 65b49c1 commit bb21cf7
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions autoload/ale/fixers/xmllint.vim
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,8 @@ call ale#Set('xml_xmllint_indentsize', 2)

function! ale#fixers#xmllint#Fix(buffer) abort
let l:executable = ale#Escape(ale#Var(a:buffer, 'xml_xmllint_executable'))
let l:filename = bufname(a:buffer)

if empty(l:filename)
let l:filename = '%t'
else
let l:filename = ale#Escape(l:filename)
endif

let l:command = l:executable . ' --format ' . l:filename
let l:command = l:executable . ' --format -'

let l:indent = ale#Var(a:buffer, 'xml_xmllint_indentsize')

Expand Down

0 comments on commit bb21cf7

Please sign in to comment.