]> granicus.if.org Git - vim/commitdiff
patch 8.2.4928: various white space and cosmetic mistakes v8.2.4928
authorBram Moolenaar <Bram@vim.org>
Mon, 9 May 2022 19:09:23 +0000 (20:09 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 9 May 2022 19:09:23 +0000 (20:09 +0100)
Problem:    Various white space and cosmetic mistakes.
Solution:   Change spaces to tabs, improve comments.

49 files changed:
src/bufwrite.c
src/channel.c
src/cindent.c
src/crypt.c
src/debugger.c
src/digraph.c
src/edit.c
src/evalwindow.c
src/ex_cmds.c
src/ex_docmd.c
src/ex_getln.c
src/fileio.c
src/filepath.c
src/gui.c
src/highlight.c
src/if_lua.c
src/indent.c
src/insexpand.c
src/job.c
src/keymap.h
src/macros.h
src/menu.c
src/misc1.c
src/misc2.c
src/mouse.c
src/move.c
src/normal.c
src/ops.c
src/option.c
src/option.h
src/os_unix.c
src/search.c
src/session.c
src/spellsuggest.c
src/structs.h
src/tag.c
src/term.c
src/terminal.c
src/testdir/test_cursorline.vim
src/textformat.c
src/typval.c
src/ui.c
src/userfunc.c
src/version.c
src/vim.h
src/vim9.h
src/vim9compile.c
src/vim9execute.c
src/window.c

index 7cf572424e39a555b20e6f890772feee04e028b4..8db426626507101621880e7aece6b96264f4a029 100644 (file)
@@ -30,7 +30,7 @@ struct bw_info
     int                bw_flags;       // FIO_ flags
 #ifdef FEAT_CRYPT
     buf_T      *bw_buffer;     // buffer being written
-    int         bw_finish;      // finish encrypting
+    int                bw_finish;      // finish encrypting
 #endif
     char_u     bw_rest[CONV_RESTLEN]; // not converted bytes
     int                bw_restlen;     // nr of bytes in bw_rest[]
@@ -39,7 +39,7 @@ struct bw_info
     size_t     bw_conv_buflen; // size of bw_conv_buf
     int                bw_conv_error;  // set for conversion error
     linenr_T   bw_conv_error_lnum;  // first line with error or zero
-    linenr_T   bw_start_lnum;  // line number at start of buffer
+    linenr_T   bw_start_lnum;  // line number at start of buffer
 #ifdef USE_ICONV
     iconv_t    bw_iconv_fd;    // descriptor for iconv() or -1
 #endif
index 52dfaafb3eae7686948b904c720d4d2479f49bf7..e3b32eebf809793770d42ba7cce94aa80adbd8eb 100644 (file)
@@ -1996,7 +1996,7 @@ channel_get_all(channel_T *channel, ch_part_T part, int *outlen)
                    && p[3] == ';')
            {
                // '\a' becomes a NL
-               while (p < res + (len - 1) && *p != '\a')
+               while (p < res + (len - 1) && *p != '\a')
                    ++p;
                // BEL is zero width characters, suppress display mistake
                // ConPTY (after 10.0.18317) requires advance checking
index dc9c20320faead30d2fb068f4395baa0b772599f..ec88036eb174eab13da9f4892202d590d22e668d 100644 (file)
@@ -2181,8 +2181,8 @@ get_c_indent(void)
                          check_linecomment(ml_get(curwin->w_cursor.lnum - 1));
            if (linecomment_pos.col != MAXCOL)
            {
-               trypos = &linecomment_pos;
-               trypos->lnum = curwin->w_cursor.lnum - 1;
+               trypos = &linecomment_pos;
+               trypos->lnum = curwin->w_cursor.lnum - 1;
            }
        }
        if (trypos  != NULL)
index 6a852fa1f9b5ed57010f01864868383da9a574be..bed76a96d465a9fd0a2a91537c1707f273a62758 100644 (file)
@@ -452,8 +452,8 @@ crypt_create(
     if (cryptmethods[method_nr].init_fn(
        state, key, salt, salt_len, seed, seed_len) == FAIL)
     {
-        vim_free(state);
-        return NULL;
+       vim_free(state);
+       return NULL;
     }
     return state;
 }
@@ -692,7 +692,7 @@ crypt_encode_inplace(
     cryptstate_T *state,
     char_u     *buf,
     size_t     len,
-    int         last)
+    int                last)
 {
     cryptmethods[state->method_nr].encode_inplace_fn(state, buf, len,
                                                                    buf, last);
index 87cd398bc8603406a04e4bb20a588e8a6f323c83..38d1fb602221d2ca133054a870c2fe3333652c2a 100644 (file)
@@ -22,7 +22,7 @@ static void do_showbacktrace(char_u *cmd);
 
 static char_u *debug_oldval = NULL;    // old and newval for debug expressions
 static char_u *debug_newval = NULL;
-static int     debug_expr   = 0;        // use debug_expr
+static int     debug_expr   = 0;       // use debug_expr
 
     int
 has_watchexpr(void)
index cfffc192d43c466b0e2cd42a44ed72b1129b07df..c33fc302517ec29414037dc3ead794dee502006a 100644 (file)
@@ -2337,8 +2337,9 @@ f_digraph_getlist(typval_T *argvars, typval_T *rettv)
        flag_list_all = FALSE;
     else
     {
-       int         error = FALSE;
+       int         error = FALSE;
        varnumber_T flag = tv_get_number_chk(&argvars[0], &error);
+
        if (error)
            return;
        flag_list_all = flag ? TRUE : FALSE;
index 9457d25c11a5056271c37d9fab1ae0a551c875f8..3da3db67b7c573e3a4cecdc716263124b59e332f 100644 (file)
@@ -3839,8 +3839,7 @@ ins_insert(int replaceState)
 #ifdef FEAT_EVAL
     set_vim_var_string(VV_INSERTMODE,
                   (char_u *)((State & REPLACE_FLAG) ? "i"
-                         : replaceState == MODE_VREPLACE ? "v"
-                                                    : "r"), 1);
+                           : replaceState == MODE_VREPLACE ? "v" : "r"), 1);
 #endif
     ins_apply_autocmds(EVENT_INSERTCHANGE);
     if (State & REPLACE_FLAG)
