MCPcopy
hub / github.com/micro-editor/micro / Close

Method Close

internal/buffer/buffer.go:512–522  ·  view source on GitHub ↗

Close removes this buffer from the list of open buffers

()

Source from the content-addressed store, hash-verified

510
511// Close removes this buffer from the list of open buffers
512func (b *Buffer) Close() {
513 for i, buf := range OpenBuffers {
514 if b == buf {
515 b.Fini()
516 copy(OpenBuffers[i:], OpenBuffers[i+1:])
517 OpenBuffers[len(OpenBuffers)-1] = nil
518 OpenBuffers = OpenBuffers[:len(OpenBuffers)-1]
519 return
520 }
521 }
522}
523
524// Fini should be called when a buffer is closed and performs
525// some cleanup

Callers

nothing calls this directly

Calls 1

FiniMethod · 0.95

Tested by

no test coverage detected