Mercurial > vim
diff src/testdir/test_textprop.vim @ 24703:4bc0bda6857d v8.2.2890
patch 8.2.2890: text property duplicated when data block splits
Commit: https://github.com/vim/vim/commit/840f91f110c4790a145e76eec453326445290f21
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed May 26 22:32:10 2021 +0200
patch 8.2.2890: text property duplicated when data block splits
Problem: Text property duplicated when data block splits.
Solution: Do not continue text prop from previous line. (closes https://github.com/vim/vim/issues/8261)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 26 May 2021 22:45:03 +0200 |
parents | 7422f2f719a3 |
children | 7ef7a211f6bf |
line wrap: on
line diff
--- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -1469,5 +1469,24 @@ func Test_prop_one_line_window() bwipe! endfunc +" This was calling ml_append_int() and copy a text property from a previous +" line at the wrong moment. Exact text length matters. +def Test_prop_splits_data_block() + new + var lines: list<string> = [repeat('x', 35)]->repeat(41) + + [repeat('!', 35)] + + [repeat('x', 35)]->repeat(56) + lines->setline(1) + prop_type_add('someprop', {highlight: 'ErrorMsg'}) + prop_add(1, 27, {end_lnum: 1, end_col: 70, type: 'someprop'}) + prop_remove({type: 'someprop'}, 1) + prop_add(35, 22, {end_lnum: 43, end_col: 43, type: 'someprop'}) + prop_remove({type: 'someprop'}, 35, 43) + assert_equal([], prop_list(42)) + + bwipe! + prop_type_delete('someprop') +enddef + " vim: shiftwidth=2 sts=2 expandtab