Skip to content

Windows support #1

@jmbeach

Description

@jmbeach

I'm on Windows and this code works for me. Requires cygwin.

function FixXML()
  "save and run xmllint on our file saving output
  let tempfile = tempname()
  exec "sav! " . tempfile
  let outfile = tempname()
	let command = "C:\\cygwin\\bin\\xmllint.exe --format " . tempfile . " > " . outfile . " && C:\\cygwin\\bin\\echo.exe -n %errorlevel%"
  let result = system(command)
	echo result
  if result == "0" 
		"delete everything
		1,$delete
		"replace it with the result of xmllint
		exec "read ++edit" . outfile
		"delete the blank line at the top
		1,1delete
		redraw!
  else
		let clean_result = substitute(result, tempfile, "Error", 'g')
		echo clean_result
  endif
endfunction

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions