From 1ab632d9dcbd93b5713ced2a238322dcf92145e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Diego=20Aur=C3=A9lio=20Mesquita?= Date: Sun, 5 Apr 2020 17:57:30 -0300 Subject: [PATCH] bookmarks: Show bookmarked lines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make a bookmarked line stand out by not highlighting its line number. Signed-off-by: Marco Diego Aurélio Mesquita --- src/search.c | 1 + src/winio.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/search.c b/src/search.c index 0ed61b52..fee51d3f 100644 --- a/src/search.c +++ b/src/search.c @@ -991,6 +991,7 @@ void bookmark(void) statusbar(openfile->current->bookmarked ? _("Bookmarked this line") : _("Removed bookmark")); + refresh_needed = TRUE; } /* Jump to the next or previous bookmark, if any. */ diff --git a/src/winio.c b/src/winio.c index 0285207a..d713ce09 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2387,14 +2387,16 @@ void draw_row(int row, const char *converted, linestruct *line, size_t from_col) /* If line numbering is switched on, put a line number in front of * the text -- but only for the parts that are not softwrapped. */ if (margin > 0) { - wattron(edit, interface_color_pair[LINE_NUMBER]); + if(!line->bookmarked) + wattron(edit, interface_color_pair[LINE_NUMBER]); #ifndef NANO_TINY if (ISSET(SOFTWRAP) && from_col != 0) mvwprintw(edit, row, 0, "%*s", margin - 1, " "); else #endif mvwprintw(edit, row, 0, "%*zd", margin - 1, line->lineno); - wattroff(edit, interface_color_pair[LINE_NUMBER]); + if(!line->bookmarked) + wattroff(edit, interface_color_pair[LINE_NUMBER]); wprintw(edit, " "); } #endif -- 2.17.1