@@ -4895,10 +4894,10 @@ ins_tab(void)
                // These five lines mean 'tabstop' != 'shiftwidth'
                && ((tabstop_count(curbuf->b_p_vts_array) > 1)
                    || (tabstop_count(curbuf->b_p_vts_array) == 1
-                       && tabstop_first(curbuf->b_p_vts_array)
+                       && tabstop_first(curbuf->b_p_vts_array)
                                                       != get_sw_value(curbuf))
-                   || (tabstop_count(curbuf->b_p_vts_array) == 0
-                       && curbuf->b_p_ts != get_sw_value(curbuf))))
+                   || (tabstop_count(curbuf->b_p_vts_array) == 0
+                       && curbuf->b_p_ts != get_sw_value(curbuf))))
            && tabstop_count(curbuf->b_p_vsts_array) == 0
 #else
            && !(p_sta && ind && curbuf->b_p_ts != get_sw_value(curbuf))
@@ -4924,7 +4923,7 @@ ins_tab(void)
        temp -= get_nolist_virtcol() % temp;
     }
     else if (tabstop_count(curbuf->b_p_vsts_array) > 0 || curbuf->b_p_sts != 0)
-                               // use 'softtabstop' when set
+                               // use 'softtabstop' when set
        temp = tabstop_padding(get_nolist_virtcol(), get_sts_value(),
                                                     curbuf->b_p_vsts_array);
     else                       // otherwise use 'tabstop'
@@ -4963,7 +4962,7 @@ ins_tab(void)
      */
 #ifdef FEAT_VARTABS
     if (!curbuf->b_p_et && (tabstop_count(curbuf->b_p_vsts_array) > 0
-                            || get_sts_value() > 0
+                           || get_sts_value() > 0
                            || (p_sta && ind)))
 #else
     if (!curbuf->b_p_et && (get_sts_value() || (p_sta && ind)))
index fd62579cd1e1fc5ee64f014c8467d99094c0c132..20ac66f53350941c7fa9ab46f75bcf7b4a868b19 100644 (file)
@@ -155,6 +155,8 @@ win_findbuf(typval_T *argvars, list_T *list)
 
 /*
  * Find window specified by "vp" in tabpage "tp".
+ * Returns current window if "vp" is number zero.
+ * Returns NULL if not found.
  */
     win_T *
 find_win_by_nr(
@@ -997,28 +999,28 @@ f_win_splitmove(typval_T *argvars, typval_T *rettv)
            || !win_valid(wp) || !win_valid(targetwin)
            || win_valid_popup(wp) || win_valid_popup(targetwin))
     {
-        emsg(_(e_invalid_window_number));
+       emsg(_(e_invalid_window_number));
        rettv->vval.v_number = -1;
        return;
     }
 
     if (argvars[2].v_type != VAR_UNKNOWN)
     {
-        dict_T      *d;
-        dictitem_T  *di;
-
-        if (argvars[2].v_type != VAR_DICT || argvars[2].vval.v_dict == NULL)
-        {
-            emsg(_(e_invalid_argument));
-            return;
-        }
-
-        d = argvars[2].vval.v_dict;
-        if (dict_get_bool(d, (char_u *)"vertical", FALSE))
-            flags |= WSP_VERT;
-        if ((di = dict_find(d, (char_u *)"rightbelow", -1)) != NULL)
-            flags |= tv_get_bool(&di->di_tv) ? WSP_BELOW : WSP_ABOVE;
-        size = (int)dict_get_number(d, (char_u *)"size");
+       dict_T      *d;
+       dictitem_T  *di;
+
+       if (argvars[2].v_type != VAR_DICT || argvars[2].vval.v_dict == NULL)
+       {
+           emsg(_(e_invalid_argument));
+           return;
+       }
+
+       d = argvars[2].vval.v_dict;
+       if (dict_get_bool(d, (char_u *)"vertical", FALSE))
+           flags |= WSP_VERT;
+       if ((di = dict_find(d, (char_u *)"rightbelow", -1)) != NULL)
+           flags |= tv_get_bool(&di->di_tv) ? WSP_BELOW : WSP_ABOVE;
+       size = (int)dict_get_number(d, (char_u *)"size");
     }
 
     win_move_into_split(wp, targetwin, size, flags);
