Mercurial > vim
comparison src/misc1.c @ 29678:fc0f93590fd4 v9.0.0179
patch 9.0.0179: cursor pos wrong with wrapping virtual text in empty line
Commit: https://github.com/vim/vim/commit/49a90792d950c51608d0459ef8699fe921070718
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Aug 9 18:25:23 2022 +0100
patch 9.0.0179: cursor pos wrong with wrapping virtual text in empty line
Problem: Cursor position wrong with wrapping virtual text in empty line.
Solution: Adjust handling of an empty line. (closes https://github.com/vim/vim/issues/10875)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 09 Aug 2022 19:30:03 +0200 |
parents | f1ed6f520d09 |
children | 89e1d67814a9 |
comparison
equal
deleted
inserted
replaced
29677:d8ad7b1e9116 | 29678:fc0f93590fd4 |
---|---|
397 plines_win_nofold(win_T *wp, linenr_T lnum) | 397 plines_win_nofold(win_T *wp, linenr_T lnum) |
398 { | 398 { |
399 char_u *s; | 399 char_u *s; |
400 long col; | 400 long col; |
401 int width; | 401 int width; |
402 chartabsize_T cts; | |
402 | 403 |
403 s = ml_get_buf(wp->w_buffer, lnum, FALSE); | 404 s = ml_get_buf(wp->w_buffer, lnum, FALSE); |
404 if (*s == NUL) // empty line | 405 init_chartabsize_arg(&cts, wp, lnum, 0, s, s); |
405 return 1; | 406 if (*s == NUL |
406 col = win_linetabsize(wp, lnum, s, (colnr_T)MAXCOL); | 407 #ifdef FEAT_PROP_POPUP |
408 && !cts.cts_has_prop_with_text | |
409 #endif | |
410 ) | |
411 return 1; // be quick for an empty line | |
412 win_linetabsize_cts(&cts, (colnr_T)MAXCOL); | |
413 clear_chartabsize_arg(&cts); | |
414 col = (int)cts.cts_vcol; | |
407 | 415 |
408 /* | 416 /* |
409 * If list mode is on, then the '$' at the end of the line may take up one | 417 * If list mode is on, then the '$' at the end of the line may take up one |
410 * extra column. | 418 * extra column. |
411 */ | 419 */ |