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

Method SetDiffBase

internal/buffer/buffer.go:1406–1414  ·  view source on GitHub ↗

SetDiffBase sets the text that is used as the base for diffing the buffer content

(diffBase []byte)

Source from the content-addressed store, hash-verified

1404
1405// SetDiffBase sets the text that is used as the base for diffing the buffer content
1406func (b *Buffer) SetDiffBase(diffBase []byte) {
1407 b.diffBase = diffBase
1408 if diffBase == nil {
1409 b.diffBaseLineCount = 0
1410 } else {
1411 b.diffBaseLineCount = strings.Count(string(diffBase), "\n")
1412 }
1413 b.UpdateDiff()
1414}
1415
1416// DiffStatus returns the diff status for a line in the buffer
1417func (b *Buffer) DiffStatus(lineN int) DiffStatus {

Callers

nothing calls this directly

Calls 1

UpdateDiffMethod · 0.95

Tested by

no test coverage detected