Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
replace-regex widget not replacing semicolons
- X-seq: zsh-workers 31470
- From: Moritz Bunkus <moritz@xxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: replace-regex widget not replacing semicolons
- Date: Tue, 11 Jun 2013 14:49:42 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bunkus.org; s=mail2013040101; t=1370954984; bh=fgbDqrc7fOLnvMiMD7PAddjZnRaUK7iWVbSDJbsXbEo=; h=Date:Subject:From:To; b=bke+8p2oQ4mIKovE/Ka3UZeAjtm6Cc8XEz5Evapc/N121N8PZHaiwVdr0OzacEq7E bBH2fusUibWVlu37V1MGCrBRkueLMiDFoE+98GFyrwk9Y4KsVpdFMWtOxmjSFInJ6f rVPtzCXn0T8W+nTUoUhOpCCpWdotojpGYuBRe9GY=
- 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
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author