zsh-users
 help / color / mirror / code / Atom feed
* Is it possible to disable cursor movement when running completion?
@ 2019-04-09 21:15 Eric Freese
       [not found] ` <CAHYJk3Q-Tpb9zGXoj_TFPH4BDhr9zHa4bPo0CambrenvmSLriQ@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Freese @ 2019-04-09 21:15 UTC (permalink / raw)
  To: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 421 bytes --]

Hi all,

When I run `zsh -f`, type `ls "/"`, and hit tab, zsh moves the cursor back
to just before the closing quote and offers completions from there. If I
hit tab again, the buffer is expanded to `ls "/bin/"` (the first completion
match).

Is it possible to disable this behavior, such that when I press tab at the
end of a quoted string it does not move the cursor back and instead offers
no completion?

Thanks,
Eric

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

* Re: Is it possible to disable cursor movement when running completion?
       [not found] ` <CAHYJk3Q-Tpb9zGXoj_TFPH4BDhr9zHa4bPo0CambrenvmSLriQ@mail.gmail.com>
@ 2019-04-10 22:22   ` Eric Freese
  2019-04-10 22:53     ` Mikael Magnusson
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Freese @ 2019-04-10 22:22 UTC (permalink / raw)
  To: Mikael Magnusson; +Cc: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 1428 bytes --]

> If you don't want any completions offered, you can simply not press tab.

Makes sense. Unfortunately I'm needing to apply the answer to this question
to
a more complex use case.

I'm using a pty (via zpty module) to capture the first completion result to
display as a suggestion in zsh-autosuggestions plugin. See the GitHub pull
request here: https://github.com/zsh-users/zsh-autosuggestions/pull/401 and
the
issue that triggered this question here:
https://github.com/zsh-users/zsh-autosuggestions/issues/354

I'm wondering if there is a zstyle that I can set to avoid this
cursor-moving
behavior. I've scanned through the documentation and haven't seen anything,
but
I feel like I could easily be missing something.


Eric Freese


On Wed, Apr 10, 2019 at 2:21 PM Mikael Magnusson <mikachu@gmail.com> wrote:

> On 4/9/19, Eric Freese <ericdfreese@gmail.com> wrote:
> > Hi all,
> >
> > When I run `zsh -f`, type `ls "/"`, and hit tab, zsh moves the cursor
> back
> > to just before the closing quote and offers completions from there. If I
> > hit tab again, the buffer is expanded to `ls "/bin/"` (the first
> completion
> > match).
> >
> > Is it possible to disable this behavior, such that when I press tab at
> the
> > end of a quoted string it does not move the cursor back and instead
> offers
> > no completion?
>
> If you don't want any completions offered, you can simply not press tab.
>
> --
> Mikael Magnusson
>

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

* Re: Is it possible to disable cursor movement when running completion?
  2019-04-10 22:22   ` Eric Freese
@ 2019-04-10 22:53     ` Mikael Magnusson
  0 siblings, 0 replies; 3+ messages in thread
From: Mikael Magnusson @ 2019-04-10 22:53 UTC (permalink / raw)
  To: Eric Freese; +Cc: Zsh Users

[sorry about replying privately before, the gmail interface is pretty
broken these days]

On 4/11/19, Eric Freese <ericdfreese@gmail.com> wrote:
>> If you don't want any completions offered, you can simply not press tab.
>
> Makes sense. Unfortunately I'm needing to apply the answer to this question
> to
> a more complex use case.
>
> I'm using a pty (via zpty module) to capture the first completion result to
> display as a suggestion in zsh-autosuggestions plugin. See the GitHub pull
> request here: https://github.com/zsh-users/zsh-autosuggestions/pull/401 and
> the
> issue that triggered this question here:
> https://github.com/zsh-users/zsh-autosuggestions/issues/354
>
> I'm wondering if there is a zstyle that I can set to avoid this
> cursor-moving
> behavior. I've scanned through the documentation and haven't seen anything,
> but
> I feel like I could easily be missing something.

This isn't really a supported usecase at all, but I think the state of
the art hack for it is still
https://github.com/Valodim/zsh-capture-completion

-- 
Mikael Magnusson

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

end of thread, other threads:[~2019-04-10 22:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-09 21:15 Is it possible to disable cursor movement when running completion? Eric Freese
     [not found] ` <CAHYJk3Q-Tpb9zGXoj_TFPH4BDhr9zHa4bPo0CambrenvmSLriQ@mail.gmail.com>
2019-04-10 22:22   ` Eric Freese
2019-04-10 22:53     ` Mikael Magnusson

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