0
0
mirror of https://github.com/vim/vim.git synced 2025-09-28 04:24:06 -04:00

patch 8.2.4954: inserting line breaks text property spanning two lines

Problem:    Inserting line breaks text property spanning more then one line.
Solution:   Check TP_FLAG_CONT_PREV and TP_FLAG_CONT_NEXT. (closes #10423)
This commit is contained in:
LemonBoy
2022-05-14 18:10:15 +01:00
committed by Bram Moolenaar
parent 30ab04e16e
commit 698cb4c8fa
3 changed files with 40 additions and 4 deletions

View File

@@ -1650,11 +1650,12 @@ adjust_prop(
proptype_T *pt = text_prop_type_by_id(curbuf, prop->tp_type);
int start_incl = (pt != NULL
&& (pt->pt_flags & PT_FLAG_INS_START_INCL))
|| (flags & APC_SUBSTITUTE);
|| (flags & APC_SUBSTITUTE)
|| (prop->tp_flags & TP_FLAG_CONT_PREV);
int end_incl = (pt != NULL
&& (pt->pt_flags & PT_FLAG_INS_END_INCL));
// Do not drop zero-width props if they later can increase in
// size.
&& (pt->pt_flags & PT_FLAG_INS_END_INCL))
|| (prop->tp_flags & TP_FLAG_CONT_NEXT);
// Do not drop zero-width props if they later can increase in size.
int droppable = !(start_incl || end_incl);
adjustres_T res = {TRUE, FALSE};