From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2977 invoked by alias); 15 Nov 2014 07:10:14 -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: 33696 Received: (qmail 29865 invoked from network); 15 Nov 2014 07:10:02 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1416034999; bh=h5lvLuTu0tL5b9t5XtI3N/e7i6b1HMV0IKuV10M3AlA=; h=From:To:Subject:Date:From:Subject; b=Iv9ckwWpN2/akGva2zkVlCXkeLMkwbqLv3dLPb//G0gOGADtvkRIFg+MVa9Ekeua+uqhd2bn8oAxlu9Z+rmuKoK47qeLeK53yyYRVU/Z4mS8rCdbhd5/PYni0EIUjIjkowo5LUgSvWL8B3DznZnBAYYuyhnmWexIyzATYvgfeA3tKNsOyu2XbA/jZkx5NrYVdBm4czc/UeBJBT6H3yRdAWy5AhCJT2mux4r1cMrh2nylx5eSK1pAkpt4HRSomYXLrdFgJwsosJASTxSQPLCBvw0x2lsuJyV4KL+kSL+URzcPXFCUW93g1WQ3N51FuPScLBX1qJF8BPxeaF6jLVCvhA== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.co.uk; b=CPPTxwDDW4qNIwOLTVFP8qEXOvy7vHtMpc4e4dyY78iexav89DVdo6u2PXoscKcX8q9QZCKnT62jFRRqLLBG8K7uYrkIWTvYlSR5pVawodO9g7zBiNIYV6DmCu4jOiTITAZuEVQPOlgdNlowInxU0Sss9sVGNLUGaIuuKytI8UvExQDdiSqXwATmL/CA862nfIhfUTW6qx0x61qoXBULMQZhAZMYjfhHpP9hIRkjs7bFgbDbjUvGsGTMV1nFpuMMvLJKgCTGQYuBDfXjvq0Qq5qHySPH7ZqfoBpK1+lpHqNZ9oPyz/w7FSB01s/nRP1+u9L400wnTLbauj7L9IoLIw==; X-Yahoo-Newman-Id: 366144.98357.bm@smtp126.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: iaeAg6oVM1kajMD9x129VJYew0vqwXFTJOlqvd4uHR_qDDW EfLBFSrUMQH6J1dA._ck28Fp60vHvoREk1A.l_pqeG28yqr2B60_S7yQUbqT eIquFIsR7RvUDUlL.pB56gqBtOK0w1Hkcu2I1.pOhpb_qWiCtkOASqcHBPF9 GQsUggVvmkwXE.lBgE_ryEgTsiLCUCTrPgub4OjlZEg.ilG1uKgQe_VYa2.h bGaGi4XMM9wCcy3Ak0xKgxXhgHUhhIYSkOK1DCVIGeirKdrU3.qedwR0DwaA CeSg1bSPhN4XHYwe5knL8BYopejLjXbdxsnvYMqzxQvCok98fzRt8npIDblO rB6Zu0Y3mSOOFG.hKv9E0mgbaQ6wHPXk4gatmpVyUMD4gDVEMu8aNA8xOq6p v5XyaSo4DG83Zp.lxpZz8oLr2paDtn8fdsbTZzAg.StJouOksbskKchApNX0 vJ7mX3Ynb6CHhvJZZPAAqRoQi7wnOwwrfy0ytYVyYoYTRX5.zodI.juAJelU kWMJ2dk_tcHg.zqvUB65QuwMATWn56uM- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- From: Oliver Kiddle To: Zsh workers Subject: PATCH: simple up/down line widgets MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <5058.1416034998.1@thecus.kiddle.eu> Date: Sat, 15 Nov 2014 08:03:18 +0100 Message-ID: <5059.1416034998@thecus.kiddle.eu> This adds simple up and down line widgets that don't do any history recall at all. Probably should have done this long ago because everything is already there so its a tiny change. I'll probably make these default in visual selection mode because I can't imagine anyone wanting history to work from there. Personally, I do all my history stuff from insert mode and will use these for vicmd. Oliver diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo index bf1b315..998bf4a 100644 --- a/Doc/Zsh/zle.yo +++ b/Doc/Zsh/zle.yo @@ -1087,6 +1087,10 @@ tindex(vi-beginning-of-line) item(tt(vi-beginning-of-line))( Move to the beginning of the line, without changing lines. ) +tindex(down-line) +item(tt(down-line) (unbound) (unbound) (unbound))( +Move down a line in the buffer. +) tindex(end-of-line) item(tt(end-of-line) (^E) (unbound) (unbound))( Move to the end of the line. If already at the end @@ -1179,6 +1183,10 @@ tindex(vi-rev-repeat-find) item(tt(vi-rev-repeat-find) (unbound) (,) (unbound))( Repeat the last tt(vi-find) command in the opposite direction. ) +tindex(up-line) +item(tt(up-line) (unbound) (unbound) (unbound))( +Move up a line in the buffer. +) enditem() texinode(History Control)(Modifying Text)(Movement)(Zle Widgets) subsect(History Control) diff --git a/Src/Zle/iwidgets.list b/Src/Zle/iwidgets.list index 39c81e6..2618297 100644 --- a/Src/Zle/iwidgets.list +++ b/Src/Zle/iwidgets.list @@ -41,6 +41,7 @@ "digit-argument", digitargument, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL | ZLE_NOTCOMMAND "down-case-word", downcaseword, 0 "down-history", downhistory, 0 +"down-line", downline, ZLE_LINEMOVE | ZLE_LASTCOL "down-line-or-history", downlineorhistory, ZLE_LINEMOVE | ZLE_LASTCOL "down-line-or-search", downlineorsearch, ZLE_LINEMOVE | ZLE_LASTCOL "emacs-backward-word", emacsbackwardword, 0 @@ -113,6 +114,7 @@ "universal-argument", universalargument, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL | ZLE_NOTCOMMAND "up-case-word", upcaseword, 0 "up-history", uphistory, 0 +"up-line", upline, ZLE_LINEMOVE | ZLE_LASTCOL "up-line-or-history", uplineorhistory, ZLE_LINEMOVE | ZLE_LASTCOL "up-line-or-search", uplineorsearch, ZLE_LINEMOVE | ZLE_LASTCOL "vi-add-eol", viaddeol, 0 diff --git a/Src/Zle/zle_hist.c b/Src/Zle/zle_hist.c index 44b39d1..bf7b5f4 100644 --- a/Src/Zle/zle_hist.c +++ b/Src/Zle/zle_hist.c @@ -227,14 +227,14 @@ uphistory(UNUSED(char **args)) } /**/ -static int -upline(void) +int +upline(char **args) { int n = zmult; if (n < 0) { zmult = -zmult; - n = -downline(); + n = -downline(args); zmult = -zmult; return n; } @@ -270,7 +270,7 @@ int uplineorhistory(char **args) { int ocs = zlecs; - int n = upline(); + int n = upline(args); if (n) { int m = zmult, ret; @@ -300,7 +300,7 @@ int uplineorsearch(char **args) { int ocs = zlecs; - int n = upline(); + int n = upline(args); if (n) { int m = zmult, ret; @@ -316,14 +316,14 @@ uplineorsearch(char **args) } /**/ -static int -downline(void) +int +downline(char **args) { int n = zmult; if (n < 0) { zmult = -zmult; - n = -upline(); + n = -upline(args); zmult = -zmult; return n; } @@ -358,7 +358,7 @@ int downlineorhistory(char **args) { int ocs = zlecs; - int n = downline(); + int n = downline(args); if (n) { int m = zmult, ret; @@ -388,7 +388,7 @@ int downlineorsearch(char **args) { int ocs = zlecs; - int n = downline(); + int n = downline(args); if (n) { int m = zmult, ret;