zsh-workers
 help / color / mirror / code / Atom feed
From: Moritz Bunkus <moritz@bunkus.org>
To: zsh-workers@zsh.org
Subject: replace-regex widget not replacing semicolons
Date: Tue, 11 Jun 2013 14:49:42 +0200	[thread overview]
Message-ID: <CANPayMR2TPcxOz-GY6kQYuXongGMy5W_d255y7JZn2_Z+dg3CQ@mail.gmail.com> (raw)

Hey,

I'm using replace-regex bound to ALT+r, and it usually works quite
well. Today I noticed that it doesn't replace semicolons, though. It
looks like an off-by-one error when removing the char from the buffer.
For example, when I enter

$ asd ; qwe

and replace ; by any single char (e.g. "+") then the line stays
exactly as it is.

However, if I try to replace it by two or more chars (e.g. "&&") then
one of the replaced chars is missing and the semicolon stays in its
place, like this:

$ asd &; qwe

How to reproduce:

chai-latte$ zsh --norcs
chai-latte% autoload regexp-replace
chai-latte% autoload replace-string
chai-latte% zle -N replace-regex replace-string
chai-latte% bindkey "^[r" replace-regex
chai-latte% asd ; qwe

Now hit ALT+r, enter ; and &&, see the output changed to:

chai-latte% asd &; qwe

Kind regards,
mosu


             reply	other threads:[~2013-06-11 12:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-11 12:49 Moritz Bunkus [this message]
2013-06-11 17:07 ` Bart Schaefer
2013-06-12  6:46   ` Moritz Bunkus

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=CANPayMR2TPcxOz-GY6kQYuXongGMy5W_d255y7JZn2_Z+dg3CQ@mail.gmail.com \
    --to=moritz@bunkus.org \
    --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).