From 618b486fd5c441455d6712937992747e34d2b87f Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Sat, 22 Sep 2018 19:08:57 +0900 Subject: [PATCH] pager history buffer: remove dead code looking for next new line --- kitty/history.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/kitty/history.c b/kitty/history.c index 740aefe33..bc5ae5b7f 100644 --- a/kitty/history.c +++ b/kitty/history.c @@ -172,16 +172,8 @@ pagerhist_push(HistoryBuf *self) { } ph->end += line_as_ansi(&l, ph->buffer + ph->end, 1023); ph->buffer[ph->end++] = '\r'; - if (ph->bufend) { -#if NEXTLINE - /* something like wcsrchr would be more accurate, but is *slow* */ - Py_UCS4 *newstart = (Py_UCS4 *)strchr((char *)ph->buffer + ph->end, '\n'); - if (!newstart || newstart - ph->buffer > ph->bufend) ph->start = 0; - else ph->start = newstart - ph->buffer; -#else + if (ph->bufend) ph->start = ph->end + 1 < ph->bufend ? ph->end + 1 : 0; -#endif - } } static inline index_type