Allow splitting preview-window options

e.g. --preview-window sharp --preview-window cycle
This commit is contained in:
Junegunn Choi 2020-10-06 18:44:13 +09:00
parent 3cc8a74a91
commit bafb99d520
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -994,13 +994,6 @@ func parseInfoStyle(str string) infoStyle {
}
func parsePreviewWindow(opts *previewOpts, input string) {
// Default
opts.position = posRight
opts.size = sizeSpec{50, true}
opts.hidden = false
opts.wrap = false
opts.cycle = false
tokens := strings.Split(input, ":")
sizeRegex := regexp.MustCompile("^[0-9]+%?$")
offsetRegex := regexp.MustCompile("^\\+([0-9]+|{-?[0-9]+})(-[0-9]+|-/[1-9][0-9]*)?$")