Skip to content

fix(web): correct match positions in partial-line selections - #2029

Merged
yanglbme merged 2 commits into
doocs:mainfrom
yuxino:fix/selection-search-offset
Nov 23, 2026
Merged

yanglbme merged 2 commits into
doocs:mainfrom
yuxino:fix/selection-search-offset

Conversation

@yuxino

@yuxino yuxino commented Nov 21, 2026

Copy link
Copy Markdown
Member

Summary

With prefix: cat on one line and ok on the next, I selected cat through ok and replaced cat with dog. The editor highlighted pre and changed the first line to dogfix: cat.

Plain-text search now accounts for the selection's starting column on the first line. The same replacement leaves prefix: dog.

find-in-selection.mp4

Type of Change

  • Bug fix

Test Procedure

  • Checked the highlight, replacement, and live preview in the editor.
  • Tested a selection spanning two partial lines and case-sensitive, non-overlapping matches in the whole document.
  • Checked that replacing cat in xİcatZ keeps the trailing Z. Lowercasing İ takes two UTF-16 units.

Pre-flight Checklist

  • Reviewed the diff and added regression coverage.
  • Workspace tests, lint, type checks, and the web build passed.

@github-actions

Copy link
Copy Markdown

🚀 Surge Preview has been successfully deployed!

Preview URL: https://doocs-md-preview-pr-2029.surge.sh

Built with commit f8acc9e

@yanglbme
yanglbme merged commit 51fc97c into doocs:main Nov 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants