Skip to content

Commit a82e465

Browse files
committed
fix(search): format file fixes
1 parent 27b1d93 commit a82e465

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/Formats/Search.Format.ps1xml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<?xml version="1.0" encoding="utf-8" ?>
21
<Configuration>
32
<Controls>
43
<Control>
@@ -13,7 +12,6 @@
1312
<ScriptBlock>
1413
try {
1514
$rev = if ($_.FileMatch.File.Commit.Oid) {
16-
$commitUrl = "$($_.FileMatch.Repository.Url)@$($_.FileMatch.File.Commit.Oid)"
1715
# AbbreviatedOid causes panics if queried for search results
1816
"@`e[02m$($_.FileMatch.File.Commit.Oid.Substring(0, 7))`e[0m"
1917
} else {
@@ -110,15 +108,14 @@
110108
</TableColumnItem>
111109
<TableColumnItem>
112110
<ScriptBlock>
113-
# TODO figure out what's wrong with github.com/sourcegraph/src > .gitignore "error"
111+
$result = $_
114112
try {
115113
# Highlight match ranges
116114
$preview = $_.Preview
117115
$out = ""
118116
$start = 0
119117
foreach ($offsetAndLength in $_.OffsetAndLengths) {
120-
$offset = $offsetAndLength[0]
121-
$length = $offsetAndLength[1]
118+
$offset, $length = $offsetAndLength
122119
$out += $preview.Substring($start, $offset - $start) + "`e[43m`e[30m" + $preview.Substring($offset, $length) + "`e[0m"
123120
$start += $offset + $length
124121
}
@@ -128,8 +125,8 @@
128125
}
129126
$out
130127
} catch {
131-
Write-Warning "Error highlighting matches: " + ($_ | Out-String)
132-
$_.Preview
128+
Write-Warning -Message ("Error highlighting matches: " + ($_ | Out-String))
129+
$result.Preview
133130
}
134131
</ScriptBlock>
135132
</TableColumnItem>
@@ -218,10 +215,12 @@
218215
'CONSTRUCTOR' { "`e[35m" }
219216
'FUNCTION' { "`e[35m" }
220217
'CLASS' { "`e[38;5;220;m" }
218+
'ENUM' { "`e[38;5;220;m" }
221219
'KEY' { "`e[38;5;220;m" }
222220
'STRUCT' { "`e[38;5;220;m" }
223221
'TYPEPAREMETER' { "`e[38;5;38;m" }
224222
'VARIABLE' { "`e[38;5;38;m" }
223+
'ENUMMEMBER' { "`e[38;5;38;m" }
225224
'PROPERTY' { "`e[38;5;110;m" }
226225
'FIELD' { "`e[38;5;110;m" }
227226
'PACKAGE' { "`e[38;5;208;m" }

0 commit comments

Comments
 (0)