Skip to content

Commit

Permalink
Fix chktex line splitting format on Windows (nscaife#29)
Browse files Browse the repository at this point in the history
Adding a second '\\n' to the chktex format allows the splitter to distinguish between an end-of-line sequence and a Windows pathname (e.g. "c:\thesis\new_introduction.tex".

It will still break if your directory is named 'n', but that's a much less likely case than starting a file with that letter.

Should continue to be compatible with Unix-style paths.
  • Loading branch information
DrCuriosity authored Jul 19, 2017
1 parent fcb272f commit 800527d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/linter-chktex.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module.exports =
return []

lintFile: (filePath) ->
args = [filePath, '-q', '-I0', '-f%f:%l:%c:%d:%k:%n:%m\\n']
args = [filePath, '-q', '-I0', '-f%f:%l:%c:%d:%k:%n:%m\\n\\n']
if chktexArgs
for x in chktexArgs
args.push x
Expand All @@ -74,7 +74,7 @@ module.exports =
else
xcache.set(rawRegex, regex = XRegExp(rawRegex))
#for line in output.split(/\r?\n/)
for line in output.split('\\n')
for line in output.split('\\n\\n')
match = XRegExp.exec(line, regex)
if match
# console.log 'file ' + match.file
Expand Down

0 comments on commit 800527d

Please sign in to comment.