Mercurial > vim
diff src/testdir/test_textprop.vim @ 19601:67f39cb0a49c v8.2.0357
patch 8.2.0357: cannot delete a text property matching both id and type
Commit: https://github.com/vim/vim/commit/49b79bd4888341d527c95f2aa73ed953203ce2b6
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Mar 5 21:52:55 2020 +0100
patch 8.2.0357: cannot delete a text property matching both id and type
Problem: Cannot delete a text property matching both id and type. (Axel
Forsman)
Solution: Add the "both" argument.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 05 Mar 2020 22:00:04 +0100 |
parents | 36ec10251b2b |
children | 1d493fce1fbd |
line wrap: on
line diff
--- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -270,6 +270,23 @@ func Test_prop_remove() call DeletePropTypes() bwipe! + + new + call AddPropTypes() + call SetupPropsInFirstLine() + call prop_add(1, 6, {'length': 2, 'id': 11, 'type': 'three'}) + let props = Get_expected_props() + call insert(props, {'col': 6, 'length': 2, 'id': 11, 'type': 'three', 'start': 1, 'end': 1}, 3) + call assert_equal(props, prop_list(1)) + call assert_equal(1, prop_remove({'type': 'three', 'id': 11, 'both': 1, 'all': 1}, 1)) + unlet props[3] + call assert_equal(props, prop_list(1)) + + call assert_fails("call prop_remove({'id': 11, 'both': 1})", 'E860') + call assert_fails("call prop_remove({'type': 'three', 'both': 1})", 'E860') + + call DeletePropTypes() + bwipe! endfunc func SetupOneLine()