Mercurial > vim
comparison src/charset.c @ 29918:e6e0f1c39edb v9.0.0297
patch 9.0.0297: cursor position wrong after right aligned virtual text
Commit: https://github.com/vim/vim/commit/c8bf59e9b27f9d621818ffc61468abef45cedf37
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Aug 28 16:39:22 2022 +0100
patch 9.0.0297: cursor position wrong after right aligned virtual text
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 28 Aug 2022 17:45:03 +0200 |
parents | bbe62ea78aac |
children | d8560d2c1f30 |
comparison
equal
deleted
inserted
replaced
29917:a25eab5e4117 | 29918:e6e0f1c39edb |
---|---|
1185 if (wp->w_p_list && wp->w_lcs_chars.eol != NUL) | 1185 if (wp->w_p_list && wp->w_lcs_chars.eol != NUL) |
1186 ++vcol; | 1186 ++vcol; |
1187 | 1187 |
1188 for (i = 0; i < cts->cts_text_prop_count; ++i) | 1188 for (i = 0; i < cts->cts_text_prop_count; ++i) |
1189 { | 1189 { |
1190 textprop_T *tp = cts->cts_text_props + i; | 1190 textprop_T *tp = cts->cts_text_props + i; |
1191 int col_off = win_col_off(wp); | |
1191 | 1192 |
1192 // Watch out for the text being deleted. "cts_text_props" is a | 1193 // Watch out for the text being deleted. "cts_text_props" is a |
1193 // copy, the text prop may actually have been removed from the line. | 1194 // copy, the text prop may actually have been removed from the line. |
1194 if (tp->tp_id < 0 | 1195 if (tp->tp_id < 0 |
1195 && ((tp->tp_col - 1 >= col | 1196 && ((tp->tp_col - 1 >= col |
1207 if (tp->tp_col == MAXCOL) | 1208 if (tp->tp_col == MAXCOL) |
1208 { | 1209 { |
1209 int n_extra = (int)STRLEN(p); | 1210 int n_extra = (int)STRLEN(p); |
1210 | 1211 |
1211 cells = text_prop_position(wp, tp, | 1212 cells = text_prop_position(wp, tp, |
1212 (vcol + size) % wp->w_width, | 1213 (vcol + size) % (wp->w_width - col_off) + col_off, |
1213 &n_extra, &p, NULL, NULL); | 1214 &n_extra, &p, NULL, NULL); |
1214 #ifdef FEAT_LINEBREAK | 1215 #ifdef FEAT_LINEBREAK |
1215 no_sbr = TRUE; // don't use 'showbreak' now | 1216 no_sbr = TRUE; // don't use 'showbreak' now |
1216 #endif | 1217 #endif |
1217 } | 1218 } |