MCPcopy Create free account
hub / github.com/cogentcore/core / renderScopelights

Method renderScopelights

texteditor/render.go:282–290  ·  view source on GitHub ↗

renderScopelights renders a highlight background color for regions in the Scopelights list.

(stln, edln int)

Source from the content-addressed store, hash-verified

280// renderScopelights renders a highlight background color for regions
281// in the Scopelights list.
282func (ed *Editor) renderScopelights(stln, edln int) {
283 for _, reg := range ed.scopelights {
284 reg := ed.Buffer.AdjustRegion(reg)
285 if reg.IsNil() || (stln >= 0 && (reg.Start.Ln > edln || reg.End.Ln < stln)) {
286 continue
287 }
288 ed.renderRegionBox(reg, ed.HighlightColor)
289 }
290}
291
292// renderRegionBox renders a region in background according to given background
293func (ed *Editor) renderRegionBox(reg text.Region, bg image.Image) {

Callers 1

renderAllLinesMethod · 0.95

Calls 3

renderRegionBoxMethod · 0.95
AdjustRegionMethod · 0.45
IsNilMethod · 0.45

Tested by

no test coverage detected