From d4d9b99879d7f870264d4e2e9358c81b5e59981d Mon Sep 17 00:00:00 2001 From: jaydee-coder <187227976+jaydee-coder@users.noreply.github.com> Date: Mon, 4 Nov 2024 05:27:59 -0800 Subject: Allow specifying '{n}' as the OFFSET in the preview-window flag (#4079) * fzf: Allow '{n}' to be used as the OFFSET in the preview-window flag * man: Document using '{n}' as the OFFSET in the preview-window flag --- src/options.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/options.go b/src/options.go index b0ab6b1d..c42acce3 100644 --- a/src/options.go +++ b/src/options.go @@ -1726,7 +1726,7 @@ func parsePreviewWindowImpl(opts *previewOpts, input string) error { var err error tokenRegex := regexp.MustCompile(`[:,]*(<([1-9][0-9]*)\(([^)<]+)\)|[^,:]+)`) sizeRegex := regexp.MustCompile("^[0-9]+%?$") - offsetRegex := regexp.MustCompile(`^(\+{-?[0-9]+})?([+-][0-9]+)*(-?/[1-9][0-9]*)?$`) + offsetRegex := regexp.MustCompile(`^(\+{(-?[0-9]+|n)})?([+-][0-9]+)*(-?/[1-9][0-9]*)?$`) headerRegex := regexp.MustCompile("^~(0|[1-9][0-9]*)$") tokens := tokenRegex.FindAllStringSubmatch(input, -1) var alternative string -- cgit v1.2.3