aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/plines.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/plines.c')
-rw-r--r--src/nvim/plines.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/nvim/plines.c b/src/nvim/plines.c
index 44b06a0403..3c1297968f 100644
--- a/src/nvim/plines.c
+++ b/src/nvim/plines.c
@@ -375,6 +375,18 @@ CharSize charsize_fast(CharsizeArg *csarg, colnr_T const vcol, int32_t const cur
return charsize_fast_impl(csarg->win, csarg->use_tabstop, vcol, cur_char);
}
+/// Get the number of cells taken up on the screen at given virtual column.
+int charsize_nowrap(buf_T *buf, bool use_tabstop, colnr_T vcol, int32_t cur_char)
+{
+ if (cur_char == TAB && use_tabstop) {
+ return tabstop_padding(vcol, buf->b_p_ts, buf->b_p_vts_array);
+ } else if (cur_char < 0) {
+ return kInvalidByteCells;
+ } else {
+ return char2cells(cur_char);
+ }
+}
+
/// Check that virtual column "vcol" is in the rightmost column of window "wp".
///
/// @param wp window