Line up the wrapped lines of a quote #340

Open
robbertbos wants to merge 1 commit from worktree-text-editor-verbeteren into main
Owner

The second line of a wrapped quote sat 19.2px to the right of the first, and the first line jumped by that same amount the moment the caret left it.

NLDD reserves the width of the > with padding-left and pulls the first line back over it with a negative text-indent, so the marker hangs in a gutter. We hide that marker, so the pull-back has nothing to hang and only the first visual row moves left. Dropping the pull-back where the marker is hidden, while keeping the reserved padding, puts every row where the revealed state already put the text.

Measured on the built bundle, x of each visual row of a wrapping quote line:

before after
marker hidden 187 / 187 / 206.2 206.2 / 206.2 / 206.2
marker revealed 187 / 206.2 / 206.2 187 / 206.2 / 206.2

So the wrapped row lines up, and the jump on caret entry/exit is gone too.

!important is load-bearing here: NLDD writes the indent as an inline style, and author !important is the one thing that outranks it. The view plugin now rebuilds on selectionSet as well, because the caret decides whether the marker is on screen.

The second line of a wrapped quote sat 19.2px to the right of the first, and the first line jumped by that same amount the moment the caret left it. NLDD reserves the width of the `> ` with `padding-left` and pulls the first line back over it with a negative `text-indent`, so the marker hangs in a gutter. We hide that marker, so the pull-back has nothing to hang and only the first visual row moves left. Dropping the pull-back where the marker is hidden, while keeping the reserved padding, puts every row where the revealed state already put the text. Measured on the built bundle, x of each visual row of a wrapping quote line: | | before | after | | --- | --- | --- | | marker hidden | 187 / 187 / 206.2 | 206.2 / 206.2 / 206.2 | | marker revealed | 187 / 206.2 / 206.2 | 187 / 206.2 / 206.2 | So the wrapped row lines up, and the jump on caret entry/exit is gone too. `!important` is load-bearing here: NLDD writes the indent as an inline style, and author `!important` is the one thing that outranks it. The view plugin now rebuilds on `selectionSet` as well, because the caret decides whether the marker is on screen.
Line up the wrapped lines of a quote
Some checks failed
CI / pre-commit (pull_request) Successful in 2m3s
CI / release-scripts (pull_request) Successful in 8s
security-scan / Python SCA (pip-audit) (pull_request) Successful in 50s
security-scan / Python SAST (bandit) (pull_request) Successful in 29s
security-scan / JS SCA (npm audit) (pull_request) Successful in 33s
security-scan / Filesystem scan (trivy fs) (pull_request) Successful in 22s
CI / frontend-test (pull_request) Successful in 4m42s
security-scan / SBOM (trivy) (pull_request) Successful in 15s
test-build / build (frontend) (pull_request) Successful in 2m8s
test-build / build (backend) (pull_request) Successful in 2m17s
test-build / build (pull_request) Successful in 0s
CI / backend-test (pull_request) Successful in 14m16s
CI / e2e (pull_request) Failing after 14m43s
9a8c33c1bf
Hiding the `> ` left NLDD's hanging indent with nothing to hang: only
the first visual row moved left, so a wrapped row sat 19.2px further
right, and the first row jumped by that same amount when the caret left
the line.

Drop the negative text-indent on a quote line whose marker is hidden and
keep the reserved padding, so every row lands where the revealed state
already put the text.
Some checks failed
CI / pre-commit (pull_request) Successful in 2m3s
Required
Details
CI / release-scripts (pull_request) Successful in 8s
Required
Details
security-scan / Python SCA (pip-audit) (pull_request) Successful in 50s
Required
Details
security-scan / Python SAST (bandit) (pull_request) Successful in 29s
Required
Details
security-scan / JS SCA (npm audit) (pull_request) Successful in 33s
Required
Details
security-scan / Filesystem scan (trivy fs) (pull_request) Successful in 22s
Required
Details
CI / frontend-test (pull_request) Successful in 4m42s
Required
Details
security-scan / SBOM (trivy) (pull_request) Successful in 15s
Required
Details
test-build / build (frontend) (pull_request) Successful in 2m8s
test-build / build (backend) (pull_request) Successful in 2m17s
test-build / build (pull_request) Successful in 0s
CI / backend-test (pull_request) Successful in 14m16s
Required
Details
CI / e2e (pull_request) Failing after 14m43s
Required
Details
Some required checks were not successful.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin worktree-text-editor-verbeteren:worktree-text-editor-verbeteren
git switch worktree-text-editor-verbeteren
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
robbertbos/waggle!340
No description provided.