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

Method MoveLinesDown

internal/buffer/buffer.go:1154–1168  ·  view source on GitHub ↗

MoveLinesDown moves the range of lines down one row

(start int, end int)

Source from the content-addressed store, hash-verified

1152
1153// MoveLinesDown moves the range of lines down one row
1154func (b *Buffer) MoveLinesDown(start int, end int) {
1155 if start < 0 || start >= end || end >= len(b.lines) {
1156 return
1157 }
1158 l := string(b.LineBytes(end))
1159 b.Insert(
1160 Loc{0, start},
1161 l+"\n",
1162 )
1163 end++
1164 b.Remove(
1165 Loc{0, end},
1166 Loc{0, end + 1},
1167 )
1168}
1169
1170var BracePairs = [][2]rune{
1171 {'(', ')'},

Callers

nothing calls this directly

Calls 3

InsertMethod · 0.95
RemoveMethod · 0.95
LineBytesMethod · 0.65

Tested by

no test coverage detected