From 7ac1145fbebb66dfee325dc5265309877d941c4e Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 6 Mar 2024 20:54:22 +0100 Subject: patch 9.1.0153: Text properties corrupted with fo+=aw and backspace Problem: Text properties corrupted with fo+=aw and backspace Solution: Allocate line and move text properties (zeertzjq) closes: #14147 Signed-off-by: zeertzjq Signed-off-by: Christian Brabandt --- src/testdir/test_textprop.vim | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/testdir/test_textprop.vim') diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim index 7542c08da1..1074b0ca54 100644 --- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -4466,4 +4466,23 @@ func Test_textprop_notype_join() bwipe! endfunc +" This was causing text property corruption. +func Test_textprop_backspace_fo_aw() + new + call setline(1, 'foobar') + call prop_type_add('test', {'highlight': 'ErrorMsg'}) + call prop_add(1, 1, {'type': 'test', 'length': 3}) + set backspace=indent,eol,start + setlocal formatoptions+=aw + call feedkeys("A \\\", 'tx') + call assert_equal('foobar', getline(1)) + call assert_equal([ + \ #{id: 0, col: 1, start: 1, end: 1, type_bufnr: 0, + \ type: 'test', length: 3}], prop_list(1)) + + bwipe! + set backspace& + call prop_type_delete('test') +endfunc + " vim: shiftwidth=2 sts=2 expandtab -- cgit v1.2.3