Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Fix for chktex line splitting format on Windows #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DrCuriosity
Copy link

@DrCuriosity DrCuriosity commented Jul 19, 2017

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.

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
Copy link
Owner

nscaife commented Jul 19, 2017

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
Copy link
Author

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants