summaryrefslogtreecommitdiff
path: root/src/register.c
diff options
context:
space:
mode:
authorGary Johnson <garyjohn@spocom.com>2021-07-26 22:19:10 +0200
committerBram Moolenaar <Bram@vim.org>2021-07-26 22:19:10 +0200
commit53ba05b09075f14227f9be831a22ed16f7cc26b2 (patch)
tree75d5ddb38aa9702416d73b7a7b8f158f1d0c320a /src/register.c
parent29b857150c111a455f1a38a8f748243524f692e1 (diff)
downloadvim-git-53ba05b09075f14227f9be831a22ed16f7cc26b2.tar.gz
patch 8.2.3227: 'virtualedit' can only be set globallyv8.2.3227
Problem: 'virtualedit' can only be set globally. Solution: Make 'virtualedit' global-local. (Gary Johnson, closes #8638)
Diffstat (limited to 'src/register.c')
-rw-r--r--src/register.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/register.c b/src/register.c
index 0c714c69c..161587423 100644
--- a/src/register.c
+++ b/src/register.c
@@ -1556,6 +1556,7 @@ do_put(
long cnt;
pos_T orig_start = curbuf->b_op_start;
pos_T orig_end = curbuf->b_op_end;
+ unsigned int cur_ve_flags = get_ve_flags();
#ifdef FEAT_CLIPBOARD
// Adjust register name for "unnamed" in 'clipboard'.
@@ -1742,7 +1743,7 @@ do_put(
yanklen = (int)STRLEN(y_array[0]);
- if (ve_flags == VE_ALL && y_type == MCHAR)
+ if (cur_ve_flags == VE_ALL && y_type == MCHAR)
{
if (gchar_cursor() == TAB)
{
@@ -1777,7 +1778,7 @@ do_put(
if (dir == FORWARD && c != NUL)
{
- if (ve_flags == VE_ALL)
+ if (cur_ve_flags == VE_ALL)
getvcol(curwin, &curwin->w_cursor, &col, NULL, &endcol2);
else
getvcol(curwin, &curwin->w_cursor, NULL, NULL, &col);
@@ -1786,7 +1787,7 @@ do_put(
// move to start of next multi-byte character
curwin->w_cursor.col += (*mb_ptr2len)(ml_get_cursor());
else
- if (c != TAB || ve_flags != VE_ALL)
+ if (c != TAB || cur_ve_flags != VE_ALL)
++curwin->w_cursor.col;
++col;
}
@@ -1794,7 +1795,7 @@ do_put(
getvcol(curwin, &curwin->w_cursor, &col, NULL, &endcol2);
col += curwin->w_cursor.coladd;
- if (ve_flags == VE_ALL
+ if (cur_ve_flags == VE_ALL
&& (curwin->w_cursor.coladd > 0
|| endcol2 == curwin->w_cursor.col))
{