]> git.wh0rd.org Git - nano.git/commitdiff
- winio.c:edit_add() - Little fixes to let color highlights not bleed onto the next...
authorChris Allegretta <chrisa@asty.org>
Sat, 5 Jan 2002 03:30:10 +0000 (03:30 +0000)
committerChris Allegretta <chrisa@asty.org>
Sat, 5 Jan 2002 03:30:10 +0000 (03:30 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@974 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
winio.c

index a5c0a5e50ddd7eea63abf5805144b2df2d5e4d5f..a94017d5d43fba7ebf9be4d3d173cace39bb533f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -41,6 +41,8 @@ CVS code -
        - gettextized a pair of strings.
   bottombars()
        - Get rid of that annoying reversed line when color is on! :)
+  edit_add()
+       - Little fixes to let color highlights not bleed onto the next line.
 - m4/gettext.m4:
        - Back down to 1.1.3 version.
 - faq.html:
diff --git a/winio.c b/winio.c
index 7c56f06d3873959fef7d751fed2a40589cf0781f..d1371adaad86651e08769d1a0fd19976e0dd80cf 100644 (file)
--- a/winio.c
+++ b/winio.c
@@ -804,12 +804,10 @@ void edit_add(filestruct * fileptr, int yval, int start, int virt_cur_x,
                            wattron(edit, A_BOLD);
                        wattron(edit, COLOR_PAIR(tmpcolor->pairnum));
 
-                       if (regmatches[0].rm_eo - regmatches[0].rm_so 
-                           + k <= COLS)
+                       if (regmatches[0].rm_eo + k <= COLS)
                            paintlen = regmatches[0].rm_eo - regmatches[0].rm_so;
                        else
-                           paintlen = COLS - (regmatches[0].rm_eo 
-                                       -  regmatches[0].rm_so);
+                           paintlen = COLS - k - regmatches[0].rm_so - 1;
 
                        mvwaddnstr(edit, yval, regmatches[0].rm_so + k,
                            &fileptr->data[k + regmatches[0].rm_so],