summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-01-11 16:16:01 +0100
committerBram Moolenaar <Bram@vim.org>2019-01-11 16:16:01 +0100
commit977239ef52763b6e640ac632c53a57ee17e05eaa (patch)
tree1f79b94833156537d23ae874ee720027385aa5cb /src
parent429ab1761ea9123777c9540ddb35ffa497a7e349 (diff)
patch 8.1.0722: cannot build without the virtualedit featurev8.1.0722
Problem: Cannot build without the virtualedit feature. Solution: Make getviscol2() always available.
Diffstat (limited to 'src')
-rw-r--r--src/misc2.c34
-rw-r--r--src/ops.c14
-rw-r--r--src/proto/misc2.pro2
-rw-r--r--src/version.c2
4 files changed, 33 insertions, 19 deletions
diff --git a/src/misc2.c b/src/misc2.c
index 07bdf85f85..2d39eb8b4d 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -48,22 +48,6 @@ getviscol(void)
}
/*
- * Get the screen position of character col with a coladd in the cursor line.
- */
- int
-getviscol2(colnr_T col, colnr_T coladd)
-{
- colnr_T x;
- pos_T pos;
-
- pos.lnum = curwin->w_cursor.lnum;
- pos.col = col;
- pos.coladd = coladd;
- getvvcol(curwin, &pos, &x, NULL, NULL);
- return (int)x;
-}
-
-/*
* Go to column "wcol", and add/insert white space as necessary to get the
* cursor in that column.
* The caller must have saved the cursor line for undo!
@@ -86,6 +70,24 @@ coladvance_force(colnr_T wcol)
#endif
/*
+ * Get the screen position of character col with a coladd in the cursor line.
+ */
+ int
+getviscol2(colnr_T col, colnr_T coladd)
+{
+ colnr_T x;
+ pos_T pos;
+
+ pos.lnum = curwin->w_cursor.lnum;
+ pos.col = col;
+#ifdef FEAT_VIRTUALEDIT
+ pos.coladd = coladd;
+#endif
+ getvvcol(curwin, &pos, &x, NULL, NULL);
+ return (int)x;
+}
+
+/*
* Try to advance the Cursor to the specified screen column.
* If virtual editing: fine tune the cursor position.
* Note that all virtual positions off the end of a line should share
diff --git a/src/ops.c b/src/ops.c
index e3df9b3a60..f836e89fb4 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -2754,7 +2754,12 @@ op_insert(oparg_T *oap, long count1)
)
{
int t = getviscol2(curbuf->b_op_start_orig.col,
- curbuf->b_op_start_orig.coladd);
+#ifdef FEAT_VIRTUALEDIT
+ curbuf->b_op_start_orig.coladd
+#else
+ 0
+#endif
+ );
oap->start.col = curbuf->b_op_start_orig.col;
pre_textlen -= t - oap->start_vcol;
oap->start_vcol = t;
@@ -2771,7 +2776,12 @@ op_insert(oparg_T *oap, long count1)
)
{
int t = getviscol2(curbuf->b_op_start_orig.col,
- curbuf->b_op_start_orig.coladd);
+#ifdef FEAT_VIRTUALEDIT
+ curbuf->b_op_start_orig.coladd
+#else
+ 0
+#endif
+ );
oap->start.col = curbuf->b_op_start_orig.col;
/* reset pre_textlen to the value of OP_INSERT */
pre_textlen += bd.textlen;
diff --git a/src/proto/misc2.pro b/src/proto/misc2.pro
index 660a652be5..644fe2a70b 100644
--- a/src/proto/misc2.pro
+++ b/src/proto/misc2.pro
@@ -1,8 +1,8 @@
/* misc2.c */
int virtual_active(void);
int getviscol(void);
-int getviscol2(colnr_T col, colnr_T coladd);
int coladvance_force(colnr_T wcol);
+int getviscol2(colnr_T col, colnr_T coladd);
int coladvance(colnr_T wcol);
int getvpos(pos_T *pos, colnr_T wcol);
int inc_cursor(void);
diff --git a/src/version.c b/src/version.c
index 4b216f3d13..1c08ebe432 100644
--- a/src/version.c
+++ b/src/version.c
@@ -796,6 +796,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 722,
+/**/
721,
/**/
720,