Support preview scroll offset relative to window height

Related: https://github.com/junegunn/fzf.vim/issues/1092
This commit is contained in:
Junegunn Choi
2020-08-23 15:57:49 +09:00
parent 1ab4289ad6
commit 1cb19dbf65
4 changed files with 32 additions and 7 deletions

View File

@@ -995,7 +995,7 @@ func parsePreviewWindow(opts *previewOpts, input string) {
tokens := strings.Split(input, ":")
sizeRegex := regexp.MustCompile("^[1-9][0-9]*%?$")
offsetRegex := regexp.MustCompile("^\\+([0-9]+|{-?[0-9]+})(-[0-9]+)?$")
offsetRegex := regexp.MustCompile("^\\+([0-9]+|{-?[0-9]+})(-[0-9]+|-/[1-9][0-9]*)?$")
for _, token := range tokens {
switch token {
case "":