]> granicus.if.org Git - vim/commitdiff
patch 8.1.1000: indenting is off v8.1.1000
authorBram Moolenaar <Bram@vim.org>
Sat, 9 Mar 2019 10:23:58 +0000 (11:23 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 9 Mar 2019 10:23:58 +0000 (11:23 +0100)
Problem:    Indenting is off.
Solution:   Make indenting consistent and update comments. (Ozaki Kiichi,
            closes #4079)

src/getchar.c
src/ops.c
src/version.c

index 7039c9c76bd7ac8b39b7f5b9860c5193277494d6..4e5c8b68cf57775ab864fca7f7520e8d482272e0 100644 (file)
@@ -1577,108 +1577,109 @@ vgetc(void)
     }
     else
     {
-      mod_mask = 0x0;
-      last_recorded_len = 0;
-      for (;;)                 /* this is done twice if there are modifiers */
-      {
-       int did_inc = FALSE;
-
-       if (mod_mask
-#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
-           || im_is_preediting()
-#endif
-               )
+       mod_mask = 0x0;
+       last_recorded_len = 0;
+       for (;;)                // this is done twice if there are modifiers
        {
-           /* no mapping after modifier has been read */
-           ++no_mapping;
-           ++allow_keys;
-           did_inc = TRUE;     /* mod_mask may change value */
-       }
-       c = vgetorpeek(TRUE);
-       if (did_inc)
-       {
-           --no_mapping;
-           --allow_keys;
-       }
+           int did_inc = FALSE;
 
-       /* Get two extra bytes for special keys */
-       if (c == K_SPECIAL
-#ifdef FEAT_GUI
-               || c == CSI
+           if (mod_mask
+#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
+                   || im_is_preediting()
 #endif
-          )
-       {
-           int     save_allow_keys = allow_keys;
-
-           ++no_mapping;
-           allow_keys = 0;             /* make sure BS is not found */
-           c2 = vgetorpeek(TRUE);      /* no mapping for these chars */
+                   )
+           {
+               // no mapping after modifier has been read
+               ++no_mapping;
+               ++allow_keys;
+               did_inc = TRUE; // mod_mask may change value
+           }
            c = vgetorpeek(TRUE);
-           --no_mapping;
-           allow_keys = save_allow_keys;
-           if (c2 == KS_MODIFIER)
+           if (did_inc)
            {
-               mod_mask = c;
-               continue;
+               --no_mapping;
+               --allow_keys;
            }
-           c = TO_SPECIAL(c2, c);
 
-#if defined(FEAT_GUI_MSWIN) && defined(FEAT_MENU) && defined(FEAT_TEAROFF)
-           /* Handle K_TEAROFF here, the caller of vgetc() doesn't need to
-            * know that a menu was torn off */
-           if (c == K_TEAROFF)
+           // Get two extra bytes for special keys
+           if (c == K_SPECIAL
+#ifdef FEAT_GUI
+                   || c == CSI
+#endif
+              )
            {
-               char_u  name[200];
-               int     i;
+               int         save_allow_keys = allow_keys;
+
+               ++no_mapping;
+               allow_keys = 0;         // make sure BS is not found
+               c2 = vgetorpeek(TRUE);  // no mapping for these chars
+               c = vgetorpeek(TRUE);
+               --no_mapping;
+               allow_keys = save_allow_keys;
+               if (c2 == KS_MODIFIER)
+               {
+                   mod_mask = c;
+                   continue;
+               }
+               c = TO_SPECIAL(c2, c);
 
-               /* get menu path, it ends with a <CR> */
-               for (i = 0; (c = vgetorpeek(TRUE)) != '\r'; )
+#if defined(FEAT_GUI_MSWIN) && defined(FEAT_MENU) && defined(FEAT_TEAROFF)
+               // Handle K_TEAROFF here, the caller of vgetc() doesn't need to
+               // know that a menu was torn off
+               if (c == K_TEAROFF)
                {
-                   name[i] = c;
-                   if (i < 199)
-                       ++i;
+                   char_u      name[200];
+                   int         i;
+
+                   // get menu path, it ends with a <CR>
+                   for (i = 0; (c = vgetorpeek(TRUE)) != '\r'; )
+                   {
+                       name[i] = c;
+                       if (i < 199)
+                           ++i;
+                   }
+                   name[i] = NUL;
+                   gui_make_tearoff(name);
+                   continue;
                }
-               name[i] = NUL;
-               gui_make_tearoff(name);
-               continue;
-           }
 #endif
 #if defined(FEAT_GUI) && defined(FEAT_GUI_GTK) && defined(FEAT_MENU)
-           /* GTK: <F10> normally selects the menu, but it's passed until
-            * here to allow mapping it.  Intercept and invoke the GTK
-            * behavior if it's not mapped. */
-           if (c == K_F10 && gui.menubar != NULL)
-           {
-               gtk_menu_shell_select_first(GTK_MENU_SHELL(gui.menubar), FALSE);
-               continue;
-           }
+               // GTK: <F10> normally selects the menu, but it's passed until
+               // here to allow mapping it.  Intercept and invoke the GTK
+               // behavior if it's not mapped.
+               if (c == K_F10 && gui.menubar != NULL)
+               {
+                   gtk_menu_shell_select_first(
+                                          GTK_MENU_SHELL(gui.menubar), FALSE);
+                   continue;
+               }
 #endif
 #ifdef FEAT_GUI
-           /* Handle focus event here, so that the caller doesn't need to
-            * know about it.  Return K_IGNORE so that we loop once (needed if
-            * 'lazyredraw' is set). */
-           if (c == K_FOCUSGAINED || c == K_FOCUSLOST)
-           {
-               ui_focus_change(c == K_FOCUSGAINED);
-               c = K_IGNORE;
-           }
+               // Handle focus event here, so that the caller doesn't need to
+               // know about it.  Return K_IGNORE so that we loop once (needed
+               // if 'lazyredraw' is set).
+               if (c == K_FOCUSGAINED || c == K_FOCUSLOST)
+               {
+                   ui_focus_change(c == K_FOCUSGAINED);
+                   c = K_IGNORE;
+               }
 
-           /* Translate K_CSI to CSI.  The special key is only used to avoid
-            * it being recognized as the start of a special key. */
-           if (c == K_CSI)
-               c = CSI;
+               // Translate K_CSI to CSI.  The special key is only used to
+               // avoid it being recognized as the start of a special key.
+               if (c == K_CSI)
+                   c = CSI;
 #endif
-       }
-       /* a keypad or special function key was not mapped, use it like
-        * its ASCII equivalent */
-       switch (c)
-       {
-           case K_KPLUS:       c = '+'; break;
-           case K_KMINUS:      c = '-'; break;
-           case K_KDIVIDE:     c = '/'; break;
-           case K_KMULTIPLY:   c = '*'; break;
-           case K_KENTER:      c = CAR; break;
-           case K_KPOINT:
+           }
+           // a keypad or special function key was not mapped, use it like
+           // its ASCII equivalent
+           switch (c)
+           {
+               case K_KPLUS:   c = '+'; break;
+               case K_KMINUS:  c = '-'; break;
+               case K_KDIVIDE: c = '/'; break;
+               case K_KMULTIPLY: c = '*'; break;
+               case K_KENTER:  c = CAR; break;
+               case K_KPOINT:
 #ifdef MSWIN
                                // Can be either '.' or a ',',
                                // depending on the type of keypad.
@@ -1686,19 +1687,19 @@ vgetc(void)
 #else
                                c = '.'; break;
 #endif
-           case K_K0:          c = '0'; break;
-           case K_K1:          c = '1'; break;
-           case K_K2:          c = '2'; break;
-           case K_K3:          c = '3'; break;
-           case K_K4:          c = '4'; break;
-           case K_K5:          c = '5'; break;
-           case K_K6:          c = '6'; break;
-           case K_K7:          c = '7'; break;
-           case K_K8:          c = '8'; break;
-           case K_K9:          c = '9'; break;
-
-           case K_XHOME:
-           case K_ZHOME:       if (mod_mask == MOD_MASK_SHIFT)
+               case K_K0:      c = '0'; break;
+               case K_K1:      c = '1'; break;
+               case K_K2:      c = '2'; break;
+               case K_K3:      c = '3'; break;
+               case K_K4:      c = '4'; break;
+               case K_K5:      c = '5'; break;
+               case K_K6:      c = '6'; break;
+               case K_K7:      c = '7'; break;
+               case K_K8:      c = '8'; break;
+               case K_K9:      c = '9'; break;
+
+               case K_XHOME:
+               case K_ZHOME:   if (mod_mask == MOD_MASK_SHIFT)
                                {
                                    c = K_S_HOME;
                                    mod_mask = 0;
@@ -1711,8 +1712,8 @@ vgetc(void)
                                else
                                    c = K_HOME;
                                break;
-           case K_XEND:
-           case K_ZEND:        if (mod_mask == MOD_MASK_SHIFT)
+               case K_XEND:
+               case K_ZEND:    if (mod_mask == MOD_MASK_SHIFT)
                                {
                                    c = K_S_END;
                                    mod_mask = 0;
@@ -1726,45 +1727,45 @@ vgetc(void)
                                    c = K_END;
                                break;
 
-           case K_XUP:         c = K_UP; break;
-           case K_XDOWN:       c = K_DOWN; break;
-           case K_XLEFT:       c = K_LEFT; break;
-           case K_XRIGHT:      c = K_RIGHT; break;
-       }
+               case K_XUP:     c = K_UP; break;
+               case K_XDOWN:   c = K_DOWN; break;
+               case K_XLEFT:   c = K_LEFT; break;
+               case K_XRIGHT:  c = K_RIGHT; break;
+           }
 
-       /* For a multi-byte character get all the bytes and return the
-        * converted character.
-        * Note: This will loop until enough bytes are received!
-        */
-       if (has_mbyte && (n = MB_BYTE2LEN_CHECK(c)) > 1)
-       {
-           ++no_mapping;
-           buf[0] = c;
-           for (i = 1; i < n; ++i)
+           // For a multi-byte character get all the bytes and return the
+           // converted character.
+           // Note: This will loop until enough bytes are received!
+           if (has_mbyte && (n = MB_BYTE2LEN_CHECK(c)) > 1)
            {
-               buf[i] = vgetorpeek(TRUE);
-               if (buf[i] == K_SPECIAL
+               ++no_mapping;
+               buf[0] = c;
+               for (i = 1; i < n; ++i)
+               {
+                   buf[i] = vgetorpeek(TRUE);
+                   if (buf[i] == K_SPECIAL
 #ifdef FEAT_GUI
-                       || buf[i] == CSI
+                           || buf[i] == CSI
 #endif
-                       )
-               {
-                   /* Must be a K_SPECIAL - KS_SPECIAL - KE_FILLER sequence,
-                    * which represents a K_SPECIAL (0x80),
-                    * or a CSI - KS_EXTRA - KE_CSI sequence, which represents
-                    * a CSI (0x9B),
-                    * of a K_SPECIAL - KS_EXTRA - KE_CSI, which is CSI too. */
-                   c = vgetorpeek(TRUE);
-                   if (vgetorpeek(TRUE) == (int)KE_CSI && c == KS_EXTRA)
-                       buf[i] = CSI;
+                           )
+                   {
+                       // Must be a K_SPECIAL - KS_SPECIAL - KE_FILLER
+                       // sequence, which represents a K_SPECIAL (0x80),
+                       // or a CSI - KS_EXTRA - KE_CSI sequence, which
+                       // represents a CSI (0x9B),
+                       // or a K_SPECIAL - KS_EXTRA - KE_CSI, which is CSI
+                       // too.
+                       c = vgetorpeek(TRUE);
+                       if (vgetorpeek(TRUE) == (int)KE_CSI && c == KS_EXTRA)
+                           buf[i] = CSI;
+                   }
                }
+               --no_mapping;
+               c = (*mb_ptr2char)(buf);
            }
-           --no_mapping;
-           c = (*mb_ptr2char)(buf);
-       }
 
-       break;
-      }
+           break;
+       }
     }
 
 #ifdef FEAT_EVAL
index 3353cf9e266bcaa81ff26ea779976a1e6ed08270..1b39c3fb20c473cd6b627b0c7480aefaee9183cb 100644 (file)
--- a/src/ops.c
+++ b/src/ops.c
@@ -1245,10 +1245,15 @@ do_execreg(
            emsg(_(e_nolastcmd));
            return FAIL;
        }
-       VIM_CLEAR(new_last_cmdline); /* don't keep the cmdline containing @: */
-       /* Escape all control characters with a CTRL-V */
+       // don't keep the cmdline containing @:
+       VIM_CLEAR(new_last_cmdline);
+       // Escape all control characters with a CTRL-V
        p = vim_strsave_escaped_ext(last_cmdline,
-               (char_u *)"\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037", Ctrl_V, FALSE);
+                   (char_u *)"\001\002\003\004\005\006\007"
+                         "\010\011\012\013\014\015\016\017"
+                         "\020\021\022\023\024\025\026\027"
+                         "\030\031\032\033\034\035\036\037",
+                   Ctrl_V, FALSE);
        if (p != NULL)
        {
            /* When in Visual mode "'<,'>" will be prepended to the command.
index e427ffecbe2d6510f6951e8f6371737e5bbe065e..e4e6b3ce8f5b153f159ce09a4f154566f23aeb45 100644 (file)
@@ -779,6 +779,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1000,
 /**/
     999,
 /**/