You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-misc/skim/files/0.6.2-cursor-fix.patch

23 lines
751 B

From 9b5213da447eb8674570924026689d89f83ce9b6 Mon Sep 17 00:00:00 2001
From: Jinzhou Zhang <lotabout@gmail.com>
Date: Tue, 19 Mar 2019 22:39:05 +0800
Subject: [PATCH] [selection] fix cursor after items changed
---
src/selection.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/selection.rs b/src/selection.rs
index 626f615..72d277e 100644
--- a/src/selection.rs
+++ b/src/selection.rs
@@ -98,7 +98,7 @@ impl Selection {
if self.items.len() <= self.line_cursor + self.item_cursor {
// if not enough items, scroll the cursor a page down
- self.item_cursor = max(height, self.item_cursor) - height;
+ self.item_cursor = max(self.items.len(), height) - height;
}
}