]> granicus.if.org Git - vim/commitdiff
patch 8.1.0784: messy indent in if statement v8.1.0784
authorBram Moolenaar <Bram@vim.org>
Sat, 19 Jan 2019 20:12:24 +0000 (21:12 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 19 Jan 2019 20:12:24 +0000 (21:12 +0100)
Problem:    Messy indent in if statement.
Solution:   Improve structure of if statement. (Ozaki Kiichi, closes #3826)

src/os_win32.c
src/version.c

index 3ea1fe321e52349e0f5de0a2d269175b5e98dab4..b5a6ccebaed77dd979a091b850f11875466cd030 100644 (file)
@@ -1576,34 +1576,35 @@ WaitForChar(long msec, int ignore_input)
                dwWaitTime = p_mzq; /* don't wait longer than 'mzquantum' */
 #endif
 #ifdef FEAT_TIMERS
+           // When waiting very briefly don't trigger timers.
+           if (dwWaitTime > 10)
            {
                long    due_time;
 
-               /* When waiting very briefly don't trigger timers. */
-               if (dwWaitTime > 10)
+               // Trigger timers and then get the time in msec until the next
+               // one is due.  Wait up to that time.
+               due_time = check_due_timer();
+               if (typebuf.tb_change_cnt != tb_change_cnt)
                {
-                   /* Trigger timers and then get the time in msec until the
-                    * next one is due.  Wait up to that time. */
-                   due_time = check_due_timer();
-                   if (typebuf.tb_change_cnt != tb_change_cnt)
-                   {
-                       /* timer may have used feedkeys() */
-                       return FALSE;
-                   }
-                   if (due_time > 0 && dwWaitTime > (DWORD)due_time)
-                       dwWaitTime = due_time;
+                   // timer may have used feedkeys().
+                   return FALSE;
                }
+               if (due_time > 0 && dwWaitTime > (DWORD)due_time)
+                   dwWaitTime = due_time;
            }
 #endif
+           if (
 #ifdef FEAT_CLIENTSERVER
-           /* Wait for either an event on the console input or a message in
-            * the client-server window. */
-           if (msg_wait_for_multiple_objects(1, &g_hConIn, FALSE,
-                                dwWaitTime, QS_SENDMESSAGE) != WAIT_OBJECT_0)
+                   // Wait for either an event on the console input or a
+                   // message in the client-server window.
+                   msg_wait_for_multiple_objects(1, &g_hConIn, FALSE,
+                                 dwWaitTime, QS_SENDMESSAGE) != WAIT_OBJECT_0
 #else
-           if (wait_for_single_object(g_hConIn, dwWaitTime) != WAIT_OBJECT_0)
+                   wait_for_single_object(g_hConIn, dwWaitTime)
+                                                             != WAIT_OBJECT_0
 #endif
-                   continue;
+                   )
+               continue;
        }
 
        cRecords = 0;
index 11e4bb682f8eb7bc5edc04a701de5219e620ae42..90f4296247359ac324d4f6eb476687eb53e0c39a 100644 (file)
@@ -791,6 +791,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    784,
 /**/
     783,
 /**/