Adding SpawnCursorAtLoc for plugin to use (#3441)

This commit is contained in:
Neko Box Coder 2024-08-31 11:42:55 +01:00 committed by GitHub
parent 968f5ba1ef
commit e6b20b2ce9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)