zsh-workers
 help / color / mirror / code / Atom feed
* Completion after anonymous function
@ 2016-07-13  5:00 Daniel Shahaf
  2016-07-13 10:47 ` Mikael Magnusson
  2016-07-13 17:28 ` Bart Schaefer
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Shahaf @ 2016-07-13  5:00 UTC (permalink / raw)
  To: zsh-workers

«() {} <TAB>» completes as a command position:

% () {} «_complete_help»
tags in context :completion::complete:-command-::
    commands builtins functions aliases suffix-aliases reserved-words jobs parameters  (_command_names _autocd) 
    commands                                                                           (_path_commands _command_names _autocd) 
    jobs                                                                               (_jobs _command_names _autocd) 
    parameters                                                                         (_parameters _command_names _autocd)

I guess it should just use _default, like unrecognised command words.

Tracing, _complete sees [[ $compstate[context] == normal ]] — which
seems correct — and then the «if [[ CURRENT -eq 1 ]]» in _normal is
entered; I guess that's the problem?


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

* Re: Completion after anonymous function
  2016-07-13  5:00 Completion after anonymous function Daniel Shahaf
@ 2016-07-13 10:47 ` Mikael Magnusson
  2016-07-13 17:28 ` Bart Schaefer
  1 sibling, 0 replies; 3+ messages in thread
From: Mikael Magnusson @ 2016-07-13 10:47 UTC (permalink / raw)
  To: Daniel Shahaf; +Cc: zsh workers

On Wed, Jul 13, 2016 at 7:00 AM, Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> «() {} <TAB>» completes as a command position:
>
> % () {} «_complete_help»
> tags in context :completion::complete:-command-::
>     commands builtins functions aliases suffix-aliases reserved-words jobs parameters  (_command_names _autocd)
>     commands                                                                           (_path_commands _command_names _autocd)
>     jobs                                                                               (_jobs _command_names _autocd)
>     parameters                                                                         (_parameters _command_names _autocd)
>
> I guess it should just use _default, like unrecognised command words.
>
> Tracing, _complete sees [[ $compstate[context] == normal ]] — which
> seems correct — and then the «if [[ CURRENT -eq 1 ]]» in _normal is
> entered; I guess that's the problem?

It seems to work fine as long as the body of the anonymous function
isn't either empty or ends with a semicolon, which is probably why
nobody noticed before.

-- 
Mikael Magnusson


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

* Re: Completion after anonymous function
  2016-07-13  5:00 Completion after anonymous function Daniel Shahaf
  2016-07-13 10:47 ` Mikael Magnusson
@ 2016-07-13 17:28 ` Bart Schaefer
  1 sibling, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2016-07-13 17:28 UTC (permalink / raw)
  To: zsh-workers

On Jul 13,  5:00am, Daniel Shahaf wrote:
}
} "() {} <TAB>" completes as a command position:

This is almost certainly going to be the same sort of issue as with
completing around redirections, for which we had that long (and
still not entirely resolved) thread back in April.


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

end of thread, other threads:[~2016-07-13 17:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-13  5:00 Completion after anonymous function Daniel Shahaf
2016-07-13 10:47 ` Mikael Magnusson
2016-07-13 17:28 ` 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).