zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: Shift-Insert erratic behavior in edit-command-line vim
Date: Tue, 25 Oct 2016 09:25:22 -0700	[thread overview]
Message-ID: <161025092522.ZM7635@torch.brasslantern.com> (raw)
In-Reply-To: <CAMtVo_O6c3v-4ErBPOqEvG5KjJ5Jh7Vbwddq2N9w8F0GDUkKRQ@mail.gmail.com>

On Oct 25,  8:48pm, lolilolicon wrote:
}
} I use ESC-e (edit-command-line) to edit the current command line in vim.
} Usually in vim Insert mode, I can use Shift-Insert to insert X PRIMARY
} selection, but for some reason, it doesn't work here.
} Instead, vim would enter Normal mode and execute... something

Another side-effect of bracketed-paste.  Fixed in the forthcoming 5.3
release; partial patch was posted in zsh-users/20873, but here is the
full set of changes.

diff --git a/Functions/Zle/edit-command-line b/Functions/Zle/edit-command-line
index 103a1c1..353f260 100644
--- a/Functions/Zle/edit-command-line
+++ b/Functions/Zle/edit-command-line
@@ -1,8 +1,8 @@
 # Edit the command line using your usual editor.
-# Binding this to 'v' in the vi command mode map,
+# Binding this to '!' in the vi command mode map,
 #   autoload -Uz edit-command-line
 #   zle -N edit-command-line
-#   bindkey -M vicmd v edit-command-line
+#   bindkey -M vicmd '!' edit-command-line
 # will give ksh-like behaviour for that key,
 # except that it will handle multi-line buffers properly.
 
@@ -10,7 +10,9 @@
   exec </dev/tty
 
   # Compute the cursor's position in bytes, not characters.
-  setopt localoptions nomultibyte
+  setopt localoptions nomultibyte noksharrays
+
+  (( $+zle_bracketed_paste )) && print -r -n - $zle_bracketed_paste[2]
 
   # Open the editor, placing the cursor at the right place if we know how.
   local editor=${${VISUAL:-${EDITOR:-vi}}}
@@ -24,6 +26,8 @@
     (*) ${=editor} $1;;
   esac
 
+  (( $+zle_bracketed_paste )) && print -r -n - $zle_bracketed_paste[1]
+
   # Replace the buffer with the editor output.
   print -Rz - "$(<$1)" 
 } =(<<<"$PREBUFFER$BUFFER")

-- 
Barton E. Schaefer


  parent reply	other threads:[~2016-10-25 16:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-25 12:48 lolilolicon
2016-10-25 13:05 ` lolilolicon
2016-10-25 16:25 ` Bart Schaefer [this message]
2016-10-25 16:40   ` lolilolicon

Reply instructions:

You may reply publicly 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=161025092522.ZM7635@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).