Allow negative field index in preview-window scroll offset

This commit is contained in:
Junegunn Choi 2020-07-27 00:30:25 +09:00
parent 0f9cb5590e
commit a61150a96c
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627
1 changed files with 1 additions and 1 deletions

View File

@ -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 "":