Skip to content

Commit

Permalink
Undo mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
FIameCaster committed Jun 12, 2024
1 parent 7c8a766 commit df5771c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions package/src/extensions/search/selection.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { BasicExtension } from "../../index.js"
import { getLineBefore } from "../../utils/index.js"
import { SearchAPI, SearchFilter, createSearchAPI } from "./search.js"

export interface SelectionMatchHighlighter extends BasicExtension {
Expand Down Expand Up @@ -93,7 +92,7 @@ const highlightCurrentWord = (
if (start < end || !editor.focused || noHighlight) searchAPI.search("")
else {
let group = `[_$\\p{L}\\d${includeHyphens && includeHyphens(start) ? "-" : ""}]`
let before = getLineBefore(value, start).match(RegExp(group + "*$", "u"))!
let before = value.slice(0, start).match(RegExp(group + "*$", "u"))!
let index = before.index!
let word = before[0] + value.slice(start).match(RegExp("^" + group + "*", "u"))![0]
searchAPI.search(
Expand Down

0 comments on commit df5771c

Please sign in to comment.