zsh-workers
 help / color / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Zsh workers <zsh-workers@zsh.org>
Subject: PATCH: fixup describe-key-briefly for visual mode
Date: Tue, 03 Dec 2019 09:48:20 +0100
Message-ID: <2566-1575362900.729167@VoIY.B-xt.1-R2> (raw)
In-Reply-To: <2566-1575362900.729167.ref@VoIY.B-xt.1-R2>

The following fixes the describe-key-briefly widget to work from vi
visual mode. It also doesn't work right from menuselect, isearch etc but
fixing that is more involved.

Oliver

diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 22c12cf1f..27dc8ef21 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -1878,13 +1878,17 @@ describekeybriefly(UNUSED(char **args))
 {
     char *seq, *str, *msg, *is;
     Thingy func;
+    Keymap km;
 
     if (statusline)
 	return 1;
     clearlist = 1;
     statusline = "Describe key briefly: _";
     zrefresh();
+    if (invicmdmode() && region_active && (km = openkeymap("visual")))
+        selectlocalmap(km);
     seq = getkeymapcmd(curkeymap, &func, &str);
+    selectlocalmap(NULL);
     statusline = NULL;
     if(!*seq)
 	return 1;

           reply index

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <2566-1575362900.729167.ref@VoIY.B-xt.1-R2>]

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2566-1575362900.729167@VoIY.B-xt.1-R2 \
    --to=okiddle@yahoo.co.uk \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

zsh-workers

Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-workers

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git