diff options
author | dundargoc <gocdundar@gmail.com> | 2023-12-16 22:14:28 +0100 |
---|---|---|
committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-12-18 16:22:13 +0100 |
commit | 6cb78e2d1c4c6c63c628c965076a07ce5f7adbb6 (patch) | |
tree | 20bfbe8b317fde86121fcf9af10975b2b95e5758 /src/nvim/ex_cmds.c | |
parent | 8c173cec295cf8c78bdbc440dc87f0473560f69a (diff) | |
download | rneovim-6cb78e2d1c4c6c63c628c965076a07ce5f7adbb6.tar.gz rneovim-6cb78e2d1c4c6c63c628c965076a07ce5f7adbb6.tar.bz2 rneovim-6cb78e2d1c4c6c63c628c965076a07ce5f7adbb6.zip |
docs: add style rule regarding initialization
Specifically, specify that each initialization should be done on a
separate line.
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r-- | src/nvim/ex_cmds.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 96429c96f7..a0e9b537e8 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -618,7 +618,8 @@ void ex_sort(exarg_T *eap) goto sortend; } - bcount_t old_count = 0, new_count = 0; + bcount_t old_count = 0; + bcount_t new_count = 0; // Insert the lines in the sorted order below the last one. linenr_T lnum = eap->line2; @@ -3303,7 +3304,8 @@ static int do_sub(exarg_T *eap, const proftime_T timeout, const int cmdpreview_n .do_number = false, .do_ic = kSubHonorOptions }; - char *pat = NULL, *sub = NULL; // init for GCC + char *pat = NULL; + char *sub = NULL; // init for GCC int delimiter; bool has_second_delim = false; int sublen; @@ -3501,7 +3503,8 @@ static int do_sub(exarg_T *eap, const proftime_T timeout, const int cmdpreview_n colnr_T copycol; colnr_T matchcol; colnr_T prev_matchcol = MAXCOL; - char *new_end, *new_start = NULL; + char *new_end; + char *new_start = NULL; int new_start_len = 0; char *p1; bool did_sub = false; @@ -3971,7 +3974,8 @@ static int do_sub(exarg_T *eap, const proftime_T timeout, const int cmdpreview_n // TODO(bfredl): this has some robustness issues, look into later. bcount_t replaced_bytes = 0; - lpos_T start = regmatch.startpos[0], end = regmatch.endpos[0]; + lpos_T start = regmatch.startpos[0]; + lpos_T end = regmatch.endpos[0]; for (i = 0; i < nmatch - 1; i++) { replaced_bytes += (bcount_t)strlen(ml_get((linenr_T)(lnum_start + i))) + 1; } |