summaryrefslogtreecommitdiffstats
path: root/src/register.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/register.c')
-rw-r--r--src/register.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/register.c b/src/register.c
index f381e303be..8a4ae67489 100644
--- a/src/register.c
+++ b/src/register.c
@@ -832,8 +832,9 @@ insert_reg(
if ((State & REPLACE_FLAG) != 0)
{
pos_T curpos;
- u_save_cursor();
- del_bytes((long)STRLEN(y_current->y_array[0]), TRUE, FALSE);
+ if (u_save_cursor() == FAIL)
+ return FAIL;
+ del_chars((long)mb_charlen(y_current->y_array[0]), TRUE);
curpos = curwin->w_cursor;
if (oneright() == FAIL)
// hit end of line, need to put forward (after the current position)