comparison src/testdir/test_textprop.vim @ 23072:4b398a229b0b v8.2.2082

patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax Commit: https://github.com/vim/vim/commit/e0de171ecd2ff7acd56deda2cf81f0d13a69c803 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Dec 2 17:36:54 2020 +0100 patch 8.2.2082: Vim9: can still use the depricated #{} dict syntax Problem: Vim9: can still use the depricated #{} dict syntax. Solution: Remove support for #{} in Vim9 script. (closes https://github.com/vim/vim/issues/7406, closes https://github.com/vim/vim/issues/7405)
author Bram Moolenaar <Bram@vim.org>
date Wed, 02 Dec 2020 17:45:05 +0100
parents 166a0f17b05e
children 90ea5037a7e3
comparison
equal deleted inserted replaced
23071:20dac5998fa6 23072:4b398a229b0b
217 217
218 def Test_prop_find2() 218 def Test_prop_find2()
219 # Multiple props per line, start on the first, should find the second. 219 # Multiple props per line, start on the first, should find the second.
220 new 220 new
221 ['the quikc bronw fox jumsp over the layz dog']->repeat(2)->setline(1) 221 ['the quikc bronw fox jumsp over the layz dog']->repeat(2)->setline(1)
222 prop_type_add('misspell', #{highlight: 'ErrorMsg'}) 222 prop_type_add('misspell', {highlight: 'ErrorMsg'})
223 for lnum in [1, 2] 223 for lnum in [1, 2]
224 for col in [8, 14, 24, 38] 224 for col in [8, 14, 24, 38]
225 prop_add(lnum, col, #{type: 'misspell', length: 2}) 225 prop_add(lnum, col, {type: 'misspell', length: 2})
226 endfor 226 endfor
227 endfor 227 endfor
228 cursor(1, 8) 228 cursor(1, 8)
229 var expected = {'lnum': 1, 'id': 0, 'col': 14, 'end': 1, 'type': 'misspell', 'length': 2, 'start': 1} 229 var expected = {lnum: 1, id: 0, col: 14, end: 1, type: 'misspell', length: 2, start: 1}
230 var result = prop_find(#{type: 'misspell', skipstart: true}, 'f') 230 var result = prop_find({type: 'misspell', skipstart: true}, 'f')
231 assert_equal(expected, result) 231 assert_equal(expected, result)
232 232
233 prop_type_delete('misspell') 233 prop_type_delete('misspell')
234 bwipe! 234 bwipe!
235 enddef 235 enddef
320 call DeletePropTypes() 320 call DeletePropTypes()
321 bwipe! 321 bwipe!
322 endfunc 322 endfunc
323 323
324 def Test_prop_add_vim9() 324 def Test_prop_add_vim9()
325 prop_type_add('comment', #{ 325 prop_type_add('comment', {
326 highlight: 'Directory', 326 highlight: 'Directory',
327 priority: 123, 327 priority: 123,
328 start_incl: true, 328 start_incl: true,
329 end_incl: true, 329 end_incl: true,
330 combine: false, 330 combine: false,
334 334
335 def Test_prop_remove_vim9() 335 def Test_prop_remove_vim9()
336 new 336 new
337 AddPropTypes() 337 AddPropTypes()
338 SetupPropsInFirstLine() 338 SetupPropsInFirstLine()
339 assert_equal(1, prop_remove({'type': 'three', 'id': 13, 'both': true, 'all': true})) 339 assert_equal(1, prop_remove({type: 'three', id: 13, both: true, all: true}))
340 DeletePropTypes() 340 DeletePropTypes()
341 bwipe! 341 bwipe!
342 enddef 342 enddef
343 343
344 func SetupOneLine() 344 func SetupOneLine()