Skip to content

Commit 2793c37

Browse files
committed
Fix SkipMultiCursor behavior when there is no selection
When there is no selection (i.e. selection is empty), SkipMultiCursor searches for the empty text, "finds" it as the beginning of the buffer, and as a result, jumps to the beginning of the buffer, which confuses the user. Fix it.
1 parent 7e09a92 commit 2793c37

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/action/actions.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2013,6 +2013,9 @@ func (h *BufPane) MouseMultiCursor(e *tcell.EventMouse) bool {
20132013
// SkipMultiCursor moves the current multiple cursor to the next available position
20142014
func (h *BufPane) SkipMultiCursor() bool {
20152015
lastC := h.Buf.GetCursor(h.Buf.NumCursors() - 1)
2016+
if !lastC.HasSelection() {
2017+
return false
2018+
}
20162019
sel := lastC.GetSelection()
20172020
searchStart := lastC.CurSelection[1]
20182021

0 commit comments

Comments
 (0)