-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Whitespace at beginning of line throws of syntax highlighting #11
Comments
I’m not sure if leading white space is valid in the todotxt format. But let me look at how difficult this would be to support. If it’s a simple fix and doesn’t break anything, I will make the change. |
I did some preliminary looking into this and it seems that removing With those lines changed to the below, the priority label is still not working but the other highlights are now at the correct index. Looking at the code, the priority logic is a little more complicated. This change doesn't seem to break other styling but I haven't tried the more advanced task features. let begPos = new vscode.Position(line.range.start.line, result.index);
let endPos = new vscode.Position(line.range.start.line, result.index + result[0].length); |
Hi Michael,
I looked at this too and came to the same conclusion. The issue with the priority is due to the beginning of line anchor in the regex (^) but when I tried adding in optional leading white space to the pattern, (^\s*) it broke the sorting.
Maybe this is such an edge case that it doesn’t matter. I can push changes to get the formatting working and revisit the sorting logic later.
-David
On Jan 13, 2020, at 1:19 PM, Michael Keller ***@***.***> wrote:
I did some preliminary looking into this and it seems that removing linefirstNonWhitespaceCharacterIndex from here improves some of it.
With those lines changed to the below, the priority label is still not working but the other highlights are now at the correct index. Looking at the code, the priority logic is a little more complicated. This change doesn't seem to break other styling but I haven't tried the more advanced task features.
let begPos = new vscode.Position(line.range.start.line, result.index);
let endPos = new vscode.Position(line.range.start.line, result.index + result[0].length);
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Sounds good! Thanks for looking into it. Whatever you think minimizes any negative side effects. |
Fixed with 1.4.12 release. |
Thanks for your time and work on this! It's much appreciated! |
If I'm using this in a markdown file, I might have this in an indented list where the line begins with whitespace. Some things get highlighted but there's an offset. See the comparison between lines 2 and 3 below:
The text was updated successfully, but these errors were encountered: