Hack: inset the selection highlight by 3 in the main view

This makes it possible to see what lines delta renders as red or green.

It's not pretty, but makes testing easier for now. Needs a better
solution eventually.
This commit is contained in:
Stefan Haller 2026-06-18 21:21:25 +02:00
parent 377a352075
commit df09df1940
2 changed files with 7 additions and 1 deletions

View file

@ -156,6 +156,8 @@ type View struct {
// instead of Sel{Bg,Fg}Colors for highlighting selected lines.
HighlightInactive bool
HighlightInset int
// If Frame is true, a border will be drawn around the view.
Frame bool
@ -674,7 +676,8 @@ func (v *View) setCharacter(x, y int, ch string, fgColor, bgColor Attribute) {
rangeSelectEnd = max(relativeRangeSelectStart, v.cy)
}
if y >= rangeSelectStart && y <= rangeSelectEnd {
inset := v.HighlightInset
if y >= rangeSelectStart && y <= rangeSelectEnd && x >= inset && x < v.InnerWidth()-inset {
// this ensures we use the bright variant of a colour upon highlight
fgColorComponent := fgColor & ^AttrAll
if fgColorComponent >= AttrIsValidColor && fgColorComponent < AttrIsValidColor+8 {

View file

@ -106,6 +106,9 @@ func (gui *Gui) createAllViews() error {
view.AutoRenderHyperLinks = true
}
gui.Views.Main.HighlightInset = 3
gui.Views.Secondary.HighlightInset = 3
gui.Views.Staging.Wrap = true
gui.Views.StagingSecondary.Wrap = true
gui.Views.PatchBuilding.Wrap = true