aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ops.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-11-13 18:18:04 +0800
committerGitHub <noreply@github.com>2023-11-13 18:18:04 +0800
commite9bfbe99cd7154912ef00fb1144411ee5d173b28 (patch)
tree9d799ab5f0b2669d00ae880b8c9afb74cd981898 /src/nvim/ops.c
parentcbad7f8c21abae1f8aeacee0d171f0eca8790564 (diff)
downloadrneovim-e9bfbe99cd7154912ef00fb1144411ee5d173b28.tar.gz
rneovim-e9bfbe99cd7154912ef00fb1144411ee5d173b28.tar.bz2
rneovim-e9bfbe99cd7154912ef00fb1144411ee5d173b28.zip
fix(textformat): remove unnecessary changed_bytes() (#26027)
This was removed from Vim in patch 8.1.0681.
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r--src/nvim/ops.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index bcaad27040..db59c2c98e 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -1569,7 +1569,7 @@ int op_delete(oparg_T *oap)
curwin->w_cursor.coladd = 0;
}
- // n == number of chars deleted
+ // "n" == number of chars deleted
// If we delete a TAB, it may be replaced by several characters.
// Thus the number of characters may increase!
n = bd.textlen - bd.startspaces - bd.endspaces;
@@ -4025,8 +4025,9 @@ int do_join(size_t count, int insert_space, int save_undo, int use_formatoptions
comments = xcalloc(count, sizeof(*comments));
}
- // Don't move anything, just compute the final line length
+ // Don't move anything yet, just compute the final line length
// and setup the array of space strings lengths
+ // This loops forward over joined lines.
for (t = 0; t < (linenr_T)count; t++) {
curr_start = ml_get(curwin->w_cursor.lnum + t);
curr = curr_start;
@@ -4107,6 +4108,7 @@ int do_join(size_t count, int insert_space, int save_undo, int use_formatoptions
*cend = 0;
// Move affected lines to the new long one.
+ // This loops backwards over the joined lines, including the original line.
//
// Move marks from each deleted line to the joined line, adjusting the
// column. This is not Vi compatible, but Vi deletes the marks, thus that