zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: bracketed paste - chopping trailing newlines
Date: Mon, 14 Sep 2015 14:21:42 -0700	[thread overview]
Message-ID: <150914142142.ZM26109@torch.brasslantern.com> (raw)
In-Reply-To: <20150914203527.GC2683@tarsus.local2>

On Sep 14,  8:35pm, Daniel Shahaf wrote:
}
} As to interaction with the region: in my workflow, I sometimes do
} <set-mark-command>, <typing>, <quote-region>.  During that sequence,
} even I happen to do a paste during the <typing> part, I wouldn't want
} MARK to move to the start of the paste.  I don't know <paste> should
} default to moving MARK.

Hm.  This is down to whether pasting is an actual editor action, or
just another form of user input.  For example MARK and CURSOR are
reset by the yank widget in exactly the circumstance you describe,
and bracketed-paste is currently implemented mostly 'as if' the pasted
text were cut into the kill ring and then yanked.

Also, just as an aside, if the region is highlighted ("active") but a
paste does NOT change the region, then how do you decide what ends up
highlighted after the paste?  And if the answer is "both", then how
can the default paste highlight be the same as the default region
highlight without being really confusing?

We still seem to have three competing desires here, depending on who
you ask:

(1) Insert exactly what I pasted, as if it were a single keystroke,
    without further interpretation or change to the editor state.

(2) Handle paste as an atomic editor command similar to yanking from
    an external buffer instead of from the kill ring (as currently).

(3) Treat a paste like multiple keystrokes, so that url-quote-magic
    and other input-related rebindings apply, but don't execute any
    non-input bindings (accept-line, motions, yanks, kills, etc.)

Obviously there can be some overlap, i.e., you might want it treated
as multiple keystrokes but still without change to the editor state.

Maybe we should have stuck with (1) in the C code and built out (2)
in script code the way bracketed-paste-magic builds out (3).  Or
maybe e.g. $zle_bracketed_paste should have more fields to specify
which bits of (2) should be performed.


  reply	other threads:[~2015-09-14 21:21 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-29  1:24 Carsten Hey
2015-08-29  5:00 ` Bart Schaefer
2015-08-30 20:25   ` Carsten Hey
2015-08-30 20:32     ` [patch] 5.0.9 vs 5.1 in source code comments (was: bracketed paste - chopping trailing newlines) Axel Beckert
2015-08-30 20:37     ` bracketed paste - chopping trailing newlines Axel Beckert
2015-08-31  5:47     ` Daniel Shahaf
2015-09-01 23:44       ` Bart Schaefer
2015-09-02 15:41         ` Daniel Shahaf
2015-09-01 23:48     ` Bart Schaefer
2015-09-03 23:59       ` Carsten Hey
2015-09-06  9:52         ` Daniel Shahaf
2015-09-06 13:51           ` Oliver Kiddle
2015-09-06 14:21             ` Bart Schaefer
2015-09-08 10:39               ` Oliver Kiddle
2015-09-10 14:45                 ` Bart Schaefer
2015-09-10 19:11                 ` Daniel Shahaf
2015-09-11 23:07                   ` Bart Schaefer
2015-09-12  0:17                     ` Mikael Magnusson
2015-09-12 15:58                       ` Bart Schaefer
2015-09-14 20:35                     ` Daniel Shahaf
2015-09-14 21:21                       ` Bart Schaefer [this message]
2015-09-07  2:11             ` Daniel Shahaf
2015-09-08 23:33             ` Carsten Hey
2015-09-08 23:48               ` Carsten Hey
2015-09-10  8:24                 ` Peter Stephenson
2015-09-07 21:13           ` Daniel Shahaf

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=150914142142.ZM26109@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --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
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).