Improve global search: Add diffing from results with query highlighting

Users can now open a diff for a specific search hit directly from the global search results. The original search query will be highlighted within the diff view, making it easier to locate the relevant changes.

Additionally, add `--no-textconv` to git commands used in search and diff operations. This prevents failures when git encounters binary files that textconv drivers might otherwise attempt to process.
This commit is contained in:
Christoph Brandau
2026-06-30 20:32:59 +02:00
parent 2cc1d34fc3
commit 405f302db9
5 changed files with 94 additions and 20 deletions
+24 -1
View File
@@ -1123,6 +1123,19 @@
.split-cell.add { background: rgba(78,202,118,0.09); color: #5dd88a; }
.split-cell.empty { background: rgba(0,0,0,0.06); }
/* Search-hit highlight: amber, distinct from add (green) / del (red).
Higher specificity so it overrides the add/del backgrounds on a matched line. */
.split-diff .split-cell.match {
background: rgba(240,182,72,0.22);
color: #f3c969;
box-shadow: inset 2px 0 0 rgba(240,182,72,0.9);
}
.split-diff .split-num.match {
background: rgba(240,182,72,0.2);
color: rgba(240,182,72,0.9);
border-right-color: rgba(240,182,72,0.35);
}
.split-col-headers {
display: grid;
grid-template-columns: 1fr 1fr;
@@ -1254,11 +1267,21 @@
}
.search-hit-top {
display: grid;
grid-template-columns: auto minmax(0, 1fr) auto;
grid-template-columns: auto minmax(0, 1fr) auto auto;
align-items: center;
gap: 8px;
min-width: 0;
}
.search-hit-diff {
display: inline-flex;
align-items: center;
gap: 5px;
padding: 3px 9px;
font-size: 11px;
font-weight: 800;
letter-spacing: 0.04em;
white-space: nowrap;
}
.search-hit-top .hash {
padding: 2px 7px;
border: 1px solid rgba(90,140,248,0.22);