0
0
mirror of https://github.com/vim/vim.git synced 2025-10-02 05:04:20 -04:00

patch 8.2.1247: Vim9: cannot index a character in a string

Problem:    Vim9: cannot index a character in a string.
Solution:   Add ISN_STRINDEX instruction. (closes #6478)
This commit is contained in:
Bram Moolenaar
2020-07-19 17:55:44 +02:00
parent b209750b5e
commit bf9d8c3765
5 changed files with 63 additions and 5 deletions

View File

@@ -1509,6 +1509,15 @@ def Test_expr7_trailing()
assert_equal(123, d.key)
enddef
def Test_expr7_subscript()
let text = 'abcdef'
assert_equal('', text[-1])
assert_equal('a', text[0])
assert_equal('e', text[4])
assert_equal('f', text[5])
assert_equal('', text[6])
enddef
def Test_expr7_subscript_linebreak()
let range = range(
3)