commit cb8d845ad76c6a0c4997c8f4c81de29117bf534d
parent 538dc352c5a8972688b825017ba3c50e7de4a8de
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Fri, 15 Jul 2005 01:08:52 +0000
still more miscellaneous color fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2869 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
3 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -40,13 +40,17 @@ CVS code -
color_to_short()), and parse_colors(). (DLR)
- Change color handling to save only the regex strings
constantly, and to actually compile them on an as-needed
- basis. Changes to update_color() (renamed color_update()) and
+ basis. Changes to update_color() and
thanks_for_all_the_fish(). (Brand Huntsman and DLR)
- Various other color fixes. Handle unspecified foreground
- colors properly, and don't bother doing complete refreshes of
- the screen when color support is enabled if there's no regex
- associated with the current file. Changes to do_colorinit()
- (renamed color_init()), do_input(), and do_output(). (DLR)
+ colors properly, don't automatically reinitialize the
+ displayed colors every time we update the current buffer's
+ colors (since the buffer may not be displayed immediately),
+ and don't bother doing complete refreshes of the screen when
+ color support is enabled if there's no regex associated with
+ the current file. Changes to do_colorinit() (renamed
+ color_init()), update_color() (renamed color_update()),
+ write_file(), do_input(), and do_output(). (DLR)
- files.c:
open_file()
- Assert that filename isn't NULL, and don't do anything special
diff --git a/src/color.c b/src/color.c
@@ -161,8 +161,6 @@ void color_update(void)
REG_EXTENDED | (tmpcolor->icase ? REG_ICASE : 0));
}
}
-
- color_init();
}
#endif /* ENABLE_COLOR */
diff --git a/src/files.c b/src/files.c
@@ -1574,9 +1574,11 @@ int write_file(const char *name, FILE *f_open, bool tmp, int append,
openfile->filename = mallocstrcpy(openfile->filename,
realname);
#ifdef ENABLE_COLOR
- /* We might have changed the filename, so update the
- * buffer's associated colors, if applicable. */
+ /* We might have changed the filename, so update the colors
+ * to account for it, and make sure we're using the updated
+ * colors, if applicable. */
color_update();
+ color_init();
/* If color syntaxes are available and turned on, we need to
* call edit_refresh(). */