diff options
| author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2022-10-21 16:26:54 +0200 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-21 16:26:54 +0200 | 
| commit | fa6556515f1d3b1e51ba9e2c84f0b575d69eef44 (patch) | |
| tree | 91d74115f420dcf9313c6fa62e6f6dcd630aa7e2 /src/nvim/ex_cmds.c | |
| parent | 784e498c4a9c1f03266ced5ec3f55c3a6c94b80d (diff) | |
| parent | a11e96edfc2dec57be5773b6ce64a1323ce8431d (diff) | |
| download | rneovim-fa6556515f1d3b1e51ba9e2c84f0b575d69eef44.tar.gz rneovim-fa6556515f1d3b1e51ba9e2c84f0b575d69eef44.tar.bz2 rneovim-fa6556515f1d3b1e51ba9e2c84f0b575d69eef44.zip | |
Merge pull request #20664 from dundargoc/refactor/uncrustify
refactor(uncrustify): improved formatting rules
Diffstat (limited to 'src/nvim/ex_cmds.c')
| -rw-r--r-- | src/nvim/ex_cmds.c | 48 | 
1 files changed, 24 insertions, 24 deletions
| diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 8f550d537b..87c4f4e654 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -3409,6 +3409,30 @@ static int check_regexp_delim(int c)  /// @return 0, 1 or 2. See show_cmdpreview() for more information on what the return value means.  static int do_sub(exarg_T *eap, proftime_T timeout, long cmdpreview_ns, handle_T cmdpreview_bufnr)  { +#define ADJUST_SUB_FIRSTLNUM() \ +  do { \ +    /* For a multi-line match, make a copy of the last matched */ \ +    /* line and continue in that one. */ \ +    if (nmatch > 1) { \ +      sub_firstlnum += (linenr_T)nmatch - 1; \ +      xfree(sub_firstline); \ +      sub_firstline = xstrdup(ml_get(sub_firstlnum)); \ +      /* When going beyond the last line, stop substituting. */ \ +      if (sub_firstlnum <= line2) { \ +        do_again = true; \ +      } else { \ +        subflags.do_all = false; \ +      } \ +    } \ +    if (skip_match) { \ +      /* Already hit end of the buffer, sub_firstlnum is one */ \ +      /* less than what it ought to be. */ \ +      xfree(sub_firstline); \ +      sub_firstline = xstrdup(""); \ +      copycol = 0; \ +    } \ +  } while (0) +    long i = 0;    regmmatch_T regmatch;    static subflags_T subflags = { @@ -3980,30 +4004,6 @@ static int do_sub(exarg_T *eap, proftime_T timeout, long cmdpreview_ns, handle_T            skip_match = true;          } -#define ADJUST_SUB_FIRSTLNUM() \ -  do { \ -    /* For a multi-line match, make a copy of the last matched */ \ -    /* line and continue in that one. */ \ -    if (nmatch > 1) { \ -      sub_firstlnum += (linenr_T)nmatch - 1; \ -      xfree(sub_firstline); \ -      sub_firstline = xstrdup(ml_get(sub_firstlnum)); \ -      /* When going beyond the last line, stop substituting. */ \ -      if (sub_firstlnum <= line2) { \ -        do_again = true; \ -      } else { \ -        subflags.do_all = false; \ -      } \ -    } \ -    if (skip_match) { \ -      /* Already hit end of the buffer, sub_firstlnum is one */ \ -      /* less than what it ought to be. */ \ -      xfree(sub_firstline); \ -      sub_firstline = xstrdup(""); \ -      copycol = 0; \ -    } \ -  } while (0) -          // Save the line numbers for the preview buffer          // NOTE: If the pattern matches a final newline, the next line will          // be shown also, but should not be highlighted. Intentional for now. | 
