Mercurial > vim
comparison src/edit.c @ 28269:20b28fbf7f03 v8.2.4660
patch 8.2.4660: cursorcolumn is sometimes not correct
Commit: https://github.com/vim/vim/commit/782c6744b49b30d9460ed00d4773666e42e07163
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Apr 1 12:06:31 2022 +0100
patch 8.2.4660: cursorcolumn is sometimes not correct
Problem: Cursorcolumn is sometimes not correct.
Solution: Recompute the cursor column when entering Insert mode and the
cursor is on a character wider than a screen cell.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 01 Apr 2022 13:15:08 +0200 |
parents | c99005ffa8c3 |
children | a9a56b567709 |
comparison
equal
deleted
inserted
replaced
28268:ec433fec31a6 | 28269:20b28fbf7f03 |
---|---|
291 // Check if the cursor line needs redrawing after changing State. If | 291 // Check if the cursor line needs redrawing after changing State. If |
292 // 'concealcursor' is "n" it needs to be redrawn without concealing. | 292 // 'concealcursor' is "n" it needs to be redrawn without concealing. |
293 conceal_check_cursor_line(cursor_line_was_concealed); | 293 conceal_check_cursor_line(cursor_line_was_concealed); |
294 #endif | 294 #endif |
295 | 295 |
296 /* | 296 // Need to recompute the cursor position, it might move when the cursor |
297 * Need to recompute the cursor position, it might move when the cursor is | 297 // is on a TAB or special character. |
298 * on a TAB or special character. | 298 // ptr2cells() treats a TAB character as double-width. |
299 */ | 299 if (ptr2cells(ml_get_cursor()) > 1) |
300 curs_columns(TRUE); | 300 { |
301 curwin->w_valid &= ~VALID_VIRTCOL; | |
302 curs_columns(TRUE); | |
303 } | |
301 | 304 |
302 /* | 305 /* |
303 * Enable langmap or IME, indicated by 'iminsert'. | 306 * Enable langmap or IME, indicated by 'iminsert'. |
304 * Note that IME may enabled/disabled without us noticing here, thus the | 307 * Note that IME may enabled/disabled without us noticing here, thus the |
305 * 'iminsert' value may not reflect what is actually used. It is updated | 308 * 'iminsert' value may not reflect what is actually used. It is updated |