Skip to content

Commit ca32ffb

Browse files
authored
Change variable visibility (zyedidia#3720)
Changed DoubleClick and TripleClick to public so they can be accessed by Lua plugins.
1 parent b61c8a4 commit ca32ffb

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

internal/action/actions.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,28 +73,28 @@ func (h *BufPane) MousePress(e *tcell.EventMouse) bool {
7373
h.Cursor.Loc = mouseLoc
7474
}
7575
if time.Since(h.lastClickTime)/time.Millisecond < config.DoubleClickThreshold && (mouseLoc.X == h.lastLoc.X && mouseLoc.Y == h.lastLoc.Y) {
76-
if h.doubleClick {
76+
if h.DoubleClick {
7777
// Triple click
7878
h.lastClickTime = time.Now()
7979

80-
h.tripleClick = true
81-
h.doubleClick = false
80+
h.TripleClick = true
81+
h.DoubleClick = false
8282

8383
h.Cursor.SelectLine()
8484
h.Cursor.CopySelection(clipboard.PrimaryReg)
8585
} else {
8686
// Double click
8787
h.lastClickTime = time.Now()
8888

89-
h.doubleClick = true
90-
h.tripleClick = false
89+
h.DoubleClick = true
90+
h.TripleClick = false
9191

9292
h.Cursor.SelectWord()
9393
h.Cursor.CopySelection(clipboard.PrimaryReg)
9494
}
9595
} else {
96-
h.doubleClick = false
97-
h.tripleClick = false
96+
h.DoubleClick = false
97+
h.TripleClick = false
9898
h.lastClickTime = time.Now()
9999

100100
h.Cursor.OrigSelection[0] = h.Cursor.Loc
@@ -116,9 +116,9 @@ func (h *BufPane) MouseDrag(e *tcell.EventMouse) bool {
116116
}
117117
h.Cursor.Loc = h.LocFromVisual(buffer.Loc{mx, my})
118118

119-
if h.tripleClick {
119+
if h.TripleClick {
120120
h.Cursor.AddLineToSelection()
121-
} else if h.doubleClick {
121+
} else if h.DoubleClick {
122122
h.Cursor.AddWordToSelection()
123123
} else {
124124
h.Cursor.SelectTo(h.Cursor.Loc)
@@ -135,7 +135,7 @@ func (h *BufPane) MouseRelease(e *tcell.EventMouse) bool {
135135
// that doesn't support mouse motion events. But when the mouse click is
136136
// within the scroll margin, that would cause a scroll and selection
137137
// even for a simple mouse click, which is not good.
138-
// if !h.doubleClick && !h.tripleClick {
138+
// if !h.DoubleClick && !h.TripleClick {
139139
// mx, my := e.Position()
140140
// h.Cursor.Loc = h.LocFromVisual(buffer.Loc{mx, my})
141141
// h.Cursor.SetSelectionEnd(h.Cursor.Loc)

internal/action/bufpane.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@ type BufPane struct {
236236
// Was the last mouse event actually a double click?
237237
// Useful for detecting triple clicks -- if a double click is detected
238238
// but the last mouse event was actually a double click, it's a triple click
239-
doubleClick bool
239+
DoubleClick bool
240240
// Same here, just to keep track for mouse move events
241-
tripleClick bool
241+
TripleClick bool
242242

243243
// Should the current multiple cursor selection search based on word or
244244
// based on selection (false for selection, true for word)

0 commit comments

Comments
 (0)