* PATCH: Re: ~user completion in single quotes.
@ 2000-05-16 11:22 Sven Wischnowsky
2000-05-16 16:14 ` Tanaka Akira
0 siblings, 1 reply; 2+ messages in thread
From: Sven Wischnowsky @ 2000-05-16 11:22 UTC (permalink / raw)
To: zsh-workers
Tanaka Akira wrote:
> Z(4):akr@serein% Src/zsh -f
> serein% bindkey -e; autoload -U compinit; compinit -D
> serein% echo '~ro<TAB>
> ->
> serein% echo '~root/
>
> User names are completed even in single quotes. I think it shouldn't.
>
> serein% echo '~akr/zs<TAB>
> ->
> serein% echo '~akr/zsh/
>
> serein% echo '$PWD/C<TAB
> CVS/ ChangeLog ChangeLog.3.0 Completion/ Config/
>
> Hm. _path_files expands `~akr' and `$PWD' even in single quotes.
Hmhm, seems sensible, because there is `compset -q' for real in-quote
completion.
Bye
Sven
Index: Completion/Base/_tilde
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/_tilde,v
retrieving revision 1.3
diff -u -r1.3 _tilde
--- Completion/Base/_tilde 2000/04/25 11:00:06 1.3
+++ Completion/Base/_tilde 2000/05/16 11:22:27
@@ -4,6 +4,8 @@
# for you or if there are too many of them, you may want to use
# `compadd -qS/ - "$friends[@]"' or something like that.
+[[ -n "$compstate[quote]" ]] && return 1
+
local expl suf dirs list lines revlines i ret disp nm="$compstate[nmatches]"
if [[ "$SUFFIX" = */* ]]; then
Index: Completion/Core/_path_files
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_path_files,v
retrieving revision 1.13
diff -u -r1.13 _path_files
--- Completion/Core/_path_files 2000/05/15 10:45:24 1.13
+++ Completion/Core/_path_files 2000/05/16 11:22:27
@@ -160,7 +160,7 @@
# Now let's have a closer look at the string to complete.
-if [[ "$pre[1]" = \~ ]]; then
+if [[ "$pre[1]" = \~ && -z "$compstate[quote]" ]]; then
# It begins with `~', so remember anything before the first slash to be able
# to report it to the completion code. Also get an expanded version of it
# (in `realpath'), so that we can generate the matches. Then remove that
@@ -209,7 +209,7 @@
orig="${orig#*/}"
donepath=
prepaths=( '' )
-elif [[ "$pre" = *\$*/* ]]; then
+elif [[ "$pre" = *\$*/* && -z "$compstate[quote]" ]]; then
# If there is a parameter expansion in the word from the line, we try
# to complete the beast by expanding the prefix and completing anything
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: PATCH: Re: ~user completion in single quotes.
2000-05-16 11:22 PATCH: Re: ~user completion in single quotes Sven Wischnowsky
@ 2000-05-16 16:14 ` Tanaka Akira
0 siblings, 0 replies; 2+ messages in thread
From: Tanaka Akira @ 2000-05-16 16:14 UTC (permalink / raw)
To: zsh-workers
In article <200005161122.NAA27048@beta.informatik.hu-berlin.de>,
Sven Wischnowsky <wischnow@informatik.hu-berlin.de> writes:
> Hmhm, seems sensible, because there is `compset -q' for real in-quote
> completion.
User name completion is correctly disabled. Thanks.
Z(4):akr@serein% Src/zsh -f
serein% bindkey -e; autoload -U compinit; compinit -D
serein% mkdir '~zzz'
serein% echo '~z<TAB>
But filenames beginning with tilde is not completed.
--
Tanaka Akira
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-05-16 16:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-16 11:22 PATCH: Re: ~user completion in single quotes Sven Wischnowsky
2000-05-16 16:14 ` Tanaka Akira
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).