instead of doing it always.
* src/color.c (reset_multis): Abort when having no multiline regexes.
* src/nano.c (do_input): A functionless shortcut should be impossible.
+ * src/nano.c (do_input): Adjust indentation.
2016-01-02 Benno Schulenberg <bensberg@justemail.net>
* src/text.c (do_spell, do_formatter): Plug three tiny memory leaks.
kbinput = (int *)nrealloc(kbinput, kbinput_len *
sizeof(int));
kbinput[kbinput_len - 1] = input;
-
}
}
}
if (have_shortcut) {
+ const subnfunc *f = sctofunc((sc *)s);
/* If the function associated with this shortcut is
* cutting or copying text, remember this. */
if (s->scfunc == do_cut_text_void
statusbar("Internal error: shortcut without function!");
return ERR;
}
- {
- const subnfunc *f = sctofunc((sc *) s);
- if (ISSET(VIEW_MODE) && f && !f->viewok)
- print_view_warning();
- else {
+ if (ISSET(VIEW_MODE) && f && !f->viewok)
+ print_view_warning();
+ else {
#ifndef NANO_TINY
- if (s->scfunc == do_toggle_void) {
- do_toggle(s->toggle);
- if (s->toggle != CUT_TO_END)
- preserve = TRUE;
- } else
-#endif
- {
- /* Execute the function of the shortcut. */
- s->scfunc();
+ if (s->scfunc == do_toggle_void) {
+ do_toggle(s->toggle);
+ if (s->toggle != CUT_TO_END)
+ preserve = TRUE;
+ } else
+#endif
+ {
+ /* Execute the function of the shortcut. */
+ s->scfunc();
#ifndef DISABLE_COLOR
- if (f && !f->viewok)
- reset_multis(openfile->current, FALSE);
+ if (f && !f->viewok)
+ reset_multis(openfile->current, FALSE);
#endif
- if (edit_refresh_needed) {
+ if (edit_refresh_needed) {
#ifdef DEBUG
- fprintf(stderr, "running edit_refresh() as edit_refresh_needed is true\n");
+ fprintf(stderr, "running edit_refresh() as edit_refresh_needed is true\n");
#endif
- edit_refresh();
- edit_refresh_needed = FALSE;
- } else if (s->scfunc == do_delete || s->scfunc == do_backspace)
- update_line(openfile->current, openfile->current_x);
- }
+ edit_refresh();
+ edit_refresh_needed = FALSE;
+ } else if (s->scfunc == do_delete || s->scfunc == do_backspace)
+ update_line(openfile->current, openfile->current_x);
}
}
}