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

Re: up-line-or-search question



"Bart Schaefer" wrote:
> Search the zsh-users archive for the string: up-line-or-beginning

Are these the currently agreed definitions?  If so, they can be added to
Functions/Zle and the zshcontrib manual page.


function up-line-or-beginning-search {
    if [[ $LASTWIDGET != $WIDGET ]]
    then
        if [[ $LBUFFER == *$'\n'* ]]
        then
            __last_up_line=up-line-or-history
        else
            __last_up_line=history-beginning-search-backward
        fi
    fi
    zle .${__last_up_line:-beep}
}

function down-line-or-beginning-search {
    if [[ $LASTWIDGET != $WIDGET ]]
    then
        if [[ $LBUFFER == *$'\n'* ]]
        then
            __last_down_line=down-line-or-history
        else
            __last_down_line=history-beginning-search-forward
        fi
    fi
    zle .${__last_down_line:-beep}
}

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 392070


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************



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