diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-08-13 18:11:05 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2023-08-13 18:11:05 +0200 |
commit | b25dbb3f9b5885dd623af7a9fae890b8366b64e2 (patch) | |
tree | d1b67af593d51987e18130857895d4537e580075 /src/drawline.c | |
parent | 0c6181fec4c362eb9682d5af583341eb20cb1af5 (diff) |
patch 9.0.1705: cursor position wrong when clicking on an unprintable charv9.0.1705
Problem: cursor position wrong when clicking on an unprintable char
Solution: Don't update prev_ptr when wlv.n_extra is not zero.
closes: #12664
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Diffstat (limited to 'src/drawline.c')
-rw-r--r-- | src/drawline.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/drawline.c b/src/drawline.c index 9d6ee8d8db..ef9f663715 100644 --- a/src/drawline.c +++ b/src/drawline.c @@ -1829,10 +1829,10 @@ win_line( win_line_start(wp, &wlv, FALSE); + char_u *prev_ptr = ptr; // Repeat for the whole displayed line. for (;;) { - char_u *prev_ptr = ptr; #if defined(FEAT_CONCEAL) || defined(FEAT_SEARCH_EXTRA) int has_match_conc = 0; // match wants to conceal #endif @@ -2261,9 +2261,9 @@ win_line( } #endif -#ifdef FEAT_SEARCH_EXTRA if (wlv.n_extra == 0) { +#ifdef FEAT_SEARCH_EXTRA // Check for start/end of 'hlsearch' and other matches. // After end, check for start/end of next match. // When another match, have to check for start again. @@ -2273,15 +2273,16 @@ win_line( &match_conc, did_line_attr, lcs_eol_one, &on_last_col); ptr = line + v; // "line" may have been changed - prev_ptr = ptr; // Do not allow a conceal over EOL otherwise EOL will be missed // and bad things happen. if (*ptr == NUL) has_match_conc = 0; - } #endif + prev_ptr = ptr; + } + #ifdef FEAT_DIFF if (wlv.diff_hlf != (hlf_T)0) { |