From c35d98dc42e8327ffbfd17701efa3d5fb68eeae0 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Fri, 23 Jan 2015 06:26:00 +0900 Subject: Nullify --nth option when it's irrelevant --- src/options.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/options.go') 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 -- cgit v1.2.3