mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-10-05 21:46:49 -04:00
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:
+4
-1
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user