diff options
author | Alexandr Shadchin <shadchin@cvs.openbsd.org> | 2014-04-25 13:38:22 +0000 |
---|---|---|
committer | Alexandr Shadchin <shadchin@cvs.openbsd.org> | 2014-04-25 13:38:22 +0000 |
commit | 0b3e2f763e69441c4ee6b6d5d65e0f120829a354 (patch) | |
tree | 2510e4e8715a7eec43d542a72012dd5053de852e /usr.bin/less/line.c | |
parent | ae43ffa8613fad7c10b8fc0e854327378d434317 (diff) |
Merge Less 458 plus local patches
ok guenther@, ok jmc@ for man bits
Diffstat (limited to 'usr.bin/less/line.c')
-rw-r--r-- | usr.bin/less/line.c | 13 |
1 files changed, 9 insertions, 4 deletions
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) { |