Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Behaviour of {beginning,end}-of-buffer-or-history



On 2011-06-01 21:43, Bernhard Tittelbach wrote:
Hi,

recently I was dissatisfied with the behavior of my HOME/END keys.
What I wanted was this:

If cursor is a beginning/end of the buffer
  then jump to the beginning/end of the history
Else
  jump to the beginning/end of that line,
  no matter whether we are in a multi- or single-line buffer


Seemingly there are functions that do exactly that:

beginning-of-buffer-or-history
   Move to the beginning of the buffer, or if already there, move to the first
   event in the history list.

end-of-buffer-or-history
   Move to the end of the buffer, or if already there, move to the last
   event in the history list.

But in reality, what above functions really do is this:

If cursor is a beginning/end of a buffer
  then jump to the beginning/end of the history
ElseIf cursor is somewhere in a SINGLE-LINE buffer
  then jump to the beginning/end of the history (why ???)
Else
  jump to the beginning/end of the MULTI-LINE buffer


I wonder if this is really how these functions are intended to work ?
At the very least I would consider them misnamed, or does "buffer" really only ever refer to multi-line buffers ?

to clarify:

I find it odd that {beginning,end}-of-buffer-or-history jumps to the beginning/end of the history and not to the beginning/end of the line
if called on a single-line buffer

Jumping to the beginning/end of a line in a multi-line buffer is just an extra my function does, and not something I think {beginning,end}-of-buffer-or-history
should do (it's name does not imply any such functionality :)

cheers,
Bernhard



Messages sorted by: Reverse Date, Date, Thread, Author