diff src/misc2.c @ 15428:eae582bfb293 v8.1.0722

patch 8.1.0722: cannot build without the virtualedit feature commit https://github.com/vim/vim/commit/977239ef52763b6e640ac632c53a57ee17e05eaa Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jan 11 16:16:01 2019 +0100 patch 8.1.0722: cannot build without the virtualedit feature Problem: Cannot build without the virtualedit feature. Solution: Make getviscol2() always available.
author Bram Moolenaar <Bram@vim.org>
date Fri, 11 Jan 2019 16:30:05 +0100
parents ba6f0f1bb9d0
children 55ccc2d353bd
line wrap: on
line diff
--- 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