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

Method resetState

texteditor/editor.go:312–323  ·  view source on GitHub ↗

Buffer communication resetState resets all the random state variables, when opening a new buffer etc

()

Source from the content-addressed store, hash-verified

310
311// resetState resets all the random state variables, when opening a new buffer etc
312func (ed *Editor) resetState() {
313 ed.SelectReset()
314 ed.Highlights = nil
315 ed.ISearch.On = false
316 ed.QReplace.On = false
317 if ed.Buffer == nil || ed.lastFilename != ed.Buffer.Filename { // don't reset if reopening..
318 ed.CursorPos = lexer.Pos{}
319 }
320 if ed.Buffer != nil {
321 ed.Buffer.SetReadOnly(ed.IsReadOnly())
322 }
323}
324
325// SetBuffer sets the [Buffer] that this is an editor of, and interconnects their events.
326func (ed *Editor) SetBuffer(buf *Buffer) *Editor {

Callers 2

SetBufferMethod · 0.95
bufferSignalMethod · 0.95

Calls 3

SelectResetMethod · 0.95
SetReadOnlyMethod · 0.45
IsReadOnlyMethod · 0.45

Tested by

no test coverage detected