diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-08-28 16:39:22 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-08-28 16:39:22 +0100 |
commit | c8bf59e9b27f9d621818ffc61468abef45cedf37 (patch) | |
tree | b6fd429cf210b44096b647b6cd6c04dbfcedc6da /src/charset.c | |
parent | 35a4fbc5d04820d9b08e7da2e295a7e8210e2e2c (diff) |
patch 9.0.0297: cursor position wrong after right aligned virtual textv9.0.0297
Problem: Cursor position wrong after right aligned virtual text. (Iizuka
Masashi)
Solution: Take the width of the column offset into account. (closes #10997)
Also fix virtual text positioning.
Diffstat (limited to 'src/charset.c')
-rw-r--r-- | src/charset.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/charset.c b/src/charset.c index 299de54779..b26ebb96c7 100644 --- a/src/charset.c +++ b/src/charset.c @@ -1187,7 +1187,8 @@ win_lbr_chartabsize( for (i = 0; i < cts->cts_text_prop_count; ++i) { - textprop_T *tp = cts->cts_text_props + i; + textprop_T *tp = cts->cts_text_props + i; + int col_off = win_col_off(wp); // Watch out for the text being deleted. "cts_text_props" is a // copy, the text prop may actually have been removed from the line. @@ -1209,7 +1210,7 @@ win_lbr_chartabsize( int n_extra = (int)STRLEN(p); cells = text_prop_position(wp, tp, - (vcol + size) % wp->w_width, + (vcol + size) % (wp->w_width - col_off) + col_off, &n_extra, &p, NULL, NULL); #ifdef FEAT_LINEBREAK no_sbr = TRUE; // don't use 'showbreak' now |