Zsh Mailing List Archive
Messages sorted by:
Re: Bug in undo/redo handling in conjunction with history-beginning-search-backward
- X-seq: zsh-workers 38583
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: Bug in undo/redo handling in conjunction with history-beginning-search-backward
- Date: Thu, 2 Jun 2016 15:09:18 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=umheL3kYbuYrVwcdDaOaF+HySTwboSenjnBgP/juusM=; b=dnNZXSw/5nQThiW50OVY5SRRmFvdfaik4F1proxuFI2IoHJVSGVKEJ0Q++HKW5BTUI kUAEGK1+bwxRUkaEn1YQpIIHby0fboBbHtksl8PLTo0OWS0qdVVarsh15Esk5qb2Wc4e hsVH3kZI/+nq1lgAqUhuT0GnLQEVJAV0F5LmG4xYDzilM+gc8b/Z595NvRxFcPiFLQaA Ve48EFRgDMB3kJoBsUaPekRNSfJYBhSA4EZgdei37tP/WlrrMskn/TGMaPHKS+IQA1WG k8s69xF2j357TjW1lRaMKbCtSEF6F9XeD+GmR+XwG23IcrFXL+LvJkP1e5Jg+o1kKBe9 ULUA==
- In-reply-to: <firstname.lastname@example.org>
- List-help: <mailto:email@example.com>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAHYJk3TPHXFx96mm-40hvEqnd__8v8mnebiZ1r+thxGorZzemail@example.com> <firstname.lastname@example.org> <160602002257.ZM14758@torch.brasslantern.com> <email@example.com>
On Jun 2, 5:12pm, Oliver Kiddle wrote:
} bracketed-paste-magic does fc -p which invalidates HISTNO.
} So one undo blanks the whole line; a second undo tries to move to
} history line 0 - which fails.
} fc -p/-P are not part of zle so don't save histline. This also explains
} why change 8 has a history line of 803 instead of 804. Use of fc -p
} within zle appears to be unique to bracketed-paste-magic.
Functions/Misc/sticky-note also uses it within ZLE, and has for years.
} What is the
} reason for using it? Are you trying to block history widgets even where
} they are listed in active-widgets?
That's the reason in bracketed-paste-magic; in sticky-note it differs.
History motions should be able to move around within the pasted text
(up-line-or-history) but not out of the paste into the actual history.
In sticky-note, an alternate history is substituted and the intention
is to let you move around and interact within it.
} So does anyone have any thoughts on how to handle this. The simplest is
} for fc -p/-P to detect zle being active and print an error.
That would be unfortunate.
} Perhaps we need some module callbacks for pushing and popping history.
} Zle would hook the callback, save histline and somehow mark this in
} the undo structure.
Either that, or perhaps there's some way for undo to detect that the
history has changed since the last time an undo point was recorded?
I'm not familiar with how the history push/pop works internally.
} I attach a patch to the state saving and restoring in
} bracketed-paste-magic. Don't expect this to fix anything. I did it to
} make things easier to understand. Was there a reason for half the state
} saving/restoring to be outside the if statement?
Basically (a) I first implemented it without using split-undo and (b) I
didn't trust undo to save and restore everything correctly for the context
needed by the paste-finish functions.
Messages sorted by: