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

Method renderHighlights

texteditor/render.go:270–278  ·  view source on GitHub ↗

renderHighlights renders the highlight regions as a highlighted background color.

(stln, edln int)

Source from the content-addressed store, hash-verified

268// renderHighlights renders the highlight regions as a
269// highlighted background color.
270func (ed *Editor) renderHighlights(stln, edln int) {
271 for _, reg := range ed.Highlights {
272 reg := ed.Buffer.AdjustRegion(reg)
273 if reg.IsNil() || (stln >= 0 && (reg.Start.Ln > edln || reg.End.Ln < stln)) {
274 continue
275 }
276 ed.renderRegionBox(reg, ed.HighlightColor)
277 }
278}
279
280// renderScopelights renders a highlight background color for regions
281// in the Scopelights list.

Callers 1

renderAllLinesMethod · 0.95

Calls 3

renderRegionBoxMethod · 0.95
AdjustRegionMethod · 0.45
IsNilMethod · 0.45

Tested by

no test coverage detected