diff --git a/cmd/micro/actions.go b/cmd/micro/actions.go index 8a7308db..dd33621a 100644 --- a/cmd/micro/actions.go +++ b/cmd/micro/actions.go @@ -1829,6 +1829,7 @@ func (v *View) PlayMacro(usePlugin bool) bool { return true } +// SpawnMultiCursor creates a new multiple cursor at the next occurence of the current selection or current word func (v *View) SpawnMultiCursor(usePlugin bool) bool { spawner := v.Buf.cursors[len(v.Buf.cursors)-1] // You can only spawn a cursor from the main cursor @@ -1868,6 +1869,7 @@ func (v *View) SpawnMultiCursor(usePlugin bool) bool { return false } +// SkipMultiCursor moves the current multiple cursor to the next available position func (v *View) SkipMultiCursor(usePlugin bool) bool { cursor := v.Buf.cursors[len(v.Buf.cursors)-1] @@ -1890,6 +1892,7 @@ func (v *View) SkipMultiCursor(usePlugin bool) bool { return false } +// RemoveMultiCursor removes the latest multiple cursor func (v *View) RemoveMultiCursor(usePlugin bool) bool { end := len(v.Buf.cursors) if end > 1 { @@ -1916,6 +1919,7 @@ func (v *View) RemoveMultiCursor(usePlugin bool) bool { return false } +// RemoveAllMultiCursors removes all cursors except the base cursor func (v *View) RemoveAllMultiCursors(usePlugin bool) bool { if v.Cursor == &v.Buf.Cursor { if usePlugin && !PreActionCall("RemoveAllMultiCursors", v) { diff --git a/cmd/micro/view.go b/cmd/micro/view.go index 1162b461..b9c901bc 100644 --- a/cmd/micro/view.go +++ b/cmd/micro/view.go @@ -947,6 +947,9 @@ func (v *View) DisplayView() { } } +// ShowMultiCursor will display a cursor at a location +// If i == 0 then the terminal cursor will be used +// Otherwise a fake cursor will be drawn at the position func ShowMultiCursor(x, y, i int) { if i == 0 { screen.ShowCursor(x, y)