From df09df19403514658f2981cf54a96c6e2b664f57 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Thu, 18 Jun 2026 21:21:25 +0200 Subject: [PATCH] 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. --- pkg/gocui/view.go | 5 ++++- pkg/gui/views.go | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/gocui/view.go b/pkg/gocui/view.go index babaae0fb..a23338c4c 100644 --- a/pkg/gocui/view.go +++ b/pkg/gocui/view.go @@ -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 { diff --git a/pkg/gui/views.go b/pkg/gui/views.go index b47e76c5a..ddf3e40a9 100644 --- a/pkg/gui/views.go +++ b/pkg/gui/views.go @@ -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