Okay that will not work. Revert forcing reset_multis on !viewok as it's too expensive

for things like deleting text.  Will have to go back and force inside functions.
Add check in reset_multis for CNONE type since that's slowing us down and is dumb
to leave out.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4379 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Chris Allegretta 2009-02-16 23:06:09 +00:00
parent 9555e1d118
commit b71cf301da
6 changed files with 25 additions and 13 deletions

View File

@ -1,8 +1,7 @@
2009-02-16 Chris Allegretta <chrisa@asty.org> 2009-02-16 Chris Allegretta <chrisa@asty.org>
* Add new argument to reset_multis for force redraws without attempting to * 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. guess whether we need to, for functions that we don't have good info about
New utility function color.c:reset_multis_for_id(). Fixes e.g. incorrect the text state. New utility function color.c:reset_multis_for_id().
highlighting when cutting text.
2009-02-15 Chris Allegretta <chrisa@asty.org> 2009-02-15 Chris Allegretta <chrisa@asty.org>
* configure.ac, doc/man/Makefile.am - Add check for HTML output support in GNU * configure.ac, doc/man/Makefile.am - Add check for HTML output support in GNU

View File

@ -344,7 +344,10 @@ void reset_multis(filestruct *fileptr, bool force)
if (fileptr->multidata[tmpcolor->id] == CWHOLELINE) { if (fileptr->multidata[tmpcolor->id] == CWHOLELINE) {
if (nobegin && noend) if (nobegin && noend)
continue; continue;
} else if (fileptr->multidata[tmpcolor->id] & CBEGINBEFORE && !noend } else if (fileptr->multidata[tmpcolor->id] == CNONE) {
if (nobegin && noend)
continue;
} else if (fileptr->multidata[tmpcolor->id] & CBEGINBEFORE && !noend
&& (nobegin || endmatch.rm_eo > startmatch.rm_eo)) { && (nobegin || endmatch.rm_eo > startmatch.rm_eo)) {
reset_multis_after(fileptr, tmpcolor->id); reset_multis_after(fileptr, tmpcolor->id);
continue; continue;

View File

@ -214,6 +214,10 @@ void do_cut_text(
/* Update the screen. */ /* Update the screen. */
edit_refresh_needed = TRUE; edit_refresh_needed = TRUE;
#ifdef ENABLE_COLOR
reset_multis(openfile->current, FALSE);
#endif
#ifdef DEBUG #ifdef DEBUG
dump_filestruct(cutbuffer); dump_filestruct(cutbuffer);
#endif #endif
@ -277,6 +281,10 @@ void do_uncut_text(void)
/* Update the screen. */ /* Update the screen. */
edit_refresh_needed = TRUE; edit_refresh_needed = TRUE;
#ifdef ENABLE_COLOR
reset_multis(openfile->current, FALSE);
#endif
#ifdef DEBUG #ifdef DEBUG
dump_filestruct_reverse(); dump_filestruct_reverse();
#endif #endif

View File

@ -1715,9 +1715,11 @@ void thanks_for_all_the_fish(void)
if (jusbuffer != NULL) if (jusbuffer != NULL)
free_filestruct(jusbuffer); free_filestruct(jusbuffer);
#endif #endif
#ifdef DEBUG
/* Free the memory associated with each open file buffer. */ /* Free the memory associated with each open file buffer. */
if (openfile != NULL) if (openfile != NULL)
free_openfilestruct(openfile); free_openfilestruct(openfile);
#endif
#ifdef ENABLE_COLOR #ifdef ENABLE_COLOR
if (syntaxstr != NULL) if (syntaxstr != NULL)
free(syntaxstr); free(syntaxstr);

View File

@ -1590,24 +1590,31 @@ int do_input(bool *meta_key, bool *func_key, bool *s_or_t, bool
*ran_func = TRUE; *ran_func = TRUE;
if (ISSET(VIEW_MODE) && f && !f->viewok) if (ISSET(VIEW_MODE) && f && !f->viewok)
print_view_warning(); print_view_warning();
else else {
#ifndef NANO_TINY #ifndef NANO_TINY
if (s->scfunc == DO_TOGGLE) if (s->scfunc == DO_TOGGLE)
do_toggle(s->toggle); do_toggle(s->toggle);
else { else {
#else
{
#endif #endif
iso_me_harder_funcmap(s->scfunc); iso_me_harder_funcmap(s->scfunc);
#ifdef ENABLE_COLOR #ifdef ENABLE_COLOR
if (!f->viewok && openfile->syntax != NULL if (!f->viewok && openfile->syntax != NULL
&& openfile->syntax->nmultis > 0) { && openfile->syntax->nmultis > 0) {
reset_multis(openfile->current, TRUE); reset_multis(openfile->current, FALSE);
} }
if (edit_refresh_needed) { if (edit_refresh_needed) {
#ifdef DEBUG
fprintf(stderr, "running edit_refresh() as edit_refresh_needed is true\n");
#endif
edit_refresh(); edit_refresh();
edit_refresh_needed = FALSE; edit_refresh_needed = FALSE;
} }
#endif #endif
} }
}
#ifndef NANO_TINY #ifndef NANO_TINY
} }
#endif #endif

View File

@ -140,13 +140,6 @@ void do_delete(void)
set_modified(); set_modified();
#ifdef ENABLE_COLOR
/* If color syntaxes are available and turned on, we need to call
* edit_refresh(). */
if (openfile->colorstrings != NULL && !ISSET(NO_COLOR_SYNTAX))
do_refresh = TRUE;
#endif
if (do_refresh) if (do_refresh)
edit_refresh_needed = TRUE; edit_refresh_needed = TRUE;
else else