Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG] With CORRECT_ALL, an interrupted correct puts a truncated entry in history
- X-seq: zsh-workers 52416
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [BUG] With CORRECT_ALL, an interrupted correct puts a truncated entry in history
- Date: Sun, 17 Dec 2023 14:54:07 +0100
- Archived-at: <https://zsh.org/workers/52416>
- In-reply-to: <CAH+w=7YXzr2w06kpD+FvyVJ7sJrcnyC+X7x+rfaeqr=Jo3TbrQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- Mail-followup-to: zsh-workers@xxxxxxx
- References: <20231205021217.GA357346@zira.vinc17.org> <CAH+w=7bZmryKWV6=kZhMU7=R9WPa+sFEFi1iJcybcJsnjw15_g@mail.gmail.com> <20231205125732.GA1126552@cventin.lip.ens-lyon.fr> <CAH+w=7bFpEhKjPB7RkAMi=zdwNb6pE5OZnTgtTEWJXBSm2p-9g@mail.gmail.com> <20231206150333.GA385094@zira.vinc17.org> <CAH+w=7YXzr2w06kpD+FvyVJ7sJrcnyC+X7x+rfaeqr=Jo3TbrQ@mail.gmail.com>
On 2023-12-09 13:44:42 -0800, Bart Schaefer wrote:
> On Wed, Dec 6, 2023 at 7:03 AM Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
> >
> > On 2023-12-05 13:22:07 -0800, Bart Schaefer wrote:
> > > On Tue, Dec 5, 2023 at 4:57 AM Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
> > > >
> > > > I thought that this would have been put in a temporary buffer,
> > > > until the (possibly corrected) command is validated.
> > >
> > > I'm not sure what you think "validated" means here.
> >
> > Once the user has no longer any way to discard the command line,
> > which will then be really run.
>
> Ah. It's in the buffer managed in ZLE as $BUFFER, but corrections
> apply left to right as that buffer is converted into a parse tree,
> they don't alter the buffer itself.
But if one does a first correction, for the second proposed
correction, one types 'e' to edit, one gets the buffer with
the first correction applied.
> > Or just use 'e', then immediately put the command in the history
> > without running it. Is there a zle widget for that? I would find
> > this useful even when there are no spelling corrections.
>
> That would be push-input, which is not bound to anything by default,
> but could probably be bound to ESC (shift)Q without disrupting use of
> push-line on ESC q.
>
> Correction is not itself a ZLE action -- it happens after ZLE has
> returned control to the parser, and works even if ZLE is disabled. So
> there's no widget to fiddle with it.
But what matters to that after 'e', one is in ZLE.
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author