[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nano-devel] [PATCH 3/3] display: highlight the ">"/"<" continuation cha
From: |
Benno Schulenberg |
Subject: |
[Nano-devel] [PATCH 3/3] display: highlight the ">"/"<" continuation characters in reverse video |
Date: |
Tue, 12 Feb 2019 16:31:03 +0100 |
To make it obvious that they are not actual characters in the file.
This fulfills https://savannah.gnu.org/bugs/?55571.
With-help-from: David Lawrence Ramsey <address@hidden>
---
src/winio.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/winio.c b/src/winio.c
index 890ba87f..4299064e 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -2776,10 +2776,16 @@ int update_line(filestruct *fileptr, size_t index)
edit_draw(fileptr, converted, row, from_col);
free(converted);
- if (from_col > 0)
+ if (from_col > 0) {
+ wattron(edit, hilite_attribute);
mvwaddch(edit, row, margin, '<');
- if (strlenpt(fileptr->data) > from_col + editwincols)
+ wattroff(edit, hilite_attribute);
+ }
+ if (strlenpt(fileptr->data) > from_col + editwincols) {
+ wattron(edit, hilite_attribute);
mvwaddch(edit, row, COLS - 1, '>');
+ wattroff(edit, hilite_attribute);
+ }
if (spotlighted && !inhelp)
spotlight(light_from_col, light_to_col);
@@ -3451,11 +3457,14 @@ void spotlight(size_t from_col, size_t to_col)
waddnstr(edit, word, actual_x(word, room));
- if (word_span > room)
- waddch(edit, '>');
-
wattroff(edit, interface_color_pair[SELECTED_TEXT]);
+ if (word_span > room) {
+ wattron(edit, hilite_attribute);
+ waddch(edit, '>');
+ wattroff(edit, hilite_attribute);
+ }
+
free(word);
wnoutrefresh(edit);
--
2.20.1