summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-07-27 00:06:44 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-07-27 00:06:44 +0900
commit7231acd44297850730fed1f6069b340e1885f352 (patch)
tree674938f3c7ef3de38842e394dfc89ef21d61c1f9
parent7814371a9a826a12476b446fcce0100932f96dbd (diff)
Fix mouse scroll when --margin is set
-rw-r--r--src/terminal.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/terminal.go b/src/terminal.go
index 070d0a90..9466170b 100644
--- a/src/terminal.go
+++ b/src/terminal.go
@@ -994,7 +994,16 @@ func (t *Terminal) Loop() {
case actMouse:
me := event.MouseEvent
mx, my := me.X, me.Y
- if mx >= t.marginInt[3] && mx < C.MaxX()-t.marginInt[1] &&
+ if me.S != 0 {
+ // Scroll
+ if t.merger.Length() > 0 {
+ if t.multi && me.Mod {
+ toggle()
+ }
+ t.vmove(me.S)
+ req(reqList)
+ }
+ } else if mx >= t.marginInt[3] && mx < C.MaxX()-t.marginInt[1] &&
my >= t.marginInt[0] && my < C.MaxY()-t.marginInt[2] {
mx -= t.marginInt[3]
my -= t.marginInt[0]
@@ -1006,16 +1015,7 @@ func (t *Terminal) Loop() {
if t.inlineInfo {
min -= 1
}
- if me.S != 0 {
- // Scroll
- if t.merger.Length() > 0 {
- if t.multi && me.Mod {
- toggle()
- }
- t.vmove(me.S)
- req(reqList)
- }
- } else if me.Double {
+ if me.Double {
// Double-click
if my >= min {
if t.vset(t.offset+my-min) && t.cy < t.merger.Length() {