mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-16 05:47:06 +09:00
Fix Deselect() after mouse selection (#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 #3055
This commit is contained in:
@@ -113,7 +113,7 @@ func (h *BufPane) MouseDrag(e *tcell.EventMouse) bool {
|
||||
} else if h.doubleClick {
|
||||
h.Cursor.AddWordToSelection()
|
||||
} else {
|
||||
h.Cursor.SetSelectionEnd(h.Cursor.Loc)
|
||||
h.Cursor.SelectTo(h.Cursor.Loc)
|
||||
}
|
||||
|
||||
h.Cursor.StoreVisualX()
|
||||
|
||||
Reference in New Issue
Block a user