Re: possible bug in autocompletion
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- Sep 19, 2012, 17:08 UTC
- Message-ID
- <CAMP44s2X5-BUyLtkTqGMa6w5K6uT25YLEp+Q2TdVR_qCObOpeA@mail.gmail.com>
- In-Reply-To
- <20120717121232.GA32571@sigill.intra.peff.net>
On Tue, Jul 17, 2012 at 2:12 PM, Jeff King <peff@peff.net> wrote:
Show 14 quoted lines
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -261,7 +261,12 @@ __gitcomp ()
> __gitcomp_nl ()
> {
> local IFS=$'\n'
> - COMPREPLY=($(compgen -P "${2-}" -S "${4- }" -W "$1" -- "${3-$cur}"))
> + local words=$1
> + words=${words//\\/\\\\}
> + words=${words//\$/\\\$}
> + words=${words//\'/\\\'}
> + words=${words//\"/\\\"}
> + COMPREPLY=($(compgen -P "${2-}" -S "${4- }" -W "$words" -- "${3-$cur}"))
> }What about something like this?
local words printf -v words "%q" "$w" COMPREPLY=($(compgen -P "${2-}" -S "${4- }" -W "$words" -- "${3-$cur}"))
Cheers.
-- Felipe Contreras