Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Off-by-one with select-*-shell-word text object?
- X-seq: zsh-workers 39363
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Off-by-one with select-*-shell-word text object?
- Date: Fri, 16 Sep 2016 10:21:37 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:to:subject:mime-version; bh=DGQv2kaemndFFA1cJlWyiUJdNdK1QdEctiJ8ms+RYTg=; b=h2579f1BnaXAQ2M5Ic42bqQYIUEy6rkuILW/qPJC0dm6ERtWvJ/k8ADjKTTsED3nNW 1W1Ha2ZR58j0JqFuUzdCi2vBxMzT/z1Lszoh6SrMyCsZIoJHeEo1qAlI4dgPnG7iONCA Tyk9UiNtcDI3AdbRKlbqzUN47ynB0zc5EKL5e+ALG/z8QrrPmLIjvI2K1SjDCYRfvmys 0DsDv6XbYKCXiZktkEJZ+9QEqXhC58BR4/C2Sl+FVnH4OV61oEkqlkyg2nvSKvLF53OW Nq7eGkeenm+eT2yDrDxLFay7NmbMixaAgyQAT5BGgMBxOMAs3XUyZ5NXF9X6lnR555cM DOqQ==
- 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
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author