Mercurial > vim
comparison src/testdir/test_functions.vim @ 21935:62f933f64447 v8.2.1517
patch 8.2.1517: cannot easily get the character under the cursor
Commit: https://github.com/vim/vim/commit/6c53fca02301ff871cddc1c74c388e23e53a424a
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Aug 23 17:34:46 2020 +0200
patch 8.2.1517: cannot easily get the character under the cursor
Problem: Cannot easily get the character under the cursor.
Solution: Add the {chars} argument to strpart().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 23 Aug 2020 17:45:03 +0200 |
parents | 0c0e8cd8c177 |
children | 85add08e6a2d |
comparison
equal
deleted
inserted
replaced
21934:520a6af17d92 | 21935:62f933f64447 |
---|---|
511 call assert_equal('', strpart('abcdefg', 10)) | 511 call assert_equal('', strpart('abcdefg', 10)) |
512 call assert_fails("let s=strpart('abcdef', [])", 'E745:') | 512 call assert_fails("let s=strpart('abcdef', [])", 'E745:') |
513 | 513 |
514 call assert_equal('lép', strpart('éléphant', 2, 4)) | 514 call assert_equal('lép', strpart('éléphant', 2, 4)) |
515 call assert_equal('léphant', strpart('éléphant', 2)) | 515 call assert_equal('léphant', strpart('éléphant', 2)) |
516 | |
517 call assert_equal('é', strpart('éléphant', 0, 1, 1)) | |
518 call assert_equal('ép', strpart('éléphant', 3, 2, v:true)) | |
519 call assert_equal('ó', strpart('cómposed', 1, 1, 1)) | |
516 endfunc | 520 endfunc |
517 | 521 |
518 func Test_tolower() | 522 func Test_tolower() |
519 call assert_equal("", tolower("")) | 523 call assert_equal("", tolower("")) |
520 | 524 |