zsh-workers
 help / color / mirror / code / Atom feed
* Off-by-one with select-*-shell-word text object?
@ 2016-09-16 17:21 Bart Schaefer
  2016-09-16 20:47 ` Oliver Kiddle
  0 siblings, 1 reply; 10+ messages in thread
From: Bart Schaefer @ 2016-09-16 17:21 UTC (permalink / raw)
  To: zsh-workers

Noticed during recent zsh-users thread:

torch% quote-this-word() { zle select-in-shell-word; zle quote-region }
torch% zle -N quote-this-word
torch% bindkey "''" quote-this-word
torch% echo foo''
torch% echo' foo'

Note the left-quote has now included the space preceding the word.  I at
first suspected another vi-mode vs. emacs-mode difference, but:

torch% bindkey -v "''" quote-this-word
torch% bindkey -v
torch% echo foo''
torch% echo' foo'

Same effect for select-a-shell-word.  The right thing happens if I avoid
the *-shell-word variant:

torch% quote-this-word() { zle select-in-word; zle quote-region }
torch% echo foo''
torch% echo 'foo'

If including the preceding space is intentional, it should be mentioned
in the documentation.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-09-19 15:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-16 17:21 Off-by-one with select-*-shell-word text object? Bart Schaefer
2016-09-16 20:47 ` Oliver Kiddle
2016-09-16 21:22   ` Bart Schaefer
2016-09-16 23:30     ` Oliver Kiddle
2016-09-17  3:02       ` Bart Schaefer
2016-09-17  7:42         ` Daniel Shahaf
2016-09-17 14:29           ` Bart Schaefer
2016-09-19  7:00             ` Daniel Shahaf
2016-09-19 10:01               ` Oliver Kiddle
2016-09-19 15:19                 ` Bart Schaefer

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).