nscaife / linter-chktex

An Atom Linter plugin for LaTeX, using chktex
https://atom.io/packages/linter-chktex
MIT License
14 stars 10 forks source link

Fix for chktex line splitting format on Windows #42

Open DrCuriosity opened 7 years ago

DrCuriosity commented 7 years ago

For #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.

nscaife commented 7 years ago

Thanks for this. As a side note, it looks like chktex prints a literal \n instead of a newline when running at the command line.

I originally thought it might be more robust to replace it with a character that's invalid on NTFS, like |, but now I am curious if there's a better solution, because there might be some weird edge cases on other platforms. The plugin parses the filename from the chktex output, but we already know the filename from the editor. It might be just as simple to feed the original filename from the editor back into the message.

DrCuriosity commented 7 years ago

That sounds reasonable. Maybe swap the initial %f: out for some kind of placeholder (e.g. lchk:), update rawRegex accordingly, and just pass your initial filePath argument through in toReturn?