mirror of
https://github.com/We-Dont-Byte/Mind_Reader.git
synced 2024-11-15 03:35:59 +00:00
leading spaces alternative method
Added an alternative method for calculating the leading spaces instead of taking the index of the first non-whitespace character. Leaving it commented out, but still there as an alternative in-case something goes wrong w/ the index method.
This commit is contained in:
parent
cfcbfd43fc
commit
6915cd5b44
@ -82,6 +82,7 @@ function getLeadingSpaces() {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let numSpaces = textLine.firstNonWhitespaceCharacterIndex;
|
let numSpaces = textLine.firstNonWhitespaceCharacterIndex;
|
||||||
|
// let numSpaces = textLine.text.length - textLine.text.trimStart().length; // Alternative method, same result by calculating the leading spaces
|
||||||
vscode.window.showInformationMessage("Line Number " + lineNum.toString() + " Has " + numSpaces.toString()+ " Leading Spaces ");
|
vscode.window.showInformationMessage("Line Number " + lineNum.toString() + " Has " + numSpaces.toString()+ " Leading Spaces ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user