Tighten loose regexp

This commit is contained in:
Tim Pope
2021-07-12 15:41:12 -04:00
parent 3e2d531322
commit fd5b553029

View File

@@ -4736,7 +4736,7 @@ function! s:GrepSubcommand(line1, line2, range, bang, mods, options) abort
let cmd = ['--no-pager', 'grep', '-n', '--no-color', '--full-name']
let tree = s:Tree(dir)
let args = a:options.subcommand_args
if get(args, 0, '') =~# '^-O\|--open-files-in-pager$'
if get(args, 0, '') =~# '^\%(-O\|--open-files-in-pager\)$'
let args = args[1:-1]
endif
let name_only = s:HasOpt(args, '-l', '--files-with-matches', '--name-only', '-L', '--files-without-match')