Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Fix transpose-words on 1-char word
- X-seq: zsh-workers 33815
- From: Marc Finet <m.dreadlock@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH: Fix transpose-words on 1-char word
- Date: Thu, 27 Nov 2014 23:04:04 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=vTHQ3O+nKHLcJMseURS9N8HojonlRo1D8EtVhzO6gP4=; b=d1TwF0aywCpInsxj2kzpCE0ARjddmcj/rT87dEBQ7pgQFyDO68A/YNO9rjYl5clWSj 1qZJDRRpxHIjp3eFvtKdtHG0bQ0Rc9r67F2vEberLP1e1vxtoD7TaKEIRJ2n4HMIpcPk OgbR8PWPdGqCoWgFJ9WTkuOfjVcEkSklQmwQDZ2JaK6Tj4qkHxFQxTQKJwEMctlVrjoz P7+8G/HXKK3UVzHjf11zIRyOMGLvn75zPyiOhWaOSjK+Fq9upoV7DPmQlNCPthXe5utr eXmcTVSNIlsx6l2MvMRNSNvXwnoEybVEmJvilAgh8fDad5DHXYXBQeK9rC9cDN4Rhbnx hq6A==
- 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
Invoking transposewords on a 1-char word lead to previous words to be
swapped, i.e. foo and bar instead of bar and x:
# foo bar x<transpose-words>
# bar foo x
Commit 72bd9ee6 "24825: fix internal word-boundary widgets" rewrote
that part but changed a test:
if (!x || zleline[x - 1] == ZWC('\n'))
return 1;
into a test plus an assignment:
if (!x)
return 1;
pos = x;
DECPOS(pos);
if (zleline[pos] == ZWC('\n'))
return 1;
x = pos;
---
Src/Zle/zle_word.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/Src/Zle/zle_word.c b/Src/Zle/zle_word.c
index 301b18d..cb5e5db 100644
--- a/Src/Zle/zle_word.c
+++ b/Src/Zle/zle_word.c
@@ -690,7 +690,6 @@ transposewords(UNUSED(char **args))
DECPOS(pos);
if (zleline[pos] == ZWC('\n'))
return 1;
- x = pos;
}
for (p4 = x; p4 != zlell && ZC_iword(zleline[p4]); INCPOS(p4))
;
--
2.1.3
Messages sorted by:
Reverse Date,
Date,
Thread,
Author