Skip to content

Commit

Permalink
hotfix(editor_limit): wrong quotas for chars
Browse files Browse the repository at this point in the history
  • Loading branch information
JannisDommer committed Dec 13, 2023
1 parent b1e588f commit 2fbb6e9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions WebSocketClient/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export const startUvlClient = async () => {
return;
}
const lineCount = model?.getLineCount();
let numberLines = aggregateCharacters(model);
let numberCharacters = aggregateCharacters(model);

if (lineCount && lineCount > config.MAX_NUMBER_LINES) {
if (lineCount > config.MAX_NUMBER_LINES + 1) {
Expand All @@ -252,15 +252,15 @@ export const startUvlClient = async () => {
if (connectionText) {
displayEditorErrorAtContent(editor, `The Editor only allows content up to ${config.MAX_NUMBER_LINES} Lines!`);
}
} else if (numberLines > config.MAX_NUMBER_LINES) {
if (numberLines > config.MAX_NUMBER_LINES + 1) {
} else if (numberCharacters > config.MAX_NUMBER_CHARACTERS) {
if (numberCharacters > config.MAX_NUMBER_CHARACTERS + 1) {
vscode.commands.executeCommand("undo");
}
else {
vscode.commands.executeCommand("deleteLeft");
}
if (connectionText) {
displayEditorErrorAtContent(editor, `The Editor only allows content up to ${config.MAX_NUMBER_LINES} Characters!`);
displayEditorErrorAtContent(editor, `The Editor only allows content up to ${config.MAX_NUMBER_CHARACTERS} Characters!`);
}
}
debouncedSave();
Expand Down

0 comments on commit 2fbb6e9

Please sign in to comment.