Commit 760a2dc9 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

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
parent c53a92d9
Showing with 15 additions and 5 deletions
+15 -5
CVS code - 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: - nano.c:
main() main()
- Move the call to raw() on systems that don't define - Move the call to raw() on systems that don't define
......
...@@ -62,7 +62,8 @@ void load_file(int update) ...@@ -62,7 +62,8 @@ void load_file(int update)
#ifdef ENABLE_COLOR #ifdef ENABLE_COLOR
update_color(); update_color();
edit_refresh(); if (ISSET(COLOR_SYNTAX))
edit_refresh();
#endif #endif
} }
...@@ -100,7 +101,8 @@ void new_file(void) ...@@ -100,7 +101,8 @@ void new_file(void)
#ifdef ENABLE_COLOR #ifdef ENABLE_COLOR
update_color(); update_color();
edit_refresh(); if (ISSET(COLOR_SYNTAX))
edit_refresh();
#endif #endif
} }
...@@ -1647,7 +1649,8 @@ int write_file(const char *name, int tmp, int append, int nonamechange) ...@@ -1647,7 +1649,8 @@ int write_file(const char *name, int tmp, int append, int nonamechange)
filename = mallocstrcpy(filename, realname); filename = mallocstrcpy(filename, realname);
#ifdef ENABLE_COLOR #ifdef ENABLE_COLOR
update_color(); update_color();
edit_refresh(); if (ISSET(COLOR_SYNTAX))
edit_refresh();
#endif #endif
} }
......
...@@ -988,7 +988,8 @@ void do_char(char ch) ...@@ -988,7 +988,8 @@ void do_char(char ch)
#endif #endif
#ifdef ENABLE_COLOR #ifdef ENABLE_COLOR
refresh = 1; if (ISSET(COLOR_SYNTAX))
refresh = 1;
#endif #endif
#if !defined(DISABLE_WRAPPING) || defined(ENABLE_COLOR) #if !defined(DISABLE_WRAPPING) || defined(ENABLE_COLOR)
...@@ -1067,7 +1068,8 @@ int do_delete(void) ...@@ -1067,7 +1068,8 @@ int do_delete(void)
align(&current->data); align(&current->data);
#ifdef ENABLE_COLOR #ifdef ENABLE_COLOR
refresh = 1; if (ISSET(COLOR_SYNTAX))
refresh = 1;
#endif #endif
} else if (current->next != NULL && (current->next != filebot || blbf)) { } else if (current->next != NULL && (current->next != filebot || blbf)) {
/* We can delete the line before filebot only if it is blank: it /* We can delete the line before filebot only if it is blank: it
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment