From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2542 invoked by alias); 1 Jun 2011 15:07:05 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16065 Received: (qmail 2194 invoked from network); 1 Jun 2011 15:07:02 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at realraum.at does not designate permitted sender hosts) X-SourceIP: 80.109.208.103 Message-ID: <4DE65464.6080806@realraum.at> Date: Wed, 01 Jun 2011 17:01:56 +0200 From: Bernhard Tittelbach User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.23) Gecko/20091001 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 MIME-Version: 1.0 To: zsh-users@zsh.org Subject: Re: up-line and down-line without history References: <905914.60054.qm__35866.2271559753$1306914819$gmane$org@web65607.mail.ac4.yahoo.com> <4DE64D77.2090908__48299.741469282$1306940266$gmane$org@realraum.at> In-Reply-To: <4DE64D77.2090908__48299.741469282$1306940266$gmane$org@realraum.at> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.1 cv=CqMFsqQC4gx7bBgpmnW/wKYuJF/a5pXPeCAfngFtYkU= c=1 sm=0 a=O8dyF41ITTcA:10 a=I-SuZz5dmZEA:10 a=IkcTkHD0fZMA:10 a=TBM50Mg3FHqCnq4KerYA:9 a=QEXdDO2ut3YA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 On 2011-06-01 16:32, Bernhard Tittelbach wrote: > On 2011-06-01 09:45, Guido van Steen wrote: >> Dear List, >> >> I have been trying to find out how to "just" navigate through a multiline buffer. >> >> I know the "up-line-or-history" and "down-line-or-history" widgets. It seems >> to me that the "up-line" and "down-line" parts of these widgets do exactly >> what I want. So the problem is that I would like to avoid the "or-history" part. >> >> Are there a similar widgets that exclusively control the navigation of >> multiline buffers, i.e. without the side-effect of potentially navigating the >> history file? >> >> Or could/should I create my own widgets based on "up-line-or-history" and >> "down-line-or-history", in which I just override the "or-history" part? > as for writing it yourself, maybe, off the top of my head, something like this ?? function up-line { local buflines chars_above chars_left buflines=(${(f)LBUFFER}) chars_above="${#buflines[$#buflines-1]}" chars_left="${#buflines[$#buflines]}" [[ $chars_left -gt $chars_above ]] && chars_above=$chars_left CURSOR=$((CURSOR-chars_above-1)) } zle -N up-line && bindkey "^[[A" up-line > regards, > Bernhard >