From a61150a96c0bc32d0c56e1127985ca238b1b89ff Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 27 Jul 2020 00:30:25 +0900 Subject: [PATCH] Allow negative field index in preview-window scroll offset --- src/options.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/options.go b/src/options.go index 811615e..3692f0c 100644 --- a/src/options.go +++ b/src/options.go @@ -995,7 +995,7 @@ func parsePreviewWindow(opts *previewOpts, input string) { tokens := strings.Split(input, ":") sizeRegex := regexp.MustCompile("^[0-9]+%?$") - offsetRegex := regexp.MustCompile("^\\+([0-9]+|{[0-9]+})(-[0-9]+)?$") + offsetRegex := regexp.MustCompile("^\\+([0-9]+|{-?[0-9]+})(-[0-9]+)?$") for _, token := range tokens { switch token { case "":