summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjaydee-coder <187227976+jaydee-coder@users.noreply.github.com>2024-11-04 05:27:59 -0800
committerGitHub <noreply@github.com>2024-11-04 22:27:59 +0900
commitd4d9b99879d7f870264d4e2e9358c81b5e59981d (patch)
tree657caf8396cd703efe7aa29b16662c8cb3b11355 /src
parent6816b7d95b54330224020b4304db7fd5a5ea1ba1 (diff)
downloadfzf-d4d9b99879d7f870264d4e2e9358c81b5e59981d.tar.gz
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
Diffstat (limited to 'src')
-rw-r--r--src/options.go2
1 files changed, 1 insertions, 1 deletions
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