index 880bf5a3e4fefdcd7dbfeccc3e859ce965134726..7e730becb48feef68071008ff29672e742a3cb91 100644 (file)
@@ -2511,7 +2511,7 @@ do_ecmd(
 #endif
     int                readfile_flags = 0;
     int                did_inc_redrawing_disabled = FALSE;
-    long        *so_ptr = curwin->w_p_so >= 0 ? &curwin->w_p_so : &p_so;
+    long       *so_ptr = curwin->w_p_so >= 0 ? &curwin->w_p_so : &p_so;
 
 #ifdef FEAT_PROP_POPUP
     if (ERROR_IF_TERM_POPUP_WINDOW)
index 7633d6bf83e60edfdee0c8c33cb1fa044345e953..a865f65d198335954438d3bd0fab9aa5087112d3 100644 (file)
@@ -2369,7 +2369,7 @@ do_one_cmd(
        {
            ea.line1 = ea.line2;
            if (ea.line2 >= LONG_MAX - (n - 1))
-               ea.line2 = LONG_MAX;  // avoid overflow
+               ea.line2 = LONG_MAX;  // avoid overflow
            else
                ea.line2 += n - 1;
            ++ea.addr_count;
index 14489dec42012faa01038887af0532fdd78625ba..cbddfea00375f7f418e582f32503b26f33d4e92c 100644 (file)
@@ -110,7 +110,7 @@ empty_pattern_magic(char_u *p, size_t len, magic_T magic_val)
 {
     // remove trailing \v and the like
     while (len >= 2 && p[len - 2] == '\\'
-                        && vim_strchr((char_u *)"mMvVcCZ", p[len - 1]) != NULL)
+                       && vim_strchr((char_u *)"mMvVcCZ", p[len - 1]) != NULL)
        len -= 2;
 
     // true, if the pattern is empty, or the pattern ends with \| and magic is
index 8318452dfc799abe7623c60a08c7c3804cdf16bb..e99eb9bb8632a9336238e5a8b29ccc4be18f94e8 100644 (file)
@@ -216,7 +216,7 @@ readfile(
     int                using_b_ffname;
     int                using_b_fname;
     static char *msg_is_a_directory = N_("is a directory");
-    int         eof;
+    int                eof;
 
     au_did_filetype = FALSE; // reset before triggering any autocommands
 
@@ -4784,7 +4784,7 @@ readdir_core(
     int                withattr UNUSED,
     void       *context,
     int                (*checkitem)(void *context, void *item),
-    int         sort)
+    int                sort)
 {
     int                        failed = FALSE;
     char_u             *p;
index 09c9f4a198acb8379e9847fef5f8b2e56cfde83d..56a99e40d75ceba611c6e318dfdec4c241e02fdd 100644 (file)
@@ -1648,7 +1648,7 @@ f_readdir(typval_T *argvars, typval_T *rettv)
     char_u     *p;
     garray_T   ga;
     int                i;
-    int         sort = READDIR_SORT_BYTE;
+    int                sort = READDIR_SORT_BYTE;
 
     if (rettv_list_alloc(rettv) == FAIL)
        return;
@@ -1701,7 +1701,7 @@ f_readdirex(typval_T *argvars, typval_T *rettv)
     char_u     *path;
     garray_T   ga;
     int                i;
-    int         sort = READDIR_SORT_BYTE;
+    int                sort = READDIR_SORT_BYTE;
 
     if (rettv_list_alloc(rettv) == FAIL)
        return;
index 2544c53b24e387c85be8e1713ffbb3524f4b0629..3b0ebac3f6bb753ccddd1e80cded3bb3fc4232db 100644 (file)
--- a/src/gui.c
+++ b/src/gui.c
@@ -5371,7 +5371,7 @@ gui_do_findrepl(
     // escape slash and backslash
     p = vim_strsave_escaped(find_text, (char_u *)"/\\");
     if (p != NULL)
-        ga_concat(&ga, p);
+       ga_concat(&ga, p);
     vim_free(p);
     if (flags & FRD_WHOLE_WORD)
        ga_concat(&ga, (char_u *)"\\>");
@@ -5445,7 +5445,7 @@ gui_do_findrepl(
            // direction
            p = vim_strsave_escaped(ga.ga_data, (char_u *)"?");
            if (p != NULL)
-               (void)do_search(NULL, '?', '?', p, 1L, searchflags, NULL);
+               (void)do_search(NULL, '?', '?', p, 1L, searchflags, NULL);
            vim_free(p);
        }
 
index 3f46a072761c0ed2efb61a441abba298a567c88b..75a310f53e962b6c406073c05b5c2746e5f584dc 100644 (file)
@@ -2356,7 +2356,7 @@ colorname2rgb(char_u *name)
     guicolor_T
 gui_get_color_cmn(char_u *name)
 {
-    int         i;
+    int                i;
     guicolor_T  color;
 
     struct rgbcolor_table_S {
index 956fd4d7c5d5cb5b283b9d8202bb5edb7b726076..120ed7bbdd0b581dd6e51e32f8a794deaf49c864 100644 (file)
@@ -949,29 +949,29 @@ luaV_list_newindex(lua_State *L)
     li = list_find(l, n);
     if (li == NULL)
     {
-        if (!lua_isnil(L, 3))
-        {
-          typval_T v;
-          luaV_checktypval(L, 3, &v, "inserting list item");
-          if (list_insert_tv(l, &v, li) == FAIL)
-               luaL_error(L, "failed to add item to list");
-          clear_tv(&v);
-        }
+       if (!lua_isnil(L, 3))
+       {
+           typval_T v;
+           luaV_checktypval(L, 3, &v, "inserting list item");
+           if (list_insert_tv(l, &v, li) == FAIL)
+               luaL_error(L, "failed to add item to list");
+           clear_tv(&v);
+       }
     }
     else
     {
-        if (lua_isnil(L, 3)) // remove?
-        {
+       if (lua_isnil(L, 3)) // remove?
+       {
            vimlist_remove(l, li, li);
            listitem_free(l, li);
-        }
-        else
-        {
+       }
+       else
+       {
            typval_T v;
            luaV_checktypval(L, 3, &v, "setting list item");
            clear_tv(&li->li_tv);
            li->li_tv = v;
-        }
+       }
     }
     return 0;
 }
index 0666f0e0d43302a6bd4e8fe497e64c588a551204..06d98f92ecbe1b21891fd8f263b23d0dcc919d7b 100644 (file)
@@ -161,7 +161,7 @@ tabstop_start(colnr_T col, int ts, int *vts)
     int                tabcount;
     colnr_T    tabcol = 0;
     int                t;
-    int         excess;
+    int                excess;
 
     if (vts == NULL || vts[0] == 0)
        return (col / ts) * ts;
@@ -1804,7 +1804,7 @@ ex_retab(exarg_T *eap)
        && curbuf->b_p_ts == tabstop_first(new_vts_array))
        ; // not changed
     else if (tabstop_count(curbuf->b_p_vts_array) > 0
-        && tabstop_eq(curbuf->b_p_vts_array, new_vts_array))
+       && tabstop_eq(curbuf->b_p_vts_array, new_vts_array))
        ; // not changed
     else
        redraw_curbuf_later(NOT_VALID);
index 86c6a1415e064359a77b4bb52b8de8a1593eb43a..6e380986426c937c20d622482f9efdf5ecbd766e 100644 (file)
@@ -1966,8 +1966,8 @@ ins_compl_set_original_text(char_u *str)
        p = vim_strsave(str);
        if (p != NULL)
        {
-           vim_free(compl_first_match->cp_prev->cp_str);
-           compl_first_match->cp_prev->cp_str = p;
+          vim_free(compl_first_match->cp_prev->cp_str);
+          compl_first_match->cp_prev->cp_str = p;
        }
     }
 }
@@ -3176,7 +3176,7 @@ typedef struct
  *   st->first_match_pos - position of the first completion match
  *   st->last_match_pos - position of the last completion match
  *   st->set_match_pos - TRUE if the first match position should be saved to
- *                      avoid loops after the search wraps around.
+ *                         avoid loops after the search wraps around.
  *   st->dict - name of the dictionary or thesaurus file to search
  *   st->dict_f - flag specifying whether "dict" is an exact file name or not
  *
index 5fbc2fdc671185dc9aef85e888ad5abc215fe078..31f026097733a05a6f1c5ce021e93b0d053660d3 100644 (file)
--- a/src/job.c
+++ b/src/job.c
@@ -530,7 +530,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
                }
                // Allow empty string, "winpty", "conpty".
                if (!(*p == NUL || STRCMP(p, "winpty") == 0
-                                                 || STRCMP(p, "conpty") == 0))
+                                                 || STRCMP(p, "conpty") == 0))
                {
                    semsg(_(e_invalid_value_for_argument_str), "tty_type");
                    return FAIL;
index e8832d62f62783b73a0ac63d1d3e9c90e672f6b4..6350772c7294e1ab414a1b2a861aa1e7af849e75 100644 (file)
@@ -276,7 +276,7 @@ enum key_extra
     , KE_CANCEL = 102          // return from vgetc()
     , KE_COMMAND = 103         // <Cmd> special key
     , KE_SCRIPT_COMMAND = 104  // <ScriptCmd> special key
-    , KE_S_BS = 105            // shift + <BS>
+    , KE_S_BS = 105            // shift + <BS>
 };
 
 /*
index 53733c7f7b3b4bf606ca286eddf994c5f15f6d7e..aa61d900fff76da746289ba8ccc120cc8a4a5be4 100644 (file)
                                // see mch_open() comment
 # define mch_fopen(n, p)       fopen(vms_fixfilename(n), (p))
 # define mch_fstat(n, p)       fstat((n), (p))
-# undef HAVE_LSTAT             // VMS does not have lstat()
+# undef HAVE_LSTAT             // VMS does not have lstat()
 # define mch_stat(n, p)                stat(vms_fixfilename(n), (p))
 #else
 # ifndef MSWIN
 #define REPLACE_NORMAL(s) (((s) & REPLACE_FLAG) && !((s) & VREPLACE_FLAG))
 
 #ifdef FEAT_ARABIC
-# define ARABIC_CHAR(ch)            (((ch) & 0xFF00) == 0x0600)
+# define ARABIC_CHAR(ch)           (((ch) & 0xFF00) == 0x0600)
 # define UTF_COMPOSINGLIKE(p1, p2)  utf_composinglike((p1), (p2))
 #else
 # define UTF_COMPOSINGLIKE(p1, p2)  utf_iscomposing(utf_ptr2char(p2))
index 3c4236b86a73cbfc176fe8a6a7e6c2f5fb40a09c..95f6fae9566959b6d3031bc2815531a21aa4d080 100644 (file)
@@ -1638,7 +1638,7 @@ get_menu_cmd_modes(
            modes = MENU_INSERT_MODE;
            break;
        case 't':
-           if (*cmd == 'l')            // tlmenu, tlunmenu, tlnoremenu
+           if (*cmd == 'l')            // tlmenu, tlunmenu, tlnoremenu
            {
                modes = MENU_TERMINAL_MODE;
                ++cmd;
index 7a5fecd104c28d58b337a9c1d915e4fd6ccd8f64..9bbe3ad3858063c864575980f7facfc2197ed54b 100644 (file)
@@ -575,7 +575,8 @@ check_status(buf_T *buf)
 }
 
 /*
- * Ask for a reply from the user, a 'y' or a 'n'.
+ * Ask for a reply from the user, a 'y' or a 'n', with prompt "str" (which
+ * should have been translated already).
  * No other characters are accepted, the message is repeated until a valid
  * reply is entered or CTRL-C is hit.
  * If direct is TRUE, don't use vgetc() but ui_inchar(), don't get characters
@@ -653,7 +654,7 @@ get_mode(char_u *buf)
        {
            buf[i++] = VIsual_mode;
            if (restart_VIsual_select)
-               buf[i++] = 's';
+               buf[i++] = 's';
        }
     }
     else if (State == MODE_HITRETURN || State == MODE_ASKMORE
index a22463110b1ad2c59371029a5608bde1d86d232c..7840ea98f0f64776dac6350183c404eba5a1c35b 100644 (file)
@@ -647,7 +647,7 @@ leftcol_changed(void)
     long       lastcol;
     colnr_T    s, e;
     int                retval = FALSE;
-    long        siso = get_sidescrolloff_value();
+    long       siso = get_sidescrolloff_value();
 
     changed_cline_bef_curs();
     lastcol = curwin->w_leftcol + curwin->w_width - curwin_col_off() - 1;
index 005b944a0385874ff119990889ae3806aac4f4fd..af9186d72ffc8e8c724dabe454a16d35c258fb93 100644 (file)
@@ -2284,7 +2284,7 @@ check_termcode_mouse(
        //          ^----- column
        //       ^-------- code
        //
-       // \033[<%d;%d;%dm        : mouse release event
+       // \033[<%d;%d;%dm        : mouse release event
        //             ^-- row
        //          ^----- column
        //       ^-------- code
@@ -2565,9 +2565,9 @@ check_termcode_mouse(
         * Pe, the event code indicates what event caused this report
         *    The following event codes are defined:
         *    0 - request, the terminal received an explicit request for a
-        *        locator report, but the locator is unavailable
+        *        locator report, but the locator is unavailable
         *    1 - request, the terminal received an explicit request for a
-        *        locator report
+        *        locator report
         *    2 - left button down
         *    3 - left button up
         *    4 - middle button down
index 5e31e7133628ed6d3e0105381f1c38e7558d4912..58bd97fe0402e7fb18e9435426f19bd997f2e648 100644 (file)
@@ -185,7 +185,7 @@ update_topline(void)
 #endif
     int                check_topline = FALSE;
     int                check_botline = FALSE;
-    long        *so_ptr = curwin->w_p_so >= 0 ? &curwin->w_p_so : &p_so;
+    long       *so_ptr = curwin->w_p_so >= 0 ? &curwin->w_p_so : &p_so;
     int                save_so = *so_ptr;
 
     // If there is no valid screen and when the window height is zero just use
@@ -435,7 +435,7 @@ check_top_offset(void)
 {
     lineoff_T  loff;
     int                n;
-    long        so = get_scrolloff_value();
+    long       so = get_scrolloff_value();
 
     if (curwin->w_cursor.lnum < curwin->w_topline + so
 #ifdef FEAT_FOLDING
@@ -951,8 +951,8 @@ curs_columns(
     colnr_T    startcol;
     colnr_T    endcol;
     colnr_T    prev_skipcol;
-    long        so = get_scrolloff_value();
-    long        siso = get_sidescrolloff_value();
+    long       so = get_scrolloff_value();
+    long       siso = get_sidescrolloff_value();
 
     /*
      * First make sure that w_topline is valid (after moving the cursor).
@@ -1976,7 +1976,7 @@ scroll_cursor_bot(int min_scroll, int set_topbot)
     linenr_T   old_valid = curwin->w_valid;
     int                old_empty_rows = curwin->w_empty_rows;
     linenr_T   cln;                // Cursor Line Number
-    long        so = get_scrolloff_value();
+    long       so = get_scrolloff_value();
 
     cln = curwin->w_cursor.lnum;
     if (set_topbot)
@@ -2270,7 +2270,7 @@ cursor_correct(void)
     int                above_wanted, below_wanted;
     linenr_T   cln;                // Cursor Line Number
     int                max_off;
-    long        so = get_scrolloff_value();
+    long       so = get_scrolloff_value();
 
     /*
      * How many lines we would like to have above/below the cursor depends on
@@ -2390,7 +2390,7 @@ onepage(int dir, long count)
     int                retval = OK;
     lineoff_T  loff;
     linenr_T   old_topline = curwin->w_topline;
-    long        so = get_scrolloff_value();
+    long       so = get_scrolloff_value();
 
     if (curbuf->b_ml.ml_line_count == 1)    // nothing to do
     {
index 96f83d3f316acfce2d4ccb87fb60f7966e01953c..1baf68a1453aee41c98451039ae114a5350a4a57 100644 (file)
@@ -2644,7 +2644,7 @@ nv_zet(cmdarg_T *cap)
     long       old_fdl = curwin->w_p_fdl;
     int                old_fen = curwin->w_p_fen;
 #endif
-    long        siso = get_sidescrolloff_value();
+    long       siso = get_sidescrolloff_value();
 
     if (VIM_ISDIGIT(nchar) && !nv_z_get_count(cap, &nchar))
            return;
@@ -6307,7 +6307,7 @@ nv_redo_or_register(cmdarg_T *cap)
            // the unnamed register is 0
            reg = 0;
 
-        VIsual_select_reg = valid_yank_reg(reg, TRUE) ? reg : 0;
+       VIsual_select_reg = valid_yank_reg(reg, TRUE) ? reg : 0;
        return;
     }
 
index 5137bbbcdb809c0b70c3f191ee029e739291e1fa..3940e484ce083ce096caad6d1998d8f7935a819d 100644 (file)
--- a/src/ops.c
+++ b/src/ops.c
@@ -625,7 +625,7 @@ op_delete(oparg_T *oap)
 
     if (VIsual_select && oap->is_VIsual)
        // use register given with CTRL_R, defaults to zero
-        oap->regname = VIsual_select_reg;
+       oap->regname = VIsual_select_reg;
 
 #ifdef FEAT_CLIPBOARD
     adjust_clip_reg(&oap->regname);
@@ -1208,9 +1208,9 @@ op_replace(oparg_T *oap, int c)
                curwin->w_cursor.col -= (virtcols + 1);
                for (; virtcols >= 0; virtcols--)
                {
-                   if ((*mb_char2len)(c) > 1)
+                   if ((*mb_char2len)(c) > 1)
                       replace_character(c);
-                   else
+                   else
                        PBYTE(curwin->w_cursor, c);
                   if (inc(&curwin->w_cursor) == -1)
                       break;
index 43f584d1d35f21730076d019777bcbe71a49745f..559e260ce9215bfbdf4ba23d46395c74d74b1e98 100644 (file)
@@ -489,7 +489,7 @@ set_init_1(int clean_arg)
 # ifdef VIMDLL
               (!gui.in_use && !gui.starting) &&
 # endif
-               GetACP() != GetConsoleCP())
+              GetACP() != GetConsoleCP())
            {
                char    buf[50];
 
@@ -1016,7 +1016,7 @@ set_init_3(void)
      * Default values depend on shell (cmd.exe is default shell):
      *
      *                     p_shcf      p_sxq
-     * cmd.exe          -   "/c"       "("
+     * cmd.exe         -   "/c"        "("
      * powershell.exe   -   "-Command" "\""
      * pwsh.exe                -   "-c"        "\""
      * "sh" like shells -   "-c"       "\""
@@ -3342,7 +3342,7 @@ set_num_option(
 #ifdef FEAT_VARTABS
        // Use the first 'vartabstop' value, or 'tabstop' if vts isn't in use.
        curbuf->b_p_sw = tabstop_count(curbuf->b_p_vts_array) > 0
-                      ? tabstop_first(curbuf->b_p_vts_array)
+                      ? tabstop_first(curbuf->b_p_vts_array)
                       : curbuf->b_p_ts;
 #else
        curbuf->b_p_sw = curbuf->b_p_ts;
@@ -5143,12 +5143,12 @@ unset_global_local_option(char_u *name, void *from)
            clear_string_option(&buf->b_p_tc);
            buf->b_tc_flags = 0;
            break;
-        case PV_SISO:
-            curwin->w_p_siso = -1;
-            break;
-        case PV_SO:
-            curwin->w_p_so = -1;
-            break;
+       case PV_SISO:
+           curwin->w_p_siso = -1;
+           break;
+       case PV_SO:
+           curwin->w_p_so = -1;
+           break;
 #ifdef FEAT_FIND_ID
        case PV_DEF:
            clear_string_option(&buf->b_p_def);
@@ -5255,8 +5255,8 @@ get_varp_scope(struct vimoption *p, int scope)
            case PV_AR:   return (char_u *)&(curbuf->b_p_ar);
            case PV_TAGS: return (char_u *)&(curbuf->b_p_tags);
            case PV_TC:   return (char_u *)&(curbuf->b_p_tc);
-            case PV_SISO: return (char_u *)&(curwin->w_p_siso);
-            case PV_SO:   return (char_u *)&(curwin->w_p_so);
+           case PV_SISO: return (char_u *)&(curwin->w_p_siso);
+           case PV_SO:   return (char_u *)&(curwin->w_p_so);
 #ifdef FEAT_FIND_ID
            case PV_DEF:  return (char_u *)&(curbuf->b_p_def);
            case PV_INC:  return (char_u *)&(curbuf->b_p_inc);
@@ -6514,7 +6514,7 @@ ExpandSettings(
     char_u     *fuzzystr,
     int                *numMatches,
     char_u     ***matches,
-    int         can_fuzzy)
+    int                can_fuzzy)
 {
     int                num_normal = 0;     // Nr of matching non-term-code settings
     int                num_term = 0;       // Nr of matching terminal code settings
@@ -6579,7 +6579,7 @@ ExpandSettings(
            }
            else if (!fuzzy && options[opt_idx].shortname != NULL
                        && vim_regexec(regmatch,
-                             (char_u *)options[opt_idx].shortname, (colnr_T)0))
+                            (char_u *)options[opt_idx].shortname, (colnr_T)0))
            {
                // Compare against the abbreviated option name (for regular
                // expression match). Fuzzy matching (previous if) already
index fdbe926a00fd1f2750d4feea040cef9c0412b138..106593f413313d691a9407156369662cbfb33bfe 100644 (file)
@@ -267,8 +267,8 @@ typedef enum {
 #define SHM_COMPLETIONMENU  'c'                // completion menu messages
 #define SHM_RECORDING  'q'             // short recording message
 #define SHM_FILEINFO   'F'             // no file info messages
-#define SHM_SEARCHCOUNT  'S'           // search stats: '[1/10]'
-#define SHM_POSIX       "AS"            // POSIX value
+#define SHM_SEARCHCOUNT  'S'           // search stats: '[1/10]'
+#define SHM_POSIX       "AS"           // POSIX value
 #define SHM_ALL                "rmfixlnwaWtToOsAIcqFS" // all possible flags for 'shm'
 
 // characters for p_go:
index a51f03499c45346b5af4718ccdc53b38c5f4fcdf..b786f8df07133851586c813f5e646bed3925183b 100644 (file)
@@ -1778,10 +1778,10 @@ ex_xrestore(exarg_T *eap)
 {
     if (eap->arg != NULL && STRLEN(eap->arg) > 0)
     {
-        if (xterm_display_allocated)
-            vim_free(xterm_display);
-        xterm_display = (char *)vim_strsave(eap->arg);
-        xterm_display_allocated = TRUE;
+       if (xterm_display_allocated)
+           vim_free(xterm_display);
+       xterm_display = (char *)vim_strsave(eap->arg);
+       xterm_display_allocated = TRUE;
     }
     smsg(_("restoring display %s"), xterm_display == NULL
                    ? (char *)mch_getenv((char_u *)"DISPLAY") : xterm_display);
@@ -7210,7 +7210,7 @@ load_libgpm(void)
     {
        if (p_verbose > 0)
            smsg_attr(HL_ATTR(HLF_W),
-                       _("Could not load gpm library: %s"), dlerror());
+                              _("Could not load gpm library: %s"), dlerror());
        return FAIL;
     }
 
index c32475cb9b14497156eb82c0b455fbf2db1312c2..cd5166f4836d4c682c2cac2047603730123b819d 100644 (file)
@@ -2810,8 +2810,8 @@ showmatch(
 #endif
     colnr_T    save_dollar_vcol;
     char_u     *p;
-    long        *so = curwin->w_p_so >= 0 ? &curwin->w_p_so : &p_so;
-    long        *siso = curwin->w_p_siso >= 0 ? &curwin->w_p_siso : &p_siso;
+    long       *so = curwin->w_p_so >= 0 ? &curwin->w_p_so : &p_so;
+    long       *siso = curwin->w_p_siso >= 0 ? &curwin->w_p_siso : &p_siso;
 
     /*
      * Only show match for chars in the 'matchpairs' option.
@@ -4189,14 +4189,14 @@ f_searchcount(typval_T *argvars, typval_T *rettv)
            li = list_find(di->di_tv.vval.v_list, 1L);
            if (li != NULL)
            {
-               pos.col = tv_get_number_chk(&li->li_tv, &error) - 1;
+               pos.col = tv_get_number_chk(&li->li_tv, &error) - 1;
                if (error)
                    return;
            }
            li = list_find(di->di_tv.vval.v_list, 2L);
            if (li != NULL)
            {
-               pos.coladd = tv_get_number_chk(&li->li_tv, &error);
+               pos.coladd = tv_get_number_chk(&li->li_tv, &error);
                if (error)
                    return;
            }
index 795438cd835937b58da44146ee977191fec47955..bc259986ba0a33b4facc17c5e41d501b225049aa 100644 (file)
@@ -972,13 +972,13 @@ makeopens(
     // Restore 'shortmess'.
     if (ssop_flags & SSOP_OPTIONS)
     {
-        if (fprintf(fd, "set shortmess=%s", p_shm) < 0 || put_eol(fd) == FAIL)
-            goto fail;
+       if (fprintf(fd, "set shortmess=%s", p_shm) < 0 || put_eol(fd) == FAIL)
+           goto fail;
     }
     else
     {
-        if (put_line(fd, "let &shortmess = s:shortmess_save") == FAIL)
-            goto fail;
+       if (put_line(fd, "let &shortmess = s:shortmess_save") == FAIL)
+           goto fail;
     }
 
     if (restore_height_width)
index 73ea210a071a5011c8801abd91c348db1378d056..ecb54550d675bf9319521368d6c93c9c3e7beea0 100644 (file)
@@ -3133,11 +3133,11 @@ suggest_try_soundalike(suginfo_T *su)
            // TODO: also soundfold the next words, so that we can try joining
            // and splitting
 #ifdef SUGGEST_PROFILE
-       prof_init();
+           prof_init();
 #endif
            suggest_trie_walk(su, lp, salword, TRUE);
 #ifdef SUGGEST_PROFILE
-       prof_report("soundalike");
+           prof_report("soundalike");
 #endif
        }
     }
index fd1a92555dca6d6053ae0599e22cf7a4a881ad67..6c0179d239399de35e8ec48e540284da4c777ded 100644 (file)
@@ -1650,7 +1650,7 @@ typedef struct
 # if defined(FEAT_LUA)
     cfunc_T     uf_cb;         // callback function for cfunc
     cfunc_free_T uf_cb_free;    // callback function to free cfunc
-    void        *uf_cb_state;   // state of uf_cb
+    void       *uf_cb_state;   // state of uf_cb
 # endif
 
     garray_T   uf_lines;       // function lines
@@ -2080,15 +2080,15 @@ typedef struct AutoPatCmd_S AutoPatCmd_T;
  */
 typedef enum {
     ETYPE_TOP,             // toplevel
-    ETYPE_SCRIPT,           // sourcing script, use es_info.sctx
-    ETYPE_UFUNC,            // user function, use es_info.ufunc
-    ETYPE_AUCMD,            // autocomand, use es_info.aucmd
-    ETYPE_MODELINE,         // modeline, use es_info.sctx
-    ETYPE_EXCEPT,           // exception, use es_info.exception
-    ETYPE_ARGS,             // command line argument
-    ETYPE_ENV,              // environment variable
-    ETYPE_INTERNAL,         // internal operation
-    ETYPE_SPELL,            // loading spell file
+    ETYPE_SCRIPT,          // sourcing script, use es_info.sctx
+    ETYPE_UFUNC,           // user function, use es_info.ufunc
+    ETYPE_AUCMD,           // autocomand, use es_info.aucmd
+    ETYPE_MODELINE,        // modeline, use es_info.sctx
+    ETYPE_EXCEPT,          // exception, use es_info.exception
+    ETYPE_ARGS,                    // command line argument
+    ETYPE_ENV,             // environment variable
+    ETYPE_INTERNAL,        // internal operation
+    ETYPE_SPELL,           // loading spell file
 } etype_T;
 
 typedef struct {
index a6697043558c72337024469bdabad1dd2d21103e..1fe2eefdbd6104bf6b747199cde3a3ad698f15f3 100644 (file)
--- a/src/tag.c
+++ b/src/tag.c
@@ -280,7 +280,7 @@ do_tag(
     int                skip_msg = FALSE;
     char_u     *buf_ffname = curbuf->b_ffname;     // name to use for
                                                    // priority computation
-    int         use_tfu = 1;
+    int                use_tfu = 1;
 
     // remember the matches for the last used tag
     static int         num_matches = 0;
@@ -1422,8 +1422,8 @@ find_tagfunc_tags(
     pos_T       save_pos;
     list_T      *taglist;
     listitem_T  *item;
-    int         ntags = 0;
-    int         result = FAIL;
+    int                ntags = 0;
+    int                result = FAIL;
     typval_T   args[4];
     typval_T   rettv;
     char_u      flagString[4];
@@ -1820,7 +1820,7 @@ findtags_in_help_init(findtags_state_T *st)
     static int
 findtags_apply_tfu(findtags_state_T *st, char_u *pat, char_u *buf_ffname)
 {
-    int         use_tfu = ((st->flags & TAG_NO_TAGFUNC) == 0);
+    int                use_tfu = ((st->flags & TAG_NO_TAGFUNC) == 0);
     int                retval;
 
     if (!use_tfu || tfu_in_use || *curbuf->b_p_tfu == NUL)
index f34b642db99c83ce475fea9f30a4907154e12033..ef3cf9433cda37b6f4876203d8a3cb11bbc27324 100644 (file)
@@ -688,7 +688,7 @@ static struct builtin_term builtin_termcaps[] =
     {K_K8,             "\316\372"},
     {K_K9,             "\316\376"},
     {K_BS,             "\316x"},
-    {K_S_BS,            "\316y"},
+    {K_S_BS,           "\316y"},
 # endif
 
 # if defined(VMS) || defined(ALL_BUILTIN_TCAPS)
index a33a3a345b134b97a2572be25f7b68477fad7628..703966a877becec76fc21069d4d896981c0dc270 100644 (file)
@@ -4442,15 +4442,15 @@ sync_shell_dir(VTermStringFragment *frag)
     // remove HOSTNAME to get PWD
     while (*pos != '/' && offset < (int)frag->len)
     {
-        offset += 1;
-        pos += 1;
+       offset += 1;
+       pos += 1;
     }
 
     if (offset >= (int)frag->len)
     {
-        semsg(_(e_failed_to_extract_pwd_from_str_check_your_shell_config),
+       semsg(_(e_failed_to_extract_pwd_from_str_check_your_shell_config),
                                                                    frag->str);
-        return;
+       return;
     }
 
     new_dir = alloc(frag->len - offset + 1);
index e5b2113d2998fcdb390bc67f9930169ddb4163f4..96ff300c57833392e1ddaa9863644fcc9a292061 100644 (file)
@@ -298,7 +298,7 @@ func Test_cursorline_cursorbind_horizontal_scroll()
 
   let lines =<< trim END
       call setline(1, 'aa bb cc dd ee ff gg hh ii jj kk ll mm' ..
-      \ ' nn oo pp qq rr ss tt uu vv ww xx yy zz')
+                    \ ' nn oo pp qq rr ss tt uu vv ww xx yy zz')
       set nowrap
       " The following makes the cursor apparent on the screen dump
       set sidescroll=1 cursorcolumn
index aadc86362c26205d01a46a535db4191b902712c4..e15081a49885ecd331201e25b8177c5f044149ab 100644 (file)
@@ -176,7 +176,7 @@ internal_format(
                    // Increment count of how many whitespace chars in this
                    // group; we only need to know if it's more than one.
                    if (wcc < 2)
-                       wcc++;
+                       wcc++;
                }
                if (curwin->w_cursor.col == 0 && WHITECHAR(cc))
                    break;              // only spaces in front of text
index afe4e620bbac7ef09f4e816779aa9127f4fd644c..ba98f1e84f699ea2b3b6d330c0e49b563f9863cf 100644 (file)
@@ -971,7 +971,7 @@ tv_get_string_buf_chk_strict(typval_T *varp, char_u *buf, int strict)
        case VAR_SPECIAL:
            STRCPY(buf, get_var_special_name(varp->vval.v_number));
            return buf;
-        case VAR_BLOB:
+       case VAR_BLOB:
            emsg(_(e_using_blob_as_string));
            break;
        case VAR_JOB:
index a6cee804ad47de056543e2f8158c25e833e4602a..08664bff65e2c2d49b6bc79817092212bf037d0c 100644 (file)
--- a/src/ui.c
+++ b/src/ui.c
@@ -199,10 +199,10 @@ ui_inchar(
      * while (not timed out)
      * {
      *     if (any-timer-triggered)
-     *        invoke-timer-callback;
+     *       invoke-timer-callback;
      *     wait-for-character();
      *     if (character available)
-     *        break;
+     *       break;
      * }
      *
      * wait-for-character() does:
@@ -210,13 +210,13 @@ ui_inchar(
      * {
      *     Wait for event;
      *     if (something on channel)
-     *        read/write channel;
-     *     else if (resized)
-     *        handle_resize();
-     *     else if (system event)
-     *        deal-with-system-event;
-     *     else if (character available)
-     *        break;
+     *       read/write channel;
+     *    else if (resized)
+     *       handle_resize();
+     *    else if (system event)
+     *       deal-with-system-event;
+     *    else if (character available)
+     *       break;
      * }
      *
      */
index 081bac19a398b94496d1311e7fb114a8581cf21d..8d82beb7eb3a6f8cc16b4d6101c1e7c76bccaf63 100644 (file)
@@ -2511,7 +2511,7 @@ copy_func(char_u *lambda, char_u *global, ectx_T *ectx)
            goto failed;
        if (fill_partial_and_closure(pt, ufunc, ectx) == FAIL)
        {
-            vim_free(pt);
+           vim_free(pt);
            goto failed;
        }
        ufunc->uf_partial = pt;
index 54eb6521b89985924cad5905c34a16cb5d0317ac..c069781c344564c8617080061c4de1a97005725a 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4928,
 /**/
     4927,
 /**/
index f17da411fcd78555cc90f1bfe2c5c11232981117..4e213b2c9ed2896e68f747287e23c0816900d35b 100644 (file)
--- a/src/vim.h
+++ b/src/vim.h
@@ -1375,8 +1375,8 @@ enum auto_event
                                // entering its window
     EVENT_TERMRESPONSE,                // after setting "v:termresponse"
     EVENT_TEXTCHANGED,         // text was modified not in Insert mode
-    EVENT_TEXTCHANGEDI,         // text was modified in Insert mode
-    EVENT_TEXTCHANGEDP,         // TextChangedI with popup menu visible
+    EVENT_TEXTCHANGEDI,                // text was modified in Insert mode
+    EVENT_TEXTCHANGEDP,                // TextChangedI with popup menu visible
     EVENT_TEXTYANKPOST,                // after some text was yanked
     EVENT_USER,                        // user defined autocommand
     EVENT_VIMENTER,            // after starting Vim
index 3b14ffc7305ddfa473e0b94c6450b08488a96157..1b5a58b8c3be02e2a4920601e3b94b8c09a4fa4d 100644 (file)
@@ -500,7 +500,7 @@ struct dfunc_S {
 
 // Number of entries used by stack frame for a function call.
 // - ec_dfunc_idx:   function index
-// - ec_iidx:        instruction index
+// - ec_iidx:       instruction index
 // - ec_instr:       instruction list pointer
 // - ec_outer:      stack used for closures
 // - funclocal:             function-local data
index e95340c7ad5ae78590cfa66eb47867d5cfa13a8c..bdaf1eddc763251a727603a28c977d71cff83e20 100644 (file)
@@ -1041,7 +1041,7 @@ compile_all_expr_in_str(char_u *str, int evalstr, cctx_T *cctx)
        // Skip the opening {.
        block_start = skipwhite(p + 1);
        block_end = block_start;
-       if (*block_start != NUL &&skip_expr(&block_end, NULL) == FAIL)
+       if (*block_start != NUL && skip_expr(&block_end, NULL) == FAIL)
            return FAIL;
        block_end = skipwhite(block_end);
        // The block must be closed by a }.
index eb6dc2829b590003d587c48485f6410bac93834a..5644f3474fb3a895fbd3d24cc4c8c75da509ecf1 100644 (file)
@@ -64,13 +64,13 @@ typedef struct {
 //       arg2          second argument from caller (if present)
 //       extra_arg1    any missing optional argument default value
 // FP ->  cur_func     calling function
-//        current      previous instruction pointer
-//        frame_ptr    previous Frame Pointer
-//        var1         space for local variable
-//        var2         space for local variable
-//        ....         fixed space for max. number of local variables
-//        temp         temporary values
-//        ....         flexible space for temporary values (can grow big)
+//       current       previous instruction pointer
+//       frame_ptr     previous Frame Pointer
+//       var1          space for local variable
+//       var2          space for local variable
+//       ....          fixed space for max. number of local variables
+//       temp          temporary values
+//       ....          flexible space for temporary values (can grow big)
 
 /*
  * Execution context.
@@ -6162,7 +6162,7 @@ list_instructions(char *pfx, isn_T *instr, int instr_count, ufunc_T *ufunc)
                                                         iptr->isn_arg.string);
                            break;
            case ISN_PUT:
-               if (iptr->isn_arg.put.put_lnum == LNUM_VARIABLE_RANGE_ABOVE)
+               if (iptr->isn_arg.put.put_lnum == LNUM_VARIABLE_RANGE_ABOVE)
                    smsg("%s%4d PUT %c above range",
                                  pfx, current, iptr->isn_arg.put.put_regname);
                else if (iptr->isn_arg.put.put_lnum == LNUM_VARIABLE_RANGE)
index b4f8c1d826d2b37faaf0d442834c0eccf6ae8395..fca0eea3291607dc24c66b74d0179bdbb58bd7e2 100644 (file)
@@ -6371,8 +6371,8 @@ scroll_to_fraction(win_T *wp, int prev_height)
     // - window height is sufficient to display the whole buffer and first line
     //   is visible.
     if (height > 0
-        && (!wp->w_p_scb || wp == curwin)
-        && (height < wp->w_buffer->b_ml.ml_line_count || wp->w_topline > 1))
+          && (!wp->w_p_scb || wp == curwin)
+          && (height < wp->w_buffer->b_ml.ml_line_count || wp->w_topline > 1))
     {
        /*
         * Find a value for w_topline that shows the cursor at the same