summaryrefslogtreecommitdiffstats
path: root/src/editor/editdraw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/editor/editdraw.c')
-rw-r--r--src/editor/editdraw.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/editor/editdraw.c b/src/editor/editdraw.c
index fbd1e09..49be571 100644
--- a/src/editor/editdraw.c
+++ b/src/editor/editdraw.c
@@ -1,7 +1,7 @@
/*
Editor text drawing.
- Copyright (C) 1996-2023
+ Copyright (C) 1996-2024
Free Software Foundation, Inc.
Written by:
@@ -448,7 +448,6 @@ print_to_widget (WEdit * edit, long row, int start_col, int start_col_real,
{
int style;
unsigned int textchar;
- int color;
if (cols_to_skip != 0)
{
@@ -458,8 +457,6 @@ print_to_widget (WEdit * edit, long row, int start_col, int start_col_real,
style = p->style & 0xFF00;
textchar = p->ch;
- /* If non-printable - use black background */
- color = (style & MOD_ABNORMAL) != 0 ? 0 : p->style >> 16;
if ((style & MOD_WHITESPACE) != 0)
{
@@ -475,8 +472,10 @@ print_to_widget (WEdit * edit, long row, int start_col, int start_col_real,
tty_setcolor (EDITOR_BOLD_COLOR);
else if ((style & MOD_MARKED) != 0)
tty_setcolor (EDITOR_MARKED_COLOR);
+ else if ((style & MOD_ABNORMAL) != 0)
+ tty_setcolor (EDITOR_NONPRINTABLE_COLOR);
else
- tty_lowlevel_setcolor (color);
+ tty_lowlevel_setcolor (p->style >> 16);
if (edit_options.show_right_margin)
{
@@ -951,9 +950,8 @@ render_edit_text (WEdit * edit, long start_row, long start_column, long end_row,
if ((force & REDRAW_LINE_ABOVE) != 0 && curs_row >= 1)
{
row = curs_row - 1;
- b = edit_buffer_get_backward_offset (&edit->buffer,
- edit_buffer_get_current_bol (&edit->buffer),
- 1);
+ b = edit_buffer_get_current_bol (&edit->buffer);
+ b = edit_buffer_get_backward_offset (&edit->buffer, b, 1);
if (row >= start_row && row <= end_row)
{
if (key_pending (edit))