0
0
mirror of https://github.com/vim/vim.git synced 2025-10-28 09:27:14 -04:00

updated for version 7.3.032

Problem:    maparg() doesn't return the flags, such as <buffer>, <script>,
            <silent>.  These are needed to save and restore a mapping.
Solution:   Improve maparg(). (also by Christian Brabandt)
This commit is contained in:
Bram Moolenaar
2010-10-20 21:23:33 +02:00
parent 727c876b78
commit bd74325960
11 changed files with 196 additions and 74 deletions

16
src/testdir/test75.in Normal file
View File

@@ -0,0 +1,16 @@
" Tests for functions.
STARTTEST
:so small.vim
:" Test maparg() with a string result
:map foo<C-V> is<F4>foo
:vnoremap <script> <buffer> <expr> <silent> bar isbar
:call append('$', maparg('foo<C-V>'))
:call append('$', string(maparg('foo<C-V>', '', 0, 1)))
:call append('$', string(maparg('bar', '', 0, 1)))
:"
:/^eof/+1,$w! test.out
:qa!
ENDTEST
eof

3
src/testdir/test75.ok Normal file
View File

@@ -0,0 +1,3 @@
is<F4>foo
{'silent': 0, 'noremap': 0, 'lhs': 'foo<C-V>', 'mode': ' ', 'expr': 0, 'sid': 0, 'rhs': 'is<F4>foo', 'buffer': 0}
{'silent': 1, 'noremap': 1, 'lhs': 'bar', 'mode': 'v', 'expr': 1, 'sid': 0, 'rhs': 'isbar', 'buffer': 1}