]> git.wh0rd.org Git - nano.git/commitdiff
Removing a superfluous switch statement.
authorBenno Schulenberg <bensberg@justemail.net>
Wed, 11 Jun 2014 18:34:35 +0000 (18:34 +0000)
committerBenno Schulenberg <bensberg@justemail.net>
Wed, 11 Jun 2014 18:34:35 +0000 (18:34 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4958 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/nano.c

index 7cc43237d57f3176a4d8bb3175ebc604348bcb42..4f7698b2afdfd452afd67effeaee1c4571da8f7c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,7 @@
        next cut.  These two changes together fix Savannah bug #42326.
        * src/nano.c (do_input): Always accept mouse events, also when
        just looking for Unjustify.  This fixes Savannah bug #42322.
+       * src/nano.c (do_input): Remove a superfluous switch statement.
 
 2014-06-10  Benno Schulenberg  <bensberg@justemail.net>
        * src/browser.c, src/files.c, src/nano.c src/prompt.c, src/winio.c:
index 704c61e1007a7d1fa13966b10ba5de470162d933..4e9ce8b5ae2d9c76ab5a7633c439471ab3798107 100644 (file)
@@ -1667,54 +1667,48 @@ int do_input(bool *meta_key, bool *func_key, bool allow_funcs)
        }
 
        if (have_shortcut) {
-           switch (input) {
-               /* Handle the normal edit-window shortcuts. */
-               default:
-                   /* If the function associated with this shortcut is
-                    * cutting or copying text, indicate this. */
-                   if (s->scfunc == do_cut_text_void
+           /* If the function associated with this shortcut is
+            * cutting or copying text, remember this. */
+           if (s->scfunc == do_cut_text_void
 #ifndef NANO_TINY
-                       || s->scfunc == do_copy_text || s->scfunc ==
-                       do_cut_till_end
+               || s->scfunc == do_copy_text || s->scfunc == do_cut_till_end
 #endif
-                       )
-                       cut_copy = TRUE;
+               )
+               cut_copy = TRUE;
 
-                   if (s->scfunc != 0) {
-                       const subnfunc *f = sctofunc((sc *) s);
-                       if (ISSET(VIEW_MODE) && f && !f->viewok)
-                           print_view_warning();
-                       else {
+           if (s->scfunc != 0) {
+               const subnfunc *f = sctofunc((sc *) s);
+               if (ISSET(VIEW_MODE) && f && !f->viewok)
+                   print_view_warning();
+               else {
 #ifndef NANO_TINY
-                           if (s->scfunc == do_toggle_void)
-                               do_toggle(s->toggle);
-                           else
+                   if (s->scfunc == do_toggle_void)
+                       do_toggle(s->toggle);
+                   else
 #endif
-                           {
-                               s->scfunc();
+                   {
+                       /* Execute the function of the shortcut. */
+                       s->scfunc();
 #ifndef DISABLE_COLOR
-                               if (f && !f->viewok && openfile->syntax != NULL
-                                       && openfile->syntax->nmultis > 0) {
-                                   reset_multis(openfile->current, FALSE);
-                               }
+                       if (f && !f->viewok && openfile->syntax != NULL
+                               && openfile->syntax->nmultis > 0)
+                           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;
-                               }
-                           }
+                           edit_refresh();
+                           edit_refresh_needed = FALSE;
                        }
                    }
-                   break;
+               }
            }
        }
     }
 
     /* If we aren't cutting or copying text, blow away the text in the
-     * cutbuffer. */
+     * cutbuffer upon the next cutting action. */
     if (!cut_copy)
        cutbuffer_reset();