From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5080 invoked by alias); 23 Aug 2015 01:19:20 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36273 Received: (qmail 19420 invoked from network); 23 Aug 2015 01:19:18 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:to:subject:mime-version :content-type; bh=2TeA+Eg/TpDmUjBK1nNiaJqc8KcLIoxj/3pGFuSTSTA=; b=hzbq1EOQByxHpMwGe+pkShF2Ejm0VKZiGkVv/ad63GNDzW34WT7PrdJddW7LpJRVvP UPZBAh6bCuzNvK3N7I7DnpP5lJahVfTnkigqf8hIHSxjJmvS+DTe83sj/awXLYxb0+lO uMzVhEmAKUGYTVNuXoYGLLiAhHqawpCBv1CBFtNgFlXjsQxKkxeCUUj1JOUc8s24tsL3 v1Yrlqgwz/gpS00b6vXh89h8kzlTo6gcHVidMPkLKV3wyENU4+GrljczYmAN+grZdtjL SbIZoa62b7aK6s22WdyMnvHejRuiF0jGZ94xbNc38QP7FdElOKahhWmxEnwqYcGkjo1m wjTw== X-Gm-Message-State: ALoCoQki7LUV4gqzgW37BqMjcH5dhPhw8S66pmWt9AF9BRk82fYUFgGPlK2DHF2Eks3gXjNmeW+Z X-Received: by 10.182.39.194 with SMTP id r2mr15758350obk.20.1440292754301; Sat, 22 Aug 2015 18:19:14 -0700 (PDT) From: Bart Schaefer Message-Id: <150822181911.ZM31586@torch.brasslantern.com> Date: Sat, 22 Aug 2015 18:19:11 -0700 X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Vi command mode and end-of-line; ZWC('\n') ? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii That thread about end-of-line not working as a "bindkey -a" widget annoys me for some reason. I started looking through zle_move.c and discovered that in a few places we compare zleline[zlecs] == ZWC('\n') but in more places we simply do zleline[pos] == '\n' zleline[zlecs - 1] != '\n' There's even one comment about the latter /* works OK with combining chars since '\n' must be on its own */ So which is it? Should we be using ZWC() or not? Meanwhile, any objection to this? diff --git a/Src/Zle/zle_move.c b/Src/Zle/zle_move.c index f49df86..155fda8 100644 --- a/Src/Zle/zle_move.c +++ b/Src/Zle/zle_move.c @@ -344,6 +344,8 @@ endofline(char **args) zlecs = zlell; return 0; } + if ((zlecs += invicmdmode()) == zlell) + break; if (zleline[zlecs] == '\n') if (++zlecs == zlell) return 0; @@ -414,6 +416,8 @@ endoflinehist(char **args) zlecs = zlell; break; } + if ((zlecs += invicmdmode()) == zlell) + break; if (zleline[zlecs] == '\n') if (++zlecs == zlell) break;