Fix mouse-click on --reverse mode

This commit is contained in:
Junegunn Choi 2014-06-27 00:04:07 +09:00
parent 72ec0a3408
commit 56ace10a37

4
fzf
View File

@ -7,7 +7,7 @@
# / __/ / /_/ __/ # / __/ / /_/ __/
# /_/ /___/_/ Fuzzy finder for your shell # /_/ /___/_/ Fuzzy finder for your shell
# #
# Version: 0.8.6 (Jun 26, 2014) # Version: 0.8.6 (Jun 27, 2014)
# #
# Author: Junegunn Choi # Author: Junegunn Choi
# URL: https://github.com/junegunn/fzf # URL: https://github.com/junegunn/fzf
@ -1005,7 +1005,7 @@ class FZF
when :click, :release when :click, :release
x, y, shift = val.values_at :x, :y, :shift x, y, shift = val.values_at :x, :y, :shift
y = @reverse ? (C.lines - 1 - y) : y y = @reverse ? (C.lines - 1 - y) : y
if y == cursor_y if y == C.lines - 1
cursor = [0, [input.length, x - 2].min].max cursor = [0, [input.length, x - 2].min].max
elsif x > 1 && y <= max_items elsif x > 1 && y <= max_items
tv = get(:@yoff) + max_items - y - 1 tv = get(:@yoff) + max_items - y - 1