aboutsummaryrefslogtreecommitdiff
path: root/src/ops.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ops.c')
-rw-r--r--src/ops.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ops.c b/src/ops.c
index 06ce1b0ba9..b26923a728 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -3528,6 +3528,11 @@ int do_join(long count, int insert_space, int save_undo, int use_formatoptions)
*/
for (t = 0; t < count; ++t) {
curr = curr_start = ml_get((linenr_T)(curwin->w_cursor.lnum + t));
+ if (t == 0) {
+ // Set the '[ mark.
+ curwin->w_buffer->b_op_start.lnum = curwin->w_cursor.lnum;
+ curwin->w_buffer->b_op_start.col = (colnr_T)STRLEN(curr);
+ }
if (remove_comments) {
/* We don't want to remove the comment leader if the
* previous line is not a comment. */
@@ -3623,6 +3628,10 @@ int do_join(long count, int insert_space, int save_undo, int use_formatoptions)
}
ml_replace(curwin->w_cursor.lnum, newp, FALSE);
+ // Set the '] mark.
+ curwin->w_buffer->b_op_end.lnum = curwin->w_cursor.lnum;
+ curwin->w_buffer->b_op_end.col = (colnr_T)STRLEN(newp);
+
/* Only report the change in the first line here, del_lines() will report
* the deleted line. */
changed_lines(curwin->w_cursor.lnum, currsize,