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

Method linesDeleted

texteditor/editor.go:380–390  ·  view source on GitHub ↗

linesDeleted deletes lines of text and reformats remaining one

(tbe *text.Edit)

Source from the content-addressed store, hash-verified

378
379// linesDeleted deletes lines of text and reformats remaining one
380func (ed *Editor) linesDeleted(tbe *text.Edit) {
381 stln := tbe.Reg.Start.Ln
382 edln := tbe.Reg.End.Ln
383 dsz := edln - stln
384
385 ed.renders = append(ed.renders[:stln], ed.renders[edln:]...)
386 ed.offsets = append(ed.offsets[:stln], ed.offsets[edln:]...)
387
388 ed.NumLines -= dsz
389 ed.NeedsLayout()
390}
391
392// bufferSignal receives a signal from the Buffer when the underlying text
393// is changed.

Callers 1

bufferSignalMethod · 0.95

Calls 1

NeedsLayoutMethod · 0.95

Tested by

no test coverage detected