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)
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim
index e298866..a2ba477 100644
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -1958,4 +1958,37 @@
bwipe!
endfunc
+func Test_prop_insert_multiline()
+ new
+ call AddPropTypes()
+
+ call setline(1, ['foobar', 'barbaz'])
+ call prop_add(1, 4, #{end_lnum: 2, end_col: 4, type: 'one'})
+
+ call feedkeys("1Goquxqux\<Esc>", 'nxt')
+ call feedkeys("2GOquxqux\<Esc>", 'nxt')
+
+ let lines =<< trim END
+ foobar
+ quxqux
+ quxqux
+ barbaz
+ END
+ call assert_equal(lines, getline(1, '$'))
+ let expected = [
+ \ {'lnum': 1, 'id': 0, 'col': 4, 'type_bufnr': 0, 'end': 0, 'type': 'one',
+ \ 'length': 4 ,'start': 1},
+ \ {'lnum': 2, 'id': 0, 'col': 1, 'type_bufnr': 0, 'end': 0, 'type': 'one',
+ \ 'length': 7, 'start': 0},
+ \ {'lnum': 3, 'id': 0, 'col': 1, 'type_bufnr': 0, 'end': 0, 'type': 'one',
+ \ 'length': 7, 'start': 0},
+ \ {'lnum': 4, 'id': 0, 'col': 1, 'type_bufnr': 0, 'end': 1, 'type': 'one',
+ \ 'length': 3, 'start': 0}
+ \ ]
+ call assert_equal(expected, prop_list(1, #{end_lnum: 10}))
+
+ call DeletePropTypes()
+ bwipe!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab