commit 760a2dc9b25fea90f333f6819a9bf76c6f3baf9c
parent c53a92d9739bc7e79a9d168b46fe74c0defe9e2f
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Wed, 14 Jan 2004 06:38:00 +0000
if color support is enabled, we only need to call edit_refresh() to
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
Diffstat:
3 files changed, 15 insertions(+), 5 deletions(-)
diff --git 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
diff --git a/src/files.c b/src/files.c
@@ -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
}
diff --git a/src/nano.c b/src/nano.c
@@ -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(¤t->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