]> git.wh0rd.org Git - nano.git/commitdiff
add comments
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Wed, 12 Jan 2005 16:20:18 +0000 (16:20 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Wed, 12 Jan 2005 16:20:18 +0000 (16:20 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2251 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

src/winio.c

index f670e33f3ed9b45dd04db1c843eee96d6e20bc9e..9a3cea82da38e2c5e8421d3bdc9628eace6b239b 100644 (file)
@@ -3076,9 +3076,18 @@ void edit_add(const filestruct *fileptr, const char *converted, int
                    goto step_two;
 
                /* Now paint the start of fileptr. */
-               paintlen = (end_line != fileptr) ? -1 :
-                       actual_x(converted, strnlenpt(fileptr->data,
-                       endmatch.rm_eo) - start);
+               if (end_line != fileptr)
+                   /* If the start of fileptr is on a different line
+                    * from the end, paintlen is -1, meaning that
+                    * everything on the line gets painted. */
+                   paintlen = -1;
+               else
+                   /* Otherwise, paintlen is the expanded location of
+                    * the end of the match minus the expanded location
+                    * of the beginning of the page. */
+                   paintlen = actual_x(converted,
+                       strnlenpt(fileptr->data, endmatch.rm_eo) -
+                       start);
 
                mvwaddnstr(edit, yval, 0, converted, paintlen);