]> granicus.if.org Git - vim/commitdiff
patch 8.2.4649: various formatting problems v8.2.4649
authorBram Moolenaar <Bram@vim.org>
Wed, 30 Mar 2022 09:57:45 +0000 (10:57 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 30 Mar 2022 09:57:45 +0000 (10:57 +0100)
Problem:    Various formatting problems.
Solution:   Improve the code formatting.

src/gui_athena.c
src/gui_motif.c
src/mark.c
src/os_unix.c
src/quickfix.c
src/regexp_nfa.c
src/register.c
src/testdir/test_filechanged.vim
src/version.c

index 6cbabf81d2e65a5ce75310822e78800afdbca679..8b5af63d1a6ed3c21c9abadc29cadd0f23893732 100644 (file)
@@ -1191,7 +1191,7 @@ gui_mch_add_menu_item(vimmenu_T *menu, int idx UNUSED)
 #endif
 
        menu->parent = parent;
-       menu->submenu_id = NULL;
+       menu->submenu_id = (Widget)0;
        if (!XtIsManaged(toolBar)
                    && vim_strchr(p_go, GO_TOOLBAR) != NULL)
            gui_mch_show_toolbar(TRUE);
index 56d3f35723fcd30a74721c32b1a02724e74451e2..97b0bf98e6d39a695119bd1bd3b215b1fc4bb3bf 100644 (file)
@@ -944,13 +944,21 @@ gui_mch_add_menu(vimmenu_T *menu, int idx)
                           && tearoff_val == (int)XmTEAR_OFF_ENABLED ? 1 : 0),
 #endif
            NULL);
-    gui_motif_menu_colors(menu->id);
-    gui_motif_menu_fontlist(menu->id);
     XmStringFree(label);
 
     if (menu->id == (Widget)0)         // failed
        return;
 
+    // The "Help" menu is a special case, and should be placed at the far
+    // right hand side of the menu-bar.  It's recognized by its high priority.
+    if (parent == NULL && menu->priority >= 9999)
+       XtVaSetValues(menuBar,
+               XmNmenuHelpWidget, menu->id,
+               NULL);
+
+    gui_motif_menu_colors(menu->id);
+    gui_motif_menu_fontlist(menu->id);
+
     // add accelerator text
     gui_motif_add_actext(menu);
 
@@ -978,19 +986,8 @@ gui_mch_add_menu(vimmenu_T *menu, int idx)
        XmNsubMenuId, menu->submenu_id,
        NULL);
 
-    /*
-     * The "Help" menu is a special case, and should be placed at the far
-     * right hand side of the menu-bar.  It's recognized by its high priority.
-     */
-    if (parent == NULL && menu->priority >= 9999)
-       XtVaSetValues(menuBar,
-               XmNmenuHelpWidget, menu->id,
-               NULL);
-
-    /*
-     * When we add a top-level item to the menu bar, we can figure out how
-     * high the menu bar should be.
-     */
+    // When we add a top-level item to the menu bar, we can figure out how
+    // high the menu bar should be.
     if (parent == NULL)
        gui_mch_compute_menu_height(menu->id);
 }
index 11f20a61a959998b57b16a18b284c4c7610882c5..fbb4b9a4525c7177f9f9f249292f369240325829 100644 (file)
@@ -1002,21 +1002,21 @@ mark_adjust(
 
     void
 mark_adjust_nofold(
-    linenr_T line1,
-    linenr_T line2,
-    long amount,
-    long amount_after)
+    linenr_T   line1,
+    linenr_T   line2,
+    long       amount,
+    long       amount_after)
 {
     mark_adjust_internal(line1, line2, amount, amount_after, FALSE);
 }
 
     static void
 mark_adjust_internal(
-    linenr_T line1,
-    linenr_T line2,
-    long amount,
-    long amount_after,
-    int adjust_folds UNUSED)
+    linenr_T   line1,
+    linenr_T   line2,
+    long       amount,
+    long       amount_after,
+    int                adjust_folds UNUSED)
 {
     int                i;
     int                fnum = curbuf->b_fnum;
index 5b516e0e8e22bf1c9b92ba24359fa9a88dc329c9..826c9c0db7f5004d0da08afc5f6ced6508289d00 100644 (file)
@@ -3762,7 +3762,7 @@ get_tty_info(int fd, ttyinfo_T *info)
 static int     mouse_ison = FALSE;
 
 /*
- * Set mouse clicks on or off.
+ * Set mouse clicks on or off and possible enable mouse movement events.
  */
     void
 mch_setmouse(int on)
index 0b6a5a3a6ee92d44750c9a073bcc0ed91bd93010..c2162e9f25d145c86f0067f905370c6c31f2d93a 100644 (file)
@@ -3194,6 +3194,7 @@ qf_jump_edit_buffer(
     if (qfl_type == QFLT_LOCATION)
     {
        win_T   *wp = win_id2wp(prev_winid);
+
        if (wp == NULL && curwin->w_llist != qi)
        {
            emsg(_(e_current_window_was_closed));
index 4d95f83f1b47702caf074f92e77625799fc73034..503895eede5d0c99999527f36aff8f8133a6a3cd 100644 (file)
@@ -6764,8 +6764,10 @@ nfa_regmatch(
            case NFA_MARK_GT:
            case NFA_MARK_LT:
              {
-               size_t  col = rex.input - rex.line;
-               pos_T   *pos = getmark_buf(rex.reg_buf, t->state->val, FALSE);
+               pos_T   *pos;
+               size_t  col = REG_MULTI ? rex.input - rex.line : 0;
+
+               pos = getmark_buf(rex.reg_buf, t->state->val, FALSE);
 
                // Line may have been freed, get it again.
                if (REG_MULTI)
index 89d4232c817826630a5c8e994b4f59f7a03062a6..79e602130670239e586bd104bdaef827c10eff02 100644 (file)
@@ -2399,8 +2399,8 @@ ex_display(exarg_T *eap)
                        msg_puts_attr("^J", attr);
                        n -= 2;
                    }
-                   for (p = yb->y_array[j]; *p && (n -= ptr2cells(p)) >= 0;
-                                                                          ++p)
+                   for (p = yb->y_array[j];
+                                   *p != NUL && (n -= ptr2cells(p)) >= 0; ++p)
                    {
                        clen = (*mb_ptr2len)(p);
                        msg_outtrans_len(p, clen);
index ee9e80b26c1a880b978e8f7f8339672770dcf0ab..5dca43fd4ed9a403463dcdac013413c590325848 100644 (file)
@@ -139,8 +139,7 @@ endfunc
 
 func Test_FileChangedShell_edit_dialog()
   CheckNotGui
-  " FIXME: why does this not work on MS-Windows?
-  CheckUnix
+  CheckUnix  " Using low level feedkeys() does not work on MS-Windows.
 
   new Xchanged_r
   call setline(1, 'reload this')
index 15cbdf86b127a6219d25124387aa572a900bdfac..8b188ced447139faa16661d5cb29eca77b257811 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4649,
 /**/
     4648,
 /**/