Skip to content

Commit

Permalink
Fix crash for \begin/\end without argument
Browse files Browse the repository at this point in the history
  • Loading branch information
me-johnomar authored and valentjn committed Jan 27, 2021
1 parent b4509e4 commit 24c99df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- Disable `UPPERCASE_SENTENCE_START` in BibT<sub>E</sub>X files (see [vscode-ltex#211](https://github.com/valentjn/vscode-ltex/issues/211))
- Move rule ID to the end of diagnostic messages as VS Code truncates the messages if the Problems panel is narrow (fixes [vscode-ltex#233](https://github.com/valentjn/vscode-ltex/issues/233))
- Fix regression that messages of possible spelling mistakes are not prepended with the respective unknown words (see [vscode-ltex#161](https://github.com/valentjn/vscode-ltex/issues/161))
- Fix crash when using `\begin` or `\end` without an argument (fixes [vscode-ltex#236](https://github.com/valentjn/vscode-ltex/issues/236))

## 9.1.0 (January 24, 2021)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,8 @@ public LatexAnnotatedTextBuilder addCode(String code) {
addMarkup(command);

String argument = matchFromPosition(argumentPattern);
String environmentName = argument.substring(1, argument.length() - 1);
String environmentName = ((argument.length() >= 2)
? argument.substring(1, argument.length() - 1) : "");
String interpretAs = "";

if (mathEnvironments.contains(environmentName)) {
Expand Down

0 comments on commit 24c99df

Please sign in to comment.