Closed dalanicolai closed 4 years ago
Please input --
before pattern if you want to search word which starts with -
. e.g. -- --foo-bar
. helm-ag supports additional command line options, so helm-ag does not escape pattern which starts with -
. For example we can input -G\.md pattern
(-G\.md
means searching only markdown files). helm-ag cannot provide this feature with your suggestion.
Ah yes, I was aware of this but forgot to check it. Anyway the idea was that such patterns (starting with dash) are only escaped when they are grabbed from a buffer automatically (like when selecting it first). But indeed this "fix" here breaks the additional command line options functionality when typing in helm directly. Okay... it was just a suggestion, the not escaping when grabbing 'dashed patterns' from the buffer is not a huge issue of course. Thanks for the quick reply, and nice explanation
@dalanicolai It seems this conversation ends? Shall I close it? Thanks! :)
@jcs090218 Fine with me :)
Thanks for opening this issue and your suggestion! Sorry that we could not take it! 😖
helm-ag--last-command
("ag" "--nocolor" "--nogroup" "--ignore=.#" "--ignore=.o" "--ignore=~" "--ignore=.bin" "--ignore=.lbin" "--ignore=.so" "--ignore=.a" "--ignore=.ln" "--ignore=.blg" "--ignore=.bbl" "--ignore=.elc" "--ignore=.lof" "--ignore=.glo" "--ignore=.idx" "--ignore=.lot" "--ignore=.fmt" "--ignore=.tfm" "--ignore=.class" "--ignore=.fas" "--ignore=.lib" "--ignore=.mem" "--ignore=.x86f" "--ignore=.sparcf" "--ignore=.dfsl" "--ignore=.pfsl" "--ignore=.d64fsl" "--ignore=.p64fsl" "--ignore=.lx64fsl" "--ignore=.lx32fsl" "--ignore=.dx64fsl" "--ignore=.dx32fsl" "--ignore=.fx64fsl" "--ignore=.fx32fsl" "--ignore=.sx64fsl" "--ignore=.sx32fsl" "--ignore=.wx64fsl" "--ignore=.wx32fsl" "--ignore=.fasl" "--ignore=.ufsl" "--ignore=.fsl" "--ignore=.dxl" "--ignore=.lo" "--ignore=.la" "--ignore=.gmo" "--ignore=.mo" "--ignore=.toc" "--ignore=.aux" "--ignore=.cp" "--ignore=.fn" "--ignore=.ky" "--ignore=.pg" "--ignore=.tp" "--ignore=.vr" "--ignore=.cps" "--ignore=.fns" "--ignore=.kys" "--ignore=.pgs" "--ignore=.tps" "--ignore=.vrs" "--ignore=.pyc" "--ignore=*.pyo" "--ignore=SCCS" "--ignore=RCS" "--ignore=CVS" "--ignore=MCVS" "--ignore=.src" "--ignore=.svn" "--ignore=.git" "--ignore=.hg" "--ignore=.bzr" "--ignore=_MTN" "--ignore=_darcs" "--ignore={arch}" "\--lksj")Actual behavior
When searching for a pattern starting with a dash using
helm-do-ag
, helm-ag returns the following message:I am not sure how you think about this behavior, but personally I would prefer if helm-ag auto escapes the dash (at least when automatically "grabbing" the pattern from a buffer)
Expected behavior
Expect to search for the pattern (i.e auto escape the dash). Suggested fix: replace in the function
helm-ag--do-ag-candidate-process
the linewith
Steps to reproduce
type some string starting with a dash in a buffer, position the point on the string and invoke
helm-do-ag