Mercurial > vim
comparison src/screen.c @ 10982:5e20c9f96cd5 v8.0.0380
patch 8.0.0380: with 'linebreak' double wide char wraps badly
commit https://github.com/vim/vim/commit/38632faf635f6434441827e136bceb5a930c59ad
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Feb 26 19:40:59 2017 +0100
patch 8.0.0380: with 'linebreak' double wide char wraps badly
Problem: With 'linebreak' set and 'breakat' includes ">" a double-wide
character results in "<<" displayed.
Solution: Check for the character not to be replaced. (Ozaki Kiichi,
closes #1456)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 26 Feb 2017 19:45:04 +0100 |
parents | 5b3e671ef6a2 |
children | 62bcadce6c82 |
comparison
equal
deleted
inserted
replaced
10981:a03c6919dfdc | 10982:5e20c9f96cd5 |
---|---|
4187 } | 4187 } |
4188 --n_extra; | 4188 --n_extra; |
4189 } | 4189 } |
4190 else | 4190 else |
4191 { | 4191 { |
4192 int c0; | |
4193 | |
4192 if (p_extra_free != NULL) | 4194 if (p_extra_free != NULL) |
4193 { | 4195 { |
4194 vim_free(p_extra_free); | 4196 vim_free(p_extra_free); |
4195 p_extra_free = NULL; | 4197 p_extra_free = NULL; |
4196 } | 4198 } |
4197 /* | 4199 /* |
4198 * Get a character from the line itself. | 4200 * Get a character from the line itself. |
4199 */ | 4201 */ |
4200 c = *ptr; | 4202 c0 = c = *ptr; |
4201 #ifdef FEAT_MBYTE | 4203 #ifdef FEAT_MBYTE |
4202 if (has_mbyte) | 4204 if (has_mbyte) |
4203 { | 4205 { |
4204 mb_c = c; | 4206 mb_c = c; |
4205 if (enc_utf8) | 4207 if (enc_utf8) |
4212 { | 4214 { |
4213 mb_c = utfc_ptr2char(ptr, u8cc); | 4215 mb_c = utfc_ptr2char(ptr, u8cc); |
4214 /* Overlong encoded ASCII or ASCII with composing char | 4216 /* Overlong encoded ASCII or ASCII with composing char |
4215 * is displayed normally, except a NUL. */ | 4217 * is displayed normally, except a NUL. */ |
4216 if (mb_c < 0x80) | 4218 if (mb_c < 0x80) |
4217 c = mb_c; | 4219 c0 = c = mb_c; |
4218 mb_utf8 = TRUE; | 4220 mb_utf8 = TRUE; |
4219 | 4221 |
4220 /* At start of the line we can have a composing char. | 4222 /* At start of the line we can have a composing char. |
4221 * Draw it as a space with a composing char. */ | 4223 * Draw it as a space with a composing char. */ |
4222 if (utf_iscomposing(mb_c)) | 4224 if (utf_iscomposing(mb_c)) |
4536 #endif | 4538 #endif |
4537 #ifdef FEAT_LINEBREAK | 4539 #ifdef FEAT_LINEBREAK |
4538 /* | 4540 /* |
4539 * Found last space before word: check for line break. | 4541 * Found last space before word: check for line break. |
4540 */ | 4542 */ |
4541 if (wp->w_p_lbr && vim_isbreak(c) && !vim_isbreak(*ptr)) | 4543 if (wp->w_p_lbr && c0 == c |
4544 && vim_isbreak(c) && !vim_isbreak(*ptr)) | |
4542 { | 4545 { |
4543 # ifdef FEAT_MBYTE | 4546 # ifdef FEAT_MBYTE |
4544 int mb_off = has_mbyte ? (*mb_head_off)(line, ptr - 1) : 0; | 4547 int mb_off = has_mbyte ? (*mb_head_off)(line, ptr - 1) : 0; |
4545 # endif | 4548 # endif |
4546 char_u *p = ptr - ( | 4549 char_u *p = ptr - ( |