mirror of
				https://github.com/We-Dont-Byte/Mind_Reader.git
				synced 2025-02-04 10:38:42 +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:
		@@ -73,8 +73,8 @@ function getIndent() {
 | 
			
		||||
            };
 | 
			
		||||
            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
 | 
			
		||||
            (i > 1) ?
 | 
			
		||||
            /* Ternary operator to change the tense of 'indent' to 'indents' for the output if i is 0 or greater than 1 */
 | 
			
		||||
            (i !== 1) ?
 | 
			
		||||
            vscode.window.showInformationMessage(`Line ${lineNum.toString()}: ${i.toString()} indents`):
 | 
			
		||||
                vscode.window.showInformationMessage(`Line ${lineNum.toString()}: ${i.toString()} indent`);
 | 
			
		||||
        }
 | 
			
		||||
@@ -120,8 +120,8 @@ function getLeadingSpaces() {
 | 
			
		||||
                pl.Lexer.getLeadingSpacesByArithmetic(textLine) :
 | 
			
		||||
                pl.Lexer.getLeadingSpacesByIndex(textLine);
 | 
			
		||||
 | 
			
		||||
            /* Ternary operator to change the tense of 'space' to 'spaces' for the output if numSpaces is greater than 1 */
 | 
			
		||||
            (numSpaces > 1) ?
 | 
			
		||||
            /* Ternary operator to change the tense of 'space' to 'spaces' for the output if numSpaces is 0 or greater than 1 */
 | 
			
		||||
            (numSpaces !== 1) ?
 | 
			
		||||
            vscode.window.showInformationMessage(`Line ${lineNum.toString()}: ${numSpaces.toString()} spaces`):
 | 
			
		||||
                vscode.window.showInformationMessage(`Line ${lineNum.toString()}: ${numSpaces.toString()} space`);
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user