Skip to content

Commit fd21425

Browse files
Merge branch 'PluginNewCursor' into dev
2 parents bdf6675 + 87930b6 commit fd21425

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
> - [Exposing replacement functions for deprecated IOUtil functions #3393](https://github.com/zyedidia/micro/pull/3393)
1313
> - [Adding timeout when fetching plugin & more clear plugin error message #3389](https://github.com/zyedidia/micro/pull/3389)
1414
> - [Adding Jumping to opening and closing brace logic and actions #3384](https://github.com/zyedidia/micro/pull/3384)
15+
> - [Allowing plugin to add cursor in custom Loc #3441](https://github.com/zyedidia/micro/pull/3441)
1516
>
1617
> To see the diff between this and upstream master, click [here](https://github.com/zyedidia/micro/compare/master...Neko-Box-Coder:micro-dev:dev)
1718

internal/action/actions.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1972,6 +1972,14 @@ func (h *BufPane) SpawnMultiCursor() bool {
19721972
return true
19731973
}
19741974

1975+
// SpawnCursorAtLoc spawns a new cursor at a location and merges the cursors
1976+
func (h *BufPane) SpawnCursorAtLoc(loc buffer.Loc) *buffer.Cursor {
1977+
c := buffer.NewCursor(h.Buf, loc)
1978+
h.Buf.AddCursor(c)
1979+
h.Buf.MergeCursors()
1980+
return c
1981+
}
1982+
19751983
// SpawnMultiCursorUpN is not an action
19761984
func (h *BufPane) SpawnMultiCursorUpN(n int) bool {
19771985
lastC := h.Buf.GetCursor(h.Buf.NumCursors() - 1)

0 commit comments

Comments
 (0)