Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1460581264; bh=z2j/Khzh4jWcyZb9YgUmB23oZ/gpqO40jkZEcQM++aw=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=KRLIl6ipkHtmlNSXFmuYL4ZgelSpR4u+iinZb4lUXRHRYNKRcnKjQ81KNPm7FPN5B/oCVh8YGE5A0Gwm2utPeu07rKMZUEdefxsA4kUFIHRDuRDDlamDPphhpHIhNp8wuWMSbMo+TfcS9onltHu3D/atGa5u0L2gDzPJqHHXFV/xLHYEucm3nelMC6bzVqY2Dg+31EAmSj1uhELs2y/NgDKgra3LWD2L446kvUal3mDudilGOydgjjYUFJAS2xVWsGArpPsra2Oqtp59lAwwepkSurO5TFNcW7A7Q2TcyUhLqzKN2Kpp5rE+x1gkdbx8MLt33cis27EDyPupa1ugDA==
X-Yahoo-Newman-Id: 952897.18704.bm@smtp149.mail.ir2.yahoo.com
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: HNq_XmMVM1nmft9AZM7I3dGypfPtIxFEKn7WDbMHo9GetqX
 ffVI1lr8pneVHLp1T3OiT6zESEW9.wJBYj_VErcTGajBORiVw2h_FTVIFgMi
 0FNVMaiwBvcpfb2Ucq5BF1MZUosrNStqLNYnyWLU42YtlLyjhmcykRwngzCl
 .4DsKXHCMW_khYMnxKmy0m4Fg.0qmwo8U2BHitr_PTex7C9hSMUzzgCaNN3A
 KU_qtVjF1K24Q1hgkN4opec77BZfUkF70LzNW4_agSmde79UuuKdsSPF49r7
 f_T1ygxWq5tpUwcDeP4qJVW.AXsTlA9SNPFbzknN_ZxeJssHjyUCsd3NjwAt
 9oWnJ5Y4uFEreMmPy_5eBDKQafYO7HRU7WVbD27skWxwb4c4QHyb6OZ0yQo.
 qsCe.0f145OTFXGkVHYv1C.0ttbe3DyGBtbPjRJD_YP9EZOCvjfadW9Jl3Rx
 rQXfCRXxo7sTv2BpF6F.q84F.zgyb61lzRpGM2.wE1J3ekUnS7X6SYUuuW_0
 pGIl6hZi0ECKHJVZj_YmUed5S8Y8-
X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI-
In-reply-to: <160111211125.ZM6061@torch.brasslantern.com>
From: Oliver Kiddle <okiddle@yahoo.co.uk>
References: <160111211125.ZM6061@torch.brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: yank-pop broken in current dev zsh?
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <2376.1460581263.1@thecus.kiddle.eu>
Date: Wed, 13 Apr 2016 23:01:03 +0200
Message-ID: <2377.1460581263@thecus.kiddle.eu>
X-Seq: zsh-workers 38286

On 11 Jan, Bart wrote:
> with "thre" highlighted and the cursor on the final "e".  The cursor should
> be after the entire word "three", should it not?  The whole "three" is then

> I suppose this might be related to the CURSOR increment I mentioned needing
> following select-in-shell-word in a widget.

That's more-or-less exactly what the issue is. There was a cursor
correction in there that should only be there for vi command-mode. Does
things seem right in emacs mode with the following fix?

In many cases we compare zlecs to findbol() for the correction but I
don't think that would be correct in this case.

diff --git a/Src/Zle/zle_misc.c b/Src/Zle/zle_misc.c
index 25f65b3..a040ca0 100644
--- a/Src/Zle/zle_misc.c
+++ b/Src/Zle/zle_misc.c
@@ -597,7 +597,7 @@ static void pastebuf(Cutbuffer buf, int mult, int position)
 	    zlecs += cc;
 	}
 	yanke = zlecs;
-	if (zlecs)
+	if (zlecs && invicmdmode())
 	    DECCS();
     }
 }

