summaryrefslogtreecommitdiff
path: root/src/options.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-01-23 06:26:00 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-01-23 06:26:00 +0900
commitc35d98dc42e8327ffbfd17701efa3d5fb68eeae0 (patch)
tree742ef68f3f5cc400c89efd23188c3a35d9fae9ab /src/options.go
parent8bead4ae3427689955a1248619917f8beeba9585 (diff)
downloadfzf-c35d98dc42e8327ffbfd17701efa3d5fb68eeae0.tar.gz
Nullify --nth option when it's irrelevant
Diffstat (limited to 'src/options.go')
-rw-r--r--src/options.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/options.go b/src/options.go
index e1dba299..b11328e5 100644
--- a/src/options.go
+++ b/src/options.go
@@ -266,6 +266,17 @@ func parseOptions(opts *Options, allArgs []string) {
}
}
}
+
+ // If we're not using extended search mode, --nth option becomes irrelevant
+ // if it contains the whole range
+ if opts.Mode == ModeFuzzy || len(opts.Nth) == 1 {
+ for _, r := range opts.Nth {
+ if r.begin == rangeEllipsis && r.end == rangeEllipsis {
+ opts.Nth = make([]Range, 0)
+ return
+ }
+ }
+ }
}
// ParseOptions parses command-line options