zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] copy-prev-shell-word broken since 4.3.11
@ 2013-12-29  3:04 Carl Drougge
  2013-12-29  6:26 ` Bart Schaefer
  2014-01-02 20:49 ` Peter Stephenson
  0 siblings, 2 replies; 3+ messages in thread
From: Carl Drougge @ 2013-12-29  3:04 UTC (permalink / raw)
  To: zsh-workers

I used to be able to use copy-prev-shell-word to copy the word to the left of
my cursor. At some point this broke, always giving the last word on the line,
and I couldn't be bothered to look into it. Now I have looked at it. It works
in 4.3.10, not in 4.3.11.

I have never looked at the zsh source before, but hopefully this patch doesn't
break something else. The bufferwords function (and the whole lexer) seems
pretty, uh, frightening.

--- Src/Zle/zle_misc.c.orig     2013-12-29 03:49:50.485020686 +0100
+++ Src/Zle/zle_misc.c  2013-12-29 03:35:06.661038824 +0100
@@ -843,7 +843,7 @@
     if (zmult <= 0)
 	return 1;
 
-    if ((l = bufferwords(NULL, NULL, &i, 0))) {
+    if ((l = bufferwords(NULL, NULL, &i, LEXFLAGS_ZLE))) {
 	i -= (zmult-1);
 	if (i < 0)
 	    return 1;


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

* Re: [PATCH] copy-prev-shell-word broken since 4.3.11
  2013-12-29  3:04 [PATCH] copy-prev-shell-word broken since 4.3.11 Carl Drougge
@ 2013-12-29  6:26 ` Bart Schaefer
  2014-01-02 20:49 ` Peter Stephenson
  1 sibling, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2013-12-29  6:26 UTC (permalink / raw)
  To: zsh-workers

On Dec 29,  4:04am, Carl Drougge wrote:
} Subject: [PATCH] copy-prev-shell-word broken since 4.3.11
}
} I used to be able to use copy-prev-shell-word to copy the word to the
} left of my cursor. At some point this broke, always giving the last
} word on the line, [...]
}
} I have never looked at the zsh source before, but hopefully this patch
} doesn't break something else.

LEXFLAGS_ZLE looks quite plausible here, and it does seem to work as
expected.  However, I think I'm going to wait for PWS to pick this one
up, as he's the originator of LEXFLAGS_*.

I just noticed that, given a multiplier > 1, copy-prev-word includes the
whitespace following the copied word, whereas copy-prev-shell-word does
not.  I don't have 4.3.10 handy to test with and 4.2.0 doesn't support
using the numeric multiplier to retrieve earlier words.  I think this is
actually a "bug" in copy-prev-word because the whitespace is not kept
when the multiplier is 1 (or not given).

-- 
Barton E. Schaefer


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

* Re: [PATCH] copy-prev-shell-word broken since 4.3.11
  2013-12-29  3:04 [PATCH] copy-prev-shell-word broken since 4.3.11 Carl Drougge
  2013-12-29  6:26 ` Bart Schaefer
@ 2014-01-02 20:49 ` Peter Stephenson
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 2014-01-02 20:49 UTC (permalink / raw)
  To: Carl Drougge, zsh-workers

On Sun, 29 Dec 2013 04:04:56 +0100
Carl Drougge <zsh@z42.net> wrote:
> I used to be able to use copy-prev-shell-word to copy the word to the left of
> my cursor. At some point this broke, always giving the last word on the line,
> and I couldn't be bothered to look into it. Now I have looked at it. It works
> in 4.3.10, not in 4.3.11.
> 
> I have never looked at the zsh source before, but hopefully this patch doesn't
> break something else. The bufferwords function (and the whole lexer) seems
> pretty, uh, frightening.

Thanks, that looks sensible and I've committed it.

The flags were introduced to attempt to bring some method to the horror,
but the interaction between the main shell and the line editor is still
brutal.  Feel free to add messages containg "get_comp_string" to your
kill filter.

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


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

end of thread, other threads:[~2014-01-02 21:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-29  3:04 [PATCH] copy-prev-shell-word broken since 4.3.11 Carl Drougge
2013-12-29  6:26 ` Bart Schaefer
2014-01-02 20:49 ` Peter Stephenson

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