diff --git a/internal/action/actions.go b/internal/action/actions.go index 0ed94558..912f2747 100644 --- a/internal/action/actions.go +++ b/internal/action/actions.go @@ -73,12 +73,12 @@ func (h *BufPane) MousePress(e *tcell.EventMouse) bool { h.Cursor.Loc = mouseLoc } if time.Since(h.lastClickTime)/time.Millisecond < config.DoubleClickThreshold && (mouseLoc.X == h.lastLoc.X && mouseLoc.Y == h.lastLoc.Y) { - if h.doubleClick { + if h.DoubleClick { // Triple click h.lastClickTime = time.Now() - h.tripleClick = true - h.doubleClick = false + h.TripleClick = true + h.DoubleClick = false h.Cursor.SelectLine() h.Cursor.CopySelection(clipboard.PrimaryReg) @@ -86,15 +86,15 @@ func (h *BufPane) MousePress(e *tcell.EventMouse) bool { // Double click h.lastClickTime = time.Now() - h.doubleClick = true - h.tripleClick = false + h.DoubleClick = true + h.TripleClick = false h.Cursor.SelectWord() h.Cursor.CopySelection(clipboard.PrimaryReg) } } else { - h.doubleClick = false - h.tripleClick = false + h.DoubleClick = false + h.TripleClick = false h.lastClickTime = time.Now() h.Cursor.OrigSelection[0] = h.Cursor.Loc @@ -116,9 +116,9 @@ func (h *BufPane) MouseDrag(e *tcell.EventMouse) bool { } h.Cursor.Loc = h.LocFromVisual(buffer.Loc{mx, my}) - if h.tripleClick { + if h.TripleClick { h.Cursor.AddLineToSelection() - } else if h.doubleClick { + } else if h.DoubleClick { h.Cursor.AddWordToSelection() } else { h.Cursor.SelectTo(h.Cursor.Loc) @@ -135,7 +135,7 @@ func (h *BufPane) MouseRelease(e *tcell.EventMouse) bool { // that doesn't support mouse motion events. But when the mouse click is // within the scroll margin, that would cause a scroll and selection // even for a simple mouse click, which is not good. - // if !h.doubleClick && !h.tripleClick { + // if !h.DoubleClick && !h.TripleClick { // mx, my := e.Position() // h.Cursor.Loc = h.LocFromVisual(buffer.Loc{mx, my}) // h.Cursor.SetSelectionEnd(h.Cursor.Loc) diff --git a/internal/action/bufpane.go b/internal/action/bufpane.go index da6be701..b9e17b2d 100644 --- a/internal/action/bufpane.go +++ b/internal/action/bufpane.go @@ -236,9 +236,9 @@ type BufPane struct { // Was the last mouse event actually a double click? // Useful for detecting triple clicks -- if a double click is detected // but the last mouse event was actually a double click, it's a triple click - doubleClick bool + DoubleClick bool // Same here, just to keep track for mouse move events - tripleClick bool + TripleClick bool // Should the current multiple cursor selection search based on word or // based on selection (false for selection, true for word)