[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
bin/45451: less(1) rings the terminal bell when searching
>Synopsis: less(1) rings the terminal bell when searching
>Arrival-Date: Mon Oct 10 17:10:00 +0000 2011
>Originator: M. Levinson
>Release: NetBSD 5.99.55 from 2011-09-22
$NetBSD: jump.c,v 1.2 2011/07/03 19:51:26 tron Exp $
Forward-searching for a string that appears in the first displayed
line causes less to ring the terminal bell.
The patch below fixes the problem by preventing less from trying
to scroll back zero lines when nline equals zero in the jump_loc()
function (which probably couldn't happen in previous versions of
less, but can occur in the recently-imported version 444 because
searches now include the first line displayed on the screen).
I've also submitted this patch to the upstream maintainer.
% echo hello >testfile
% env LESS= less testfile
then search for the string hello with the command "/hello"
@@ -197,7 +197,7 @@ jump_loc(pos, sline)
nline -= sline;
if (nline > 0)
forw(nline, position(BOTTOM_PLUS_ONE), 1, 0, 0);
+ else if (nline < 0)
back(-nline, position(TOP), 1, 0);
Main Index |
Thread Index |