comparison src/textprop.c @ 16670:5733d8e33bce v8.1.1337

patch 8.1.1337: get empty text prop when splitting line just after text prop commit https://github.com/vim/vim/commit/5c65e6a062dfc7d20931fa1f73d03b1714a4d5e1 Author: Bram Moolenaar <Bram@vim.org> Date: Fri May 17 11:08:56 2019 +0200 patch 8.1.1337: get empty text prop when splitting line just after text prop Problem: Get empty text prop when splitting line just after text prop. Solution: Do not create an empty text prop at the start of the line.
author Bram Moolenaar <Bram@vim.org>
date Fri, 17 May 2019 11:15:06 +0200
parents 1fc9cd08cf3c
children 79c5f723bb5d
comparison
equal deleted inserted replaced
16669:e4bdd8a2b0c2 16670:5733d8e33bce
1073 if (p->tp_col + p->tp_len >= kept) 1073 if (p->tp_col + p->tp_len >= kept)
1074 p->tp_len = kept - p->tp_col; 1074 p->tp_len = kept - p->tp_col;
1075 ++prevprop.ga_len; 1075 ++prevprop.ga_len;
1076 } 1076 }
1077 1077
1078 if (prop.tp_col + prop.tp_len >= skipped && ga_grow(&nextprop, 1) == OK) 1078 // Only add the property to the next line if the length is bigger than
1079 // zero.
1080 if (prop.tp_col + prop.tp_len > skipped && ga_grow(&nextprop, 1) == OK)
1079 { 1081 {
1080 p = ((textprop_T *)nextprop.ga_data) + nextprop.ga_len; 1082 p = ((textprop_T *)nextprop.ga_data) + nextprop.ga_len;
1081 *p = prop; 1083 *p = prop;
1082 if (p->tp_col > skipped) 1084 if (p->tp_col > skipped)
1083 p->tp_col -= skipped - 1; 1085 p->tp_col -= skipped - 1;