From 800527d6625586e2bf489e9308bf1131527b1730 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 19 Jul 2017 20:53:50 +1200 Subject: [PATCH] Fix chktex line splitting format on Windows (#29) 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. --- lib/linter-chktex.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/linter-chktex.coffee b/lib/linter-chktex.coffee index 53a4dfe..f37e088 100644 --- a/lib/linter-chktex.coffee +++ b/lib/linter-chktex.coffee @@ -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 @@ -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