-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Don't show single non-boundary spaces in show-whitespace
#5709
Conversation
show-whitespace
source/features/show-whitespace.tsx
Outdated
@@ -21,26 +21,38 @@ function showWhiteSpacesOn(line: Element): void { | |||
continue; | |||
} | |||
|
|||
const startingCharacter = shouldAvoidSurroundingSpaces && nodeIndex === 0 ? 1 : 0; | |||
const skipLastCharacter = shouldAvoidSurroundingSpaces && nodeIndex === textNodesOnThisLine.length - 1; | |||
// This referes to the boundary text nodes, not actual whitespace nodes. Text nodes are generated by the syntax highlighter, so non-highlighted text will have one text node. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that this PR doesn't change how the feature behaves on non-highlighted pre
like
hello world
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
60a0ae8
to
a333751
Compare
This comment was marked as resolved.
This comment was marked as resolved.
show-whitespace
show-whitespace
If I remember correctly this was my only complaint when we added this feature. |
Let's just hope I didn't break the feature further 😅 |
Test URLs
show-whitespace
sandbox#18Before
After