Skip to content

Commit

Permalink
Adding SpawnCursorAtLoc for plugin to use (#3441)
Browse files Browse the repository at this point in the history
  • Loading branch information
Neko-Box-Coder authored Aug 31, 2024
1 parent 968f5ba commit e6b20b2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/action/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -1955,6 +1955,14 @@ func (h *BufPane) SpawnMultiCursor() bool {
return true
}

// SpawnCursorAtLoc spawns a new cursor at a location and merges the cursors
func (h *BufPane) SpawnCursorAtLoc(loc buffer.Loc) *buffer.Cursor {
c := buffer.NewCursor(h.Buf, loc)
h.Buf.AddCursor(c)
h.Buf.MergeCursors()
return c
}

// SpawnMultiCursorUpN is not an action
func (h *BufPane) SpawnMultiCursorUpN(n int) bool {
lastC := h.Buf.GetCursor(h.Buf.NumCursors() - 1)
Expand Down

0 comments on commit e6b20b2

Please sign in to comment.