zsh-workers
 help / color / mirror / code / Atom feed
* No incremental undo in vi mode
@ 2016-02-27  6:35 Michael Giuffrida
  2016-02-27 16:47 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Giuffrida @ 2016-02-27  6:35 UTC (permalink / raw)
  To: zsh-workers

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

When using vi bindings, my understanding is that `C-_` should trigger
readline's undo behavior, as should `u` when in command mode.[1]

In emacs mode, and in bash (emacs mode or vi mode), this works as expected:
`C-_` performs incremental undo (e.g., removes the last typed character, or
restores the line to the previous text after expanding a glob via Tab).

In zsh in vi mode, it just clears the whole line. So it's not useful for
undoing the effect of glob expansion or other tab completion.

Is this a bug or am I doing something wrong? Apologies in advance if this
is a silly question. I'm brand new to zsh and couldn't figure this out
through man pages, searching, mailing list archives, patches, or release
notes...

[1] http://zsh.sourceforge.net/Guide/zshguide06.html

zsh 5.0.5 (x86_64-pc-linux-gnu)
GNU Readline 6.3

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

* Re: No incremental undo in vi mode
  2016-02-27  6:35 No incremental undo in vi mode Michael Giuffrida
@ 2016-02-27 16:47 ` Bart Schaefer
  2016-02-27 21:33   ` Michael Giuffrida
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2016-02-27 16:47 UTC (permalink / raw)
  To: Zsh hackers list

On Fri, Feb 26, 2016 at 10:35 PM, Michael Giuffrida
<michaelpg@google.com> wrote:
> When using vi bindings, my understanding is that `C-_` should trigger
> readline's undo behavior, as should `u` when in command mode.[1]

Zsh does not use readline.  It has its own editor with its own set of
key bindings.

> In zsh in vi mode, it just clears the whole line. So it's not useful for
> undoing the effect of glob expansion or other tab completion.

Are you sure you have C-_ bound to what you think you do?  With

bindkey -v
bindkey '\C-_' undo

I get the behavior you expect rather than the behavior you report.

What does

bindkey '\C-_'

output for you?


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

* Re: No incremental undo in vi mode
  2016-02-27 16:47 ` Bart Schaefer
@ 2016-02-27 21:33   ` Michael Giuffrida
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Giuffrida @ 2016-02-27 21:33 UTC (permalink / raw)
  To: Bart Schaefer, Zsh hackers list

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

Explicitly binding "undo" to a key didn't help.

However, I've gone ahead and bisected this; looks like it was introduced
between 5.0.2 and 5.0.3, and fixed in 5.0.5-dev-1.

Introduced in: 0ed3c5c (31765: If zle starts in viins mark as insertion.
    This allows undo to work on everything entered.)
Fixed in: a8c4ed6 (32314: merge undo events corresponding to vi change in
the vi-cmd-mode widget so undo from insert mode is useful again)

Guess I'll upgrade. Thanks!

On Sat, Feb 27, 2016 at 8:47 AM Bart Schaefer <schaefer@brasslantern.com>
wrote:

> On Fri, Feb 26, 2016 at 10:35 PM, Michael Giuffrida
> <michaelpg@google.com> wrote:
> > When using vi bindings, my understanding is that `C-_` should trigger
> > readline's undo behavior, as should `u` when in command mode.[1]
>
> Zsh does not use readline.  It has its own editor with its own set of
> key bindings.
>
> > In zsh in vi mode, it just clears the whole line. So it's not useful for
> > undoing the effect of glob expansion or other tab completion.
>
> Are you sure you have C-_ bound to what you think you do?  With
>
> bindkey -v
> bindkey '\C-_' undo
>
> I get the behavior you expect rather than the behavior you report.
>
> What does
>
> bindkey '\C-_'
>
> output for you?
>

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

end of thread, other threads:[~2016-02-27 21:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-27  6:35 No incremental undo in vi mode Michael Giuffrida
2016-02-27 16:47 ` Bart Schaefer
2016-02-27 21:33   ` Michael Giuffrida

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