* Add new argument to reset_multis for force redraws without attempting to
guess whether we need to, force updates when running a non-viewok function.
New utility function color.c:reset_multis_for_id(). Fixes e.g. incorrect
highlighting when cutting text.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4378
35c25a1d-7b9e-4130-9fde-
d3aeb78583b8
+2009-02-16 Chris Allegretta <chrisa@asty.org>
+ * Add new argument to reset_multis for force redraws without attempting to
+ guess whether we need to, force updates when running a non-viewok function.
+ New utility function color.c:reset_multis_for_id(). Fixes e.g. incorrect
+ highlighting when cutting text.
+
2009-02-15 Chris Allegretta <chrisa@asty.org>
* configure.ac, doc/man/Makefile.am - Add check for HTML output support in GNU
groff. Fixes Savannah bug #24461: build traps on groff. Also, add installation
edit_refresh_needed = TRUE;
}
+/* Reset one multiline regex info */
+void reset_multis_for_id(filestruct *fileptr, int num)
+{
+ reset_multis_before(fileptr, num);
+ reset_multis_after(fileptr, num);
+ fileptr->multidata[num] = -1;
+}
-/* Reset multi line strings around a filestruct ptr, trying to be smart about stopping */
-void reset_multis(filestruct *fileptr)
+/* Reset multi line strings around a filestruct ptr, trying to be smart about stopping
+ force = reset everything regardless, useful when we don't know how much screen state
+ has changed */
+void reset_multis(filestruct *fileptr, bool force)
{
int nobegin, noend;
regmatch_t startmatch, endmatch;
continue;
alloc_multidata_if_needed(fileptr);
+ if (force == TRUE) {
+ reset_multis_for_id(fileptr, tmpcolor->id);
+ continue;
+ }
+
/* Figure out where the first begin and end are to determine if
things changed drastically for the precalculated multi values */
nobegin = regexec(tmpcolor->start, fileptr->data, 1, &startmatch, 0);
}
/* If we got here assume the worst */
- reset_multis_before(fileptr, tmpcolor->id);
- reset_multis_after(fileptr, tmpcolor->id);
- fileptr->multidata[tmpcolor->id] = -1;
+ reset_multis_for_id(fileptr, tmpcolor->id);
}
}
#endif /* ENABLE_COLOR */
* modified. */
set_modified();
-
/* Update the screen. */
- edit_refresh();
+ edit_refresh_needed = TRUE;
#ifdef DEBUG
dump_filestruct(cutbuffer);
set_modified();
/* Update the screen. */
- edit_refresh();
+ edit_refresh_needed = TRUE;
#ifdef DEBUG
dump_filestruct_reverse();
#endif
iso_me_harder_funcmap(s->scfunc);
#ifdef ENABLE_COLOR
- if (!f->viewok && openfile->syntax != NULL
- && openfile->current->multidata && openfile->syntax->nmultis > 0) {
- reset_multis(openfile->current);
+ if (!f->viewok && openfile->syntax != NULL
+ && openfile->syntax->nmultis > 0) {
+ reset_multis(openfile->current, TRUE);
}
if (edit_refresh_needed) {
edit_refresh();
#ifdef ENABLE_COLOR
- reset_multis(openfile->current);
+ reset_multis(openfile->current, FALSE);
#endif
if (do_refresh) {
edit_refresh();
void parse_include(char *ptr);
short color_to_short(const char *colorname, bool *bright);
void parse_colors(char *ptr, bool icase);
-void reset_multis(filestruct *fileptr);
+void reset_multis(filestruct *fileptr, bool force);
void alloc_multidata_if_needed(filestruct *fileptr);
#endif
void parse_rcfile(FILE *rcstream