]> git.wh0rd.org Git - nano.git/commitdiff
if color support is enabled, we only need to call edit_refresh() to
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Wed, 14 Jan 2004 06:38:00 +0000 (06:38 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Wed, 14 Jan 2004 06:38:00 +0000 (06:38 +0000)
properly paint multi-line color regexes when COLOR_SYNTAX is set

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1621 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/files.c
src/nano.c

index e406deba19b4df09fdec8f997e25c3e3116c7694..b5b7828c1abdcde0777a7542ff2870dcb94c3679 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
 CVS code -
+- General:
+       - Change instances in the code that refresh the entire edit
+         window when color support is enabled (in order to properly
+         handle multi-line color regexes) to only do so when
+         it's necessary, i.e, when COLOR_SYNTAX is set. (DLR)
 - nano.c:
   main()
        - Move the call to raw() on systems that don't define
index 6a410ffeba7afb32ab5baa3b25f503e45ae76a65..12e028dfebc01d2e3db97eb3831d8952b09fe62e 100644 (file)
@@ -62,7 +62,8 @@ void load_file(int update)
 
 #ifdef ENABLE_COLOR
     update_color();
-    edit_refresh();
+    if (ISSET(COLOR_SYNTAX))
+       edit_refresh();
 #endif
 }
 
@@ -100,7 +101,8 @@ void new_file(void)
 
 #ifdef ENABLE_COLOR
     update_color();
-    edit_refresh();
+    if (ISSET(COLOR_SYNTAX))
+       edit_refresh();
 #endif
 }
 
@@ -1647,7 +1649,8 @@ int write_file(const char *name, int tmp, int append, int nonamechange)
            filename = mallocstrcpy(filename, realname);
 #ifdef ENABLE_COLOR
            update_color();
-           edit_refresh();
+           if (ISSET(COLOR_SYNTAX))
+               edit_refresh();
 #endif
        }
 
index 98f9a7f3936e29b3ccf19aebb47ab7467b247743..a766d68d2bddd48f4a7f22dde3e17eddcaa5b3ce 100644 (file)
@@ -988,7 +988,8 @@ void do_char(char ch)
 #endif
 
 #ifdef ENABLE_COLOR
-    refresh = 1;
+    if (ISSET(COLOR_SYNTAX))
+       refresh = 1;
 #endif
 
 #if !defined(DISABLE_WRAPPING) || defined(ENABLE_COLOR)
@@ -1067,7 +1068,8 @@ int do_delete(void)
 
        align(&current->data);
 #ifdef ENABLE_COLOR
-       refresh = 1;
+       if (ISSET(COLOR_SYNTAX))
+           refresh = 1;
 #endif
     } else if (current->next != NULL && (current->next != filebot || blbf)) {
        /* We can delete the line before filebot only if it is blank: it