Skip to content

Commit 3f810c2

Browse files
authored
Fix Deselect() after mouse selection (zyedidia#3268)
Ensure that the selection start is always before the selection end, regardless of the direction of a mouse selection, to make h.Cursor.Deselect() handle its `start` argument correctly. This makes the cursor behavior after mouse selections consistent with the cursor behavior after keyboard selections. Fixes zyedidia#3055
1 parent 1479438 commit 3f810c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/action/actions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func (h *BufPane) MouseDrag(e *tcell.EventMouse) bool {
113113
} else if h.doubleClick {
114114
h.Cursor.AddWordToSelection()
115115
} else {
116-
h.Cursor.SetSelectionEnd(h.Cursor.Loc)
116+
h.Cursor.SelectTo(h.Cursor.Loc)
117117
}
118118

119119
h.Cursor.StoreVisualX()

0 commit comments

Comments
 (0)