Skip to content

Commit 87930b6

Browse files
Adding SpawnCursorAtLoc for plugin to use
1 parent cc195b6 commit 87930b6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

internal/action/actions.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1955,6 +1955,14 @@ func (h *BufPane) SpawnMultiCursor() bool {
19551955
return true
19561956
}
19571957

1958+
// SpawnCursorAtLoc spawns a new cursor at a location and merges the cursors
1959+
func (h *BufPane) SpawnCursorAtLoc(loc buffer.Loc) *buffer.Cursor {
1960+
c := buffer.NewCursor(h.Buf, loc)
1961+
h.Buf.AddCursor(c)
1962+
h.Buf.MergeCursors()
1963+
return c
1964+
}
1965+
19581966
// SpawnMultiCursorUpN is not an action
19591967
func (h *BufPane) SpawnMultiCursorUpN(n int) bool {
19601968
lastC := h.Buf.GetCursor(h.Buf.NumCursors() - 1)

0 commit comments

Comments
 (0)