aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_options.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-05-09 19:19:07 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-05-09 19:19:21 +0800
commitdb506d991d80eb12016564eb62b5f636e7c8c836 (patch)
tree7678419391e69208de255f1f5b28e8140c4c6a19 /src/nvim/testdir/test_options.vim
parent41ce7b07e2946bdde0061d7af5b4446efafa5089 (diff)
downloadrneovim-db506d991d80eb12016564eb62b5f636e7c8c836.tar.gz
rneovim-db506d991d80eb12016564eb62b5f636e7c8c836.tar.bz2
rneovim-db506d991d80eb12016564eb62b5f636e7c8c836.zip
vim-patch:8.2.4924: maparg() may return a string that cannot be reused
Problem: maparg() may return a string that cannot be reused. Solution: use msg_outtrans_special() instead of str2special(). (closes vim/vim#10384) https://github.com/vim/vim/commit/0519ce00394474055bd58c089ea90a19986443eb
Diffstat (limited to 'src/nvim/testdir/test_options.vim')
-rw-r--r--src/nvim/testdir/test_options.vim20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_options.vim b/src/nvim/testdir/test_options.vim
index d16d89ec2e..8f67b1732e 100644
--- a/src/nvim/testdir/test_options.vim
+++ b/src/nvim/testdir/test_options.vim
@@ -31,6 +31,26 @@ func Test_isfname()
set isfname&
endfunc
+" Test for getting the value of 'pastetoggle'
+func Test_pastetoggle()
+ " character with K_SPECIAL byte
+ let &pastetoggle = '…'
+ call assert_equal('…', &pastetoggle)
+ call assert_equal("\n pastetoggle=…", execute('set pastetoggle?'))
+
+ " modified character with K_SPECIAL byte
+ let &pastetoggle = '<M-…>'
+ call assert_equal('<M-…>', &pastetoggle)
+ call assert_equal("\n pastetoggle=<M-…>", execute('set pastetoggle?'))
+
+ " illegal bytes
+ let str = ":\x7f:\x80:\x90:\xd0:"
+ let &pastetoggle = str
+ call assert_equal(str, &pastetoggle)
+ call assert_equal("\n pastetoggle=" .. strtrans(str), execute('set pastetoggle?'))
+ unlet str
+endfunc
+
func Test_wildchar()
" Empty 'wildchar' used to access invalid memory.
call assert_fails('set wildchar=', 'E521:')