Skip to content

Commit a573592

Browse files
committed
(edit_draw_this_line): use different variable for char attributes.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
1 parent 218a54f commit a573592

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

src/editor/editdraw.c

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -628,40 +628,42 @@ edit_draw_this_line (WEdit *edit, off_t b, long row, long start_col, long end_co
628628
if ((edit_options.visible_tabs || (edit_options.visible_tws && q >= tws))
629629
&& enable_show_tabs_tws && tty_use_colors ())
630630
{
631+
int style;
632+
631633
if ((p->style & MOD_MARKED) != 0)
632-
c = p->style;
634+
style = p->style;
633635
else if (book_mark != 0)
634-
c |= book_mark << 16;
636+
style = c | (book_mark << 16);
635637
else
636-
c = p->style | MOD_WHITESPACE;
638+
style = p->style | MOD_WHITESPACE;
637639
if (i > 2)
638640
{
639641
p->ch = '<';
640-
p->style = c;
642+
p->style = style;
641643
p++;
642644
while (--i > 1)
643645
{
644646
p->ch = '-';
645-
p->style = c;
647+
p->style = style;
646648
p++;
647649
}
648650
p->ch = '>';
649-
p->style = c;
651+
p->style = style;
650652
p++;
651653
}
652654
else if (i > 1)
653655
{
654656
p->ch = '<';
655-
p->style = c;
657+
p->style = style;
656658
p++;
657659
p->ch = '>';
658-
p->style = c;
660+
p->style = style;
659661
p++;
660662
}
661663
else
662664
{
663665
p->ch = '>';
664-
p->style = c;
666+
p->style = style;
665667
p++;
666668
}
667669
}
@@ -670,24 +672,28 @@ edit_draw_this_line (WEdit *edit, off_t b, long row, long start_col, long end_co
670672
{
671673
p->ch = '.';
672674
p->style |= MOD_WHITESPACE;
673-
c = p->style & ~MOD_CURSOR;
675+
676+
const int style = p->style & ~MOD_CURSOR;
677+
674678
p++;
675679
while (--i != 0)
676680
{
677681
p->ch = ' ';
678-
p->style = c;
682+
p->style = style;
679683
p++;
680684
}
681685
}
682686
else
683687
{
684688
p->ch |= ' ';
685-
c = p->style & ~MOD_CURSOR;
689+
690+
const int style = p->style & ~MOD_CURSOR;
691+
686692
p++;
687693
while (--i != 0)
688694
{
689695
p->ch = ' ';
690-
p->style = c;
696+
p->style = style;
691697
p++;
692698
}
693699
}

0 commit comments

Comments
 (0)