-
Notifications
You must be signed in to change notification settings - Fork 536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix #4474 #4475
fix #4474 #4475
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution.
src/lint/latex-formatter/tex-fmt.ts
Outdated
|
||
// remove extra newline at the end | ||
if (edits) { | ||
edits.newText = edits.newText.replace(/\n$/, '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... and remove the new line char accordingly.
src/lint/latex-formatter/tex-fmt.ts
Outdated
@@ -43,9 +43,13 @@ async function formatDocument(document: vscode.TextDocument, range?: vscode.Rang | |||
}) | |||
}) | |||
|
|||
process.stdin?.write(document.getText(range)) | |||
// write the document to the process, and add a newline at the end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this is a workaround of an external piece of software, please add corresponding documents describing the date, version of tex-fmt, and the context of the workaround.
I have corrected the code, but I am unsure whether it is appropriate to write the documentation directly as comments within the code. |
By adding an extra "\n" at the end of the input text and remove it after using
tex-fmt
, the problem is solved.