Remote control: allow scrolling to prev/next prompt

This commit is contained in:
Kovid Goyal
2025-02-18 19:17:10 +05:30
parent eb5a9bc6a3
commit f29bc638ce
3 changed files with 20 additions and 7 deletions

View File

@@ -16,11 +16,12 @@ func parse_scroll_amount(amt string) ([]any, error) {
} else {
pages := strings.Contains(amt, "p")
unscroll := strings.Contains(amt, "u")
prompt := strings.Contains(amt, "r")
var mult float64 = 1
if strings.HasSuffix(amt, "-") && !unscroll {
mult = -1
}
q, err := strconv.ParseFloat(strings.TrimRight(amt, "+-plu"), 64)
q, err := strconv.ParseFloat(strings.TrimRight(amt, "+-plur"), 64)
if err != nil {
return ans, err
}
@@ -32,6 +33,8 @@ func parse_scroll_amount(amt string) ([]any, error) {
ans[1] = "p"
} else if unscroll {
ans[1] = "u"
} else if prompt {
ans[1] = "r"
} else {
ans[1] = "l"
}