-
Notifications
You must be signed in to change notification settings - Fork 34.9k
Closed
Labels
editor-findEditor find operationsEditor find operationseditor-textbufferEditor text bufferEditor text bufferon-testplan
Milestone
Description
When users run find in a single file, we will run regex line by line originally. Now we have a text buffer which stores content in chunks instead of lines, running regex on chunks directly can avoid the overhead of getLineContent
.
Things to note while doing this optimization
- When a line sits across Piece Tree nodes/buffers, we fall back to
getLineContent
then search. - When users search by multiline regex, we need to get the whole content and then search, like before.
- When users search by single line regex, but the regex contains
^
,$
or similar, executing this kind of regex on chunks will miss matches when there are line breaks.
Metadata
Metadata
Assignees
Labels
editor-findEditor find operationsEditor find operationseditor-textbufferEditor text bufferEditor text bufferon-testplan