int pos = 0;
int bit = 0;
int bits = sizeof(unsigned long) * 8;
+ pos_T startpos;
+ pos_T endpos;
dohex = (vim_strchr(curbuf->b_p_nf, 'x') != NULL); /* "heX" */
dooct = (vim_strchr(curbuf->b_p_nf, 'o') != NULL); /* "Octal" */
#endif
}
curwin->w_cursor.col = col;
+ if (!did_change)
+ startpos = curwin->w_cursor;
did_change = TRUE;
(void)del_char(FALSE);
ins_char(firstdigit);
+ endpos = curwin->w_cursor;
curwin->w_cursor.col = col;
}
else
* Delete the old number.
*/
curwin->w_cursor.col = col;
+ if (!did_change)
+ startpos = curwin->w_cursor;
did_change = TRUE;
todel = length;
c = gchar_cursor();
STRCAT(buf1, buf2);
ins_str(buf1); /* insert the new number */
vim_free(buf1);
+ endpos = curwin->w_cursor;
if (lnum < lnume)
curwin->w_cursor.col = t.col;
else if (did_change && curwin->w_cursor.col)
if (visual)
/* cursor at the top of the selection */
curwin->w_cursor = VIsual;
+ if (did_change)
+ {
+ /* set the '[ and '] marks */
+ curbuf->b_op_start = startpos;
+ curbuf->b_op_end = endpos;
+ if (curbuf->b_op_end.col > 0)
+ --curbuf->b_op_end.col;
+ }
return OK;
}
maddu\12u
:let a = string(getpos("'a"))
:$put ='Mark after delete-undo-redo-undo: '.a
-:/^\t/,$wq! test.out
+:''
ENDTEST
textline A
textline B
textline C
+STARTTEST
+:" test that CTRL-A and CTRL-X updates last changed mark '[, '].
+:/^123/
+:execute "normal! \<C-A>`[v`]rAjwvjw\<C-X>`[v`]rX"
+ENDTEST
+
+CTRL-A CTRL-X:
+123 123 123
+123 123 123
+123 123 123
+
+STARTTEST
+:g/^STARTTEST/.,/^ENDTEST/d
+:wq! test.out
+ENDTEST
+
Results: