diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-05-18 04:18:48 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-05-18 10:18:48 +0200 |
commit | 5625c7d8e16475b8732f0aa0238ffd6154446c09 (patch) | |
tree | 200f8bc8ffd38df4d65eddb993ca7ac4feb8ebf2 /src | |
parent | 9420a2127fbd6a7dc28ce4115da47bb56c57e235 (diff) | |
download | rneovim-5625c7d8e16475b8732f0aa0238ffd6154446c09.tar.gz rneovim-5625c7d8e16475b8732f0aa0238ffd6154446c09.tar.bz2 rneovim-5625c7d8e16475b8732f0aa0238ffd6154446c09.zip |
vim-patch:8.1.1338: fix hang when concealing wide char #10023
Problem: Hang when concealing the '>' shown for a wide char that doesn't
fit in the last cell.
Solution: Put back the pointer when the '>' is not going to be displayed.
(closes vim/vim#4377)
https://github.com/vim/vim/commit/0ebe12be86d9f79bfa833306a0302a68a0f4fc30
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/screen.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 2709ba83f3..4c830bb256 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -2171,7 +2171,6 @@ win_line ( int vcol_off = 0; ///< offset for concealed characters int did_wcol = false; int match_conc = 0; ///< cchar for match functions - int has_match_conc = 0; ///< match wants to conceal int old_boguscols = 0; # define VCOL_HLC (vcol - vcol_off) # define FIX_FOR_BOGUSCOLS \ @@ -2656,7 +2655,8 @@ win_line ( int sign_idx = 0; // Repeat for the whole displayed line. for (;; ) { - has_match_conc = 0; + int has_match_conc = 0; ///< match wants to conceal + bool did_decrement_ptr = false; // Skip this quickly when working on the text. if (draw_state != WL_LINE) { if (draw_state == WL_CMDLINE - 1 && n_extra == 0) { @@ -3229,6 +3229,7 @@ win_line ( // Put pointer back so that the character will be // displayed at the start of the next line. ptr--; + did_decrement_ptr = true; } else if (*ptr != NUL) { ptr += mb_l - 1; } @@ -3687,6 +3688,11 @@ win_line ( prev_syntax_id = 0; is_concealing = FALSE; } + + if (n_skip > 0 && did_decrement_ptr) { + // not showing the '>', put pointer back to avoid getting stuck + ptr++; + } } /* In the cursor line and we may be concealing characters: correct |