Mercurial > vim
comparison src/screen.c @ 32865:8665cf0eab86 v9.0.1742
patch 9.0.1742: wrong curswant when clicking on second cell of double-width char
Commit: https://github.com/vim/vim/commit/9994160bfe74501886bbbf5631aec8ea2ae05991
Author: zeertzjq <zeertzjq@outlook.com>
Date: Sat Aug 19 13:08:50 2023 +0200
patch 9.0.1742: wrong curswant when clicking on second cell of double-width char
Problem: Wrong curswant when clicking and the second cell of a
double-width char.
Solution: Don't copy virtcol of the first char to the second one.
closes: #12842
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 19 Aug 2023 13:15:05 +0200 |
parents | 7c4ad06d80ec |
children | a2dfcbbfc301 |
comparison
equal
deleted
inserted
replaced
32864:4ae837db17ef | 32865:8665cf0eab86 |
---|---|
15 * that changed. | 15 * that changed. |
16 * | 16 * |
17 * ScreenLines[off] Contains a copy of the whole screen, as it is currently | 17 * ScreenLines[off] Contains a copy of the whole screen, as it is currently |
18 * displayed (excluding text written by external commands). | 18 * displayed (excluding text written by external commands). |
19 * ScreenAttrs[off] Contains the associated attributes. | 19 * ScreenAttrs[off] Contains the associated attributes. |
20 * ScreenCols[off] Contains the byte offset in the line. -1 means not | 20 * ScreenCols[off] Contains the virtual columns in the line. -1 means not |
21 * available (below last line), MAXCOL means after the end | 21 * available (below last line), MAXCOL means after the end |
22 * of the line. | 22 * of the line. |
23 * | 23 * |
24 * LineOffset[row] Contains the offset into ScreenLines*[], ScreenAttrs[] | 24 * LineOffset[row] Contains the offset into ScreenLines*[], ScreenAttrs[] |
25 * and ScreenCols[] for each line. | 25 * and ScreenCols[] for each line. |
741 screen_stop_highlight(); | 741 screen_stop_highlight(); |
742 } | 742 } |
743 | 743 |
744 ScreenCols[off_to] = ScreenCols[off_from]; | 744 ScreenCols[off_to] = ScreenCols[off_from]; |
745 if (char_cells == 2) | 745 if (char_cells == 2) |
746 ScreenCols[off_to + 1] = ScreenCols[off_from]; | 746 ScreenCols[off_to + 1] = ScreenCols[off_from + 1]; |
747 | 747 |
748 off_to += char_cells; | 748 off_to += char_cells; |
749 off_from += char_cells; | 749 off_from += char_cells; |
750 col += char_cells; | 750 col += char_cells; |
751 } | 751 } |