-
Notifications
You must be signed in to change notification settings - Fork 393
Open
Description
Plugin Version
- Vim 9.0.749
- mileszs/ack.vim 36e40f9
Bug Reproduction
.vimrc
set ignorecase
let g:ackprg = 'ag --vimgrep --hidden --ignore .git'Input command in Vim
:AckFile! filenameError appeared in Quickfix List
ag: invalid option -- 'd'
Expected behavior
No error appears.
Possible Cause
When set ignorecase is specified in .vimrc, the substitution pattern in function ack#Ack will also become case-insensitive.
*'ignorecase'* *'ic'* *'noignorecase'* *'noic'*
'ignorecase' 'ic' boolean (default off)
global
Ignore case in search patterns. Also used when searching in the tags
file.
Also see 'smartcase'.
Can be overruled by using "\c" or "\C" in the pattern, see
|/ignorecase|.
The -h in --hidden from the value of g:ackprg will be substituted by '', leaving a wrong-shaped command ag --vimgrep -idden --ignore .git.
Lines 28 to 31 in 36e40f9
| if s:SearchingFilepaths() | |
| let l:grepprg = substitute(l:grepprg, '-H\|--column', '', 'g') | |
| let l:grepformat = '%f' | |
| endif |
Fix
Append \C to the pattern
if s:SearchingFilepaths()
let l:grepprg = substitute(l:grepprg, '-H\|--column\C', '', 'g')
let l:grepformat = '%f'
endif Metadata
Metadata
Assignees
Labels
No labels