zsh-users
 help / color / mirror / code / Atom feed
From: Bernhard Tittelbach <xro@realraum.at>
To: zsh-users@zsh.org
Subject: Re: up-line and down-line without history
Date: Wed, 01 Jun 2011 17:01:56 +0200	[thread overview]
Message-ID: <4DE65464.6080806@realraum.at> (raw)
In-Reply-To: <4DE64D77.2090908__48299.741469282$1306940266$gmane$org@realraum.at>

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
>


  parent reply	other threads:[~2011-06-01 15:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <905914.60054.qm__35866.2271559753$1306914819$gmane$org@web65607.mail.ac4.yahoo.com>
2011-06-01 14:32 ` Bernhard Tittelbach
2011-06-01 15:12   ` Bart Schaefer
     [not found] ` <4DE64D77.2090908__48299.741469282$1306940266$gmane$org@realraum.at>
2011-06-01 15:01   ` Bernhard Tittelbach [this message]
2011-06-01 15:17     ` Guido van Steen
2011-06-01  7:45 Guido van Steen
2011-06-01 15:00 ` Bart Schaefer
2011-06-01 15:06   ` Richard Hartmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DE65464.6080806@realraum.at \
    --to=xro@realraum.at \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).