From 34dccb1fe4ee21599528c2fda63d6ac89a7eb306 Mon Sep 17 00:00:00 2001 From: faissaloo Date: Sun, 28 Aug 2016 16:38:56 +0100 Subject: [PATCH 14/20] Bugfix for line numbers being incorrect when wrapped --- src/winio.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/winio.c b/src/winio.c index 9adc7d6..9460cee 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2231,23 +2231,19 @@ void edit_draw(filestruct *fileptr, const char *converted, int refresh_needed = TRUE; margin = intlen(openfile->filebot->lineno) + 3; } - - wattron(edit, A_BOLD); - mvwprintw(edit, line, - margin - (intlen(((long)openfile->edittop->lineno) + line) + 2), - "%i│", ((long)openfile->edittop->lineno) + line); - wattroff(edit, A_BOLD); + + mvwprintw(edit,line, + margin - (intlen(fileptr->lineno) + 2), + "%i│", fileptr->lineno); } else if (ISSET(HEX_LINE_NUM)) { if (margin != hexlen(openfile->filebot->lineno) + 3) { refresh_needed = TRUE; margin = hexlen(openfile->filebot->lineno) + 3; } - wattron(edit, A_BOLD); mvwprintw(edit, line, - margin - (hexlen(((long)openfile->edittop->lineno) + line) + 2), - "%X│", ((long)openfile->edittop->lineno) + line); - wattroff(edit, A_BOLD); + margin - (hexlen(fileptr->lineno) + 2), + "%X│", fileptr->lineno); } #endif #if !defined(NANO_TINY) || !defined(DISABLE_COLOR) @@ -2623,7 +2619,7 @@ void edit_draw(filestruct *fileptr, const char *converted, int paintlen = actual_x(converted + index + margin, paintlen); wattron(edit, hilite_attribute); - mvwaddnstr(edit, line, x_start + margin, converted + index, paintlen); + mvwaddnstr(edit, line, x_start+margin, converted + index, paintlen); wattroff(edit, hilite_attribute); } } -- 2.7.4