patch 8.2.3227: 'virtualedit' can only be set globally

Problem:    'virtualedit' can only be set globally.
Solution:   Make 'virtualedit' global-local. (Gary Johnson, closes #8638)
diff --git a/src/option.c b/src/option.c
index 21d113e..182ff34 100644
--- a/src/option.c
+++ b/src/option.c
@@ -5181,6 +5181,10 @@
 	    set_chars_option((win_T *)from, &((win_T *)from)->w_p_lcs);
 	    redraw_later(NOT_VALID);
 	    break;
+	case PV_VE:
+	    clear_string_option(&buf->b_p_ve);
+	    buf->b_ve_flags = 0;
+	    break;
     }
 }
 #endif
@@ -5239,7 +5243,8 @@
 #endif
 	    case PV_BKC:  return (char_u *)&(curbuf->b_p_bkc);
 	    case PV_MENC: return (char_u *)&(curbuf->b_p_menc);
-	    case PV_LCS: return (char_u *)&(curwin->w_p_lcs);
+	    case PV_LCS:  return (char_u *)&(curwin->w_p_lcs);
+	    case PV_VE:	  return (char_u *)&(curbuf->b_p_ve);
 
 	}
 	return NULL; // "cannot happen"
@@ -5507,6 +5512,8 @@
 	case PV_VSTS:	return (char_u *)&(curbuf->b_p_vsts);
 	case PV_VTS:	return (char_u *)&(curbuf->b_p_vts);
 #endif
+	case PV_VE:	return *curbuf->b_p_ve != NUL
+				    ? (char_u *)&(curbuf->b_p_ve) : p->var;
 	default:	iemsg(_("E356: get_varp ERROR"));
     }
     // always return a valid pointer to avoid a crash!
@@ -6084,6 +6091,8 @@
 	    buf->b_p_lw = empty_option;
 #endif
 	    buf->b_p_menc = empty_option;
+	    buf->b_p_ve = empty_option;
+	    buf->b_ve_flags = 0;
 
 	    /*
 	     * Don't copy the options set by ex_help(), use the saved values,
@@ -7026,6 +7035,16 @@
     return buf->b_bkc_flags ? buf->b_bkc_flags : bkc_flags;
 }
 
+/*
+ * Get the local or global value of the 'virtualedit' flags.
+ */
+    unsigned int
+get_ve_flags(void)
+{
+    return (curbuf->b_ve_flags ? curbuf->b_ve_flags : ve_flags)
+	   & ~(VE_NONE | VE_NONEU);
+}
+
 #if defined(FEAT_LINEBREAK) || defined(PROTO)
 /*
  * Get the local or global value of 'showbreak'.