mirror of
https://github.com/neovim/neovim.git
synced 2026-08-27 17:41:48 +00:00
vim-patch:8.2.3332: Vim9: cannot assign to range in list
Problem: Vim9: cannot assign to range in list.
Solution: Implement overwriting a list range.
4f0884d6e2
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -178,11 +178,14 @@ endfunc
|
||||
|
||||
" test for range assign
|
||||
func Test_list_range_assign()
|
||||
let l = [0]
|
||||
let l[:] = [1, 2]
|
||||
call assert_equal([1, 2], l)
|
||||
let l[-4:-1] = [5, 6]
|
||||
call assert_equal([5, 6], l)
|
||||
let lines =<< trim END
|
||||
VAR l = [0]
|
||||
LET l[:] = [1, 2]
|
||||
call assert_equal([1, 2], l)
|
||||
LET l[-4 : -1] = [5, 6]
|
||||
call assert_equal([5, 6], l)
|
||||
END
|
||||
call CheckLegacyAndVim9Success(lines)
|
||||
endfunc
|
||||
|
||||
" Test removing items in list
|
||||
|
||||
Reference in New Issue
Block a user