mirror of
https://github.com/We-Dont-Byte/Mind_Reader.git
synced 2024-11-15 03:35:59 +00:00
fixed plural output logic
Fixed logic of output, was showing singular for '0' ie: '0 space' instead of '0 spaces' - This has been resolved.
This commit is contained in:
parent
88ddcd7c51
commit
125cf15a68
@ -73,8 +73,8 @@ function getIndent() {
|
|||||||
};
|
};
|
||||||
let i = pl.Lexer.getIndent(textLine.text, tabFmt);
|
let i = pl.Lexer.getIndent(textLine.text, tabFmt);
|
||||||
|
|
||||||
// Ternary operator to change the tense of 'indent' to 'indents' for the output if i is greater than 1
|
/* Ternary operator to change the tense of 'indent' to 'indents' for the output if i is 0 or greater than 1 */
|
||||||
(i > 1) ?
|
(i !== 1) ?
|
||||||
vscode.window.showInformationMessage(`Line ${lineNum.toString()}: ${i.toString()} indents`):
|
vscode.window.showInformationMessage(`Line ${lineNum.toString()}: ${i.toString()} indents`):
|
||||||
vscode.window.showInformationMessage(`Line ${lineNum.toString()}: ${i.toString()} indent`);
|
vscode.window.showInformationMessage(`Line ${lineNum.toString()}: ${i.toString()} indent`);
|
||||||
}
|
}
|
||||||
@ -120,8 +120,8 @@ function getLeadingSpaces() {
|
|||||||
pl.Lexer.getLeadingSpacesByArithmetic(textLine) :
|
pl.Lexer.getLeadingSpacesByArithmetic(textLine) :
|
||||||
pl.Lexer.getLeadingSpacesByIndex(textLine);
|
pl.Lexer.getLeadingSpacesByIndex(textLine);
|
||||||
|
|
||||||
/* Ternary operator to change the tense of 'space' to 'spaces' for the output if numSpaces is greater than 1 */
|
/* Ternary operator to change the tense of 'space' to 'spaces' for the output if numSpaces is 0 or greater than 1 */
|
||||||
(numSpaces > 1) ?
|
(numSpaces !== 1) ?
|
||||||
vscode.window.showInformationMessage(`Line ${lineNum.toString()}: ${numSpaces.toString()} spaces`):
|
vscode.window.showInformationMessage(`Line ${lineNum.toString()}: ${numSpaces.toString()} spaces`):
|
||||||
vscode.window.showInformationMessage(`Line ${lineNum.toString()}: ${numSpaces.toString()} space`);
|
vscode.window.showInformationMessage(`Line ${lineNum.toString()}: ${numSpaces.toString()} space`);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user