zsh-users
 help / color / mirror / code / Atom feed
* Completion of empty directories
@ 2018-11-23 11:11 Daniel Shahaf
  2018-11-23 19:57 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Shahaf @ 2018-11-23 11:11 UTC (permalink / raw)
  To: zsh-users

$ zsh -f
% mkdir xxx
% mv * x/<TAB>

When xxx/ is empty, the <TAB> does nothing.  Could it complete x/ to xxx/?

Using _complete_debug (on another example, xxx/f/ -> xxx/foo/ with
xxx/foo/ being empty) I see that xxx/foo/ _is_ getting matched against,
but I haven't been able to identify the point (in _path_files,
presumably) where it is checked that the directory is non-empty.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Completion of empty directories
  2018-11-23 11:11 Completion of empty directories Daniel Shahaf
@ 2018-11-23 19:57 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2018-11-23 19:57 UTC (permalink / raw)
  To: Daniel Shahaf; +Cc: Zsh Users

On Fri, Nov 23, 2018 at 3:12 AM Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
>
> When xxx/ is empty, the <TAB> does nothing.  Could it complete x/ to xxx/?

The difference happens at this line:

        +_path_files:463> compfiles -p tmp1 accex / ' ' '' fake '*'

when xxx/ is empty, this assigns nothing to tmp1 for x/, but when it
is non-empty this assigns xxx/foo to tmp1.

My guess is that this comes down to the cf_pats() function, but I
haven't traced through the C code in detail.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-23 19:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-23 11:11 Completion of empty directories Daniel Shahaf
2018-11-23 19:57 ` Bart Schaefer

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).