We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 08f5783 commit 17ed998Copy full SHA for 17ed998
src/webview/SearchSidebar/SearchResultList/comps/CodeBlock.tsx
@@ -9,15 +9,17 @@ const style = {
9
10
function splitByHighLightToken(search: SgSearch) {
11
const { start, end } = search.range
12
- // TODO: multilines highlight
13
- const { column: startColumn } = start
14
- const { column: endColumn } = end
15
-
16
- const startIdx = startColumn
17
- const endIdx = endColumn
18
+ let startIdx = start.column
+ let endIdx = end.column
+ let displayLine = search.lines
+ // multiline matches!
+ if (start.line < end.line) {
+ displayLine = search.lines.split(/\r?\n/, 1)[0]
+ endIdx = displayLine.length
19
+ }
20
return {
- index: [startIdx, endIdx]
21
+ index: [startIdx, endIdx],
22
+ displayLine
23
}
24
25
0 commit comments