From 0b3e2f763e69441c4ee6b6d5d65e0f120829a354 Mon Sep 17 00:00:00 2001 From: Alexandr Shadchin Date: Fri, 25 Apr 2014 13:38:22 +0000 Subject: Merge Less 458 plus local patches ok guenther@, ok jmc@ for man bits --- usr.bin/less/line.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'usr.bin/less/line.c') diff --git a/usr.bin/less/line.c b/usr.bin/less/line.c index b2ea16ef516..0517e23d85b 100644 --- a/usr.bin/less/line.c +++ b/usr.bin/less/line.c @@ -1,11 +1,10 @@ /* - * Copyright (C) 1984-2011 Mark Nudelman + * Copyright (C) 1984-2012 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. * - * For more information about less, or for information on how to - * contact the author, see the README file. + * For more information, see the README file. */ @@ -29,6 +28,7 @@ public int hshift; /* Desired left-shift of output line buffer */ public int tabstops[TABSTOP_MAX] = { 0 }; /* Custom tabstops */ public int ntabstops = 1; /* Number of tabstops */ public int tabdefault = 8; /* Default repeated tabstops */ +public POSITION highest_hilite; /* Pos of last hilite in file found so far */ static int curr; /* Index into linebuf */ static int column; /* Printable length, accounting for @@ -589,7 +589,12 @@ store_char(ch, a, rep, pos) * Override the attribute passed in. */ if (a != AT_ANSI) + { + if (highest_hilite != NULL_POSITION && + pos > highest_hilite) + highest_hilite = pos; a |= AT_HILITE; + } } } #endif @@ -638,7 +643,7 @@ store_char(ch, a, rep, pos) replen = utf_len(rep[0]); #else replen = 1; -#endif +#endif /* !SMALL */ } if (curr + replen >= size_linebuf-6) { -- cgit v1.2.3