Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zle: vi mode: wrong undo handling on fresh lines
- X-seq: zsh-workers 32347
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: zle: vi mode: wrong undo handling on fresh lines
- Date: Tue, 04 Feb 2014 00:26:02 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1391469964; bh=AbLAUB/+3/I6FqIlv8+2A0aaZ1hTxvmyRCEDxHK8eiQ=; h=Received:Received:Received:DKIM-Signature:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Received:In-reply-to:From:References:To:Subject:Date:Message-ID; b=eqRjOPD1C6b+vp4mCNjw6S+fPYCDrQSaKSI03O2Gum9qb6ESXCSpGUgPcyc0qZuMfKjR+WNOlzBa18xIuAS445om/whlrZQqA47HQWeuY7Swmx0PIDCm3hxGyMDiCU798gbt6zB/m2ori7Zac6VH8NvTZdCdRu8Ywq4FpzQLTms=
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1391469964; bh=AbLAUB/+3/I6FqIlv8+2A0aaZ1hTxvmyRCEDxHK8eiQ=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Received:In-reply-to:From:References:To:Subject:Date:Message-ID; b=S+w1eB3CFb61clwSGrl1YdgVoz1SJam/Aaf/1WKNBmlU2flZHoSh4EPNBUSOO50njtOdla7em+eiGwAov/U39jqr18Q/9deX014NbXvrivGVgP23CO6n+6zo5Abgf5NO7TdFijKgyN8V7DJSuPkOeNGIiZzHN2SAzvEeRvSUgcE=
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.uk; b=PTcFco4pz9uyZsVV2tuqmAeXC3YB7G/BqgL5Ke3UFRC6Rwp1PwJCkR7hOz7n6lAPV7BsXHzMq3NV1tHZjuVpmmq1HZP68N0ojZV77CZ+Ee8XNCmwBWybpW2qOIAKWW+u/7flQdSVohs3TT8XtQEMy6A3oum+yoGqDnEsGr6zk+M=;
- In-reply-to: <CAH+w=7ZP1GzdJq3NgL0_X1sn22409353Atn+FDUwc=G=GrPMPw@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CANWLQWsV5i+=3NptAxir6UYCoipFa2Pk+g6D1DDnMnJMVCbDgA@mail.gmail.com> <20130923213014.15f97f9e@pws-pc.ntlworld.com> <3511.1390605547@thecus.kiddle.eu> <140125111530.ZM21792@torch.brasslantern.com> <20140127124301.4144f2d9@pwslap01u.europe.root.pri> <20140127161124.2aa16b37@pwslap01u.europe.root.pri> <2700.1390950035@thecus.kiddle.eu> <EA3D3D1C-A0E8-4DA0-B10D-5B428A02AB51@kba.biglobe.ne.jp> <19068.1391204240@thecus.kiddle.eu> <19751.1391207572@thecus.kiddle.eu> <163F74F2-3FA8-4478-B354-491C006590C9@kba.biglobe.ne.jp> <16516.1391462981@thecus.kiddle.eu> <CAH+w=7ZP1GzdJq3NgL0_X1sn22409353Atn+FDUwc=G=GrPMPw@mail.gmail.com>
Bart wrote:
> The obvious reason is that "new completion" has already re-bound
> complete-word to the _main_complete function. You can't override the
> .complete-word form, so you're always going to bypass new completion when
> running "zle .complete-word".
Oh, of course. That makes sense. Thanks.
> To get what I think you're after here, you'd more likely want
>
> complete_word() {
> _main_complete "$@"
> }
> zle -C complete-word .complete-word complete-word
I was trying to find a way to call split-undo before completion without
binding tab to something that isn't named complete-word. This tends to
help for older parts of the shell like incremental history searches
that don't use their own keymap and I theorised that it might help on
the second problem mentioned by Jun. However, menuselect and listscroll
actually have their own keymaps so perhaps not.
Anyway with the help of your hint, perhaps this:
zle -C undo-complete-word .complete-word _main_complete
complete-word() {
zle split-undo
zle undo-complete-word
}
zle -N complete-word
Or perhaps the same but with a custom name for the function that is
then aliased to complete-word with zle -A.
With that, split-undo is interfering with AUTO_MENU. The following patch
seems to sort that out. At least in my setup, it now seems to work.
Oliver
diff --git a/Src/Zle/iwidgets.list b/Src/Zle/iwidgets.list
index 7872745..95cdca2 100644
--- a/Src/Zle/iwidgets.list
+++ b/Src/Zle/iwidgets.list
@@ -102,7 +102,7 @@
"self-insert-unmeta", selfinsertunmeta, ZLE_MENUCMP | ZLE_KEEPSUFFIX
"send-break", sendbreak, 0
"set-mark-command", setmarkcommand, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL
-"split-undo", splitundo, ZLE_MENUCMP | ZLE_KEEPSUFFIX
+"split-undo", splitundo, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_NOTCOMMAND
"spell-word", spellword, 0
"set-local-history", setlocalhistory, 0
"transpose-chars", transposechars, 0
Messages sorted by:
Reverse Date,
Date,
Thread,
Author