0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.1.0722: cannot build without the virtualedit feature

Problem:    Cannot build without the virtualedit feature.
Solution:   Make getviscol2() always available.
This commit is contained in:
Bram Moolenaar
2019-01-11 16:16:01 +01:00
parent 429ab1761e
commit 977239ef52
4 changed files with 33 additions and 19 deletions

View File

@@ -47,22 +47,6 @@ getviscol(void)
return (int)x;
}
/*
* 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.
@@ -85,6 +69,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.