Skip to content

Commit 3712d18

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents a683bab + 1777785 commit 3712d18

5 files changed

Lines changed: 76 additions & 7 deletions

File tree

runtime/doc/eval.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4516,7 +4516,8 @@ getqflist([{what}]) *getqflist()*
45164516
If the optional {what} dictionary argument is supplied, then
45174517
returns only the items listed in {what} as a dictionary. The
45184518
following string items are supported in {what}:
4519-
nr get information for this quickfix list
4519+
nr get information for this quickfix list; zero
4520+
means the current quickfix list
45204521
title get the list title
45214522
winid get the |window-ID| (if opened)
45224523
all all of the above quickfix properties

src/quickfix.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4591,9 +4591,13 @@ get_errorlist_properties(win_T *wp, dict_T *what, dict_T *retdict)
45914591
/* Use the specified quickfix/location list */
45924592
if (di->di_tv.v_type == VAR_NUMBER)
45934593
{
4594-
qf_idx = di->di_tv.vval.v_number - 1;
4595-
if (qf_idx < 0 || qf_idx >= qi->qf_listcount)
4596-
return FAIL;
4594+
/* for zero use the current list */
4595+
if (di->di_tv.vval.v_number != 0)
4596+
{
4597+
qf_idx = di->di_tv.vval.v_number - 1;
4598+
if (qf_idx < 0 || qf_idx >= qi->qf_listcount)
4599+
return FAIL;
4600+
}
45974601
flags |= QF_GETLIST_NR;
45984602
}
45994603
else

src/testdir/test_crypt.vim

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,62 @@ endfunc
2222
func Test_head_only_3()
2323
call Common_head_only('VimCrypt~03!abc')
2424
endfunc
25+
26+
func Crypt_uncrypt(method)
27+
exe "set cryptmethod=" . a:method
28+
" If the blowfish test fails 'cryptmethod' will be 'zip' now.
29+
call assert_equal(a:method, &cryptmethod)
30+
31+
split Xtest.txt
32+
let text = ['01234567890123456789012345678901234567',
33+
\ 'line 2 foo bar blah',
34+
\ 'line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx']
35+
call setline(1, text)
36+
call feedkeys(":X\<CR>foobar\<CR>foobar\<CR>", 'xt')
37+
w!
38+
bwipe!
39+
call feedkeys(":split Xtest.txt\<CR>foobar\<CR>", 'xt')
40+
call assert_equal(text, getline(1, 3))
41+
set key= cryptmethod&
42+
bwipe!
43+
call delete('Xtest.txt')
44+
endfunc
45+
46+
func Test_crypt_zip()
47+
call Crypt_uncrypt('zip')
48+
endfunc
49+
50+
func Test_crypt_blowfish()
51+
call Crypt_uncrypt('blowfish')
52+
endfunc
53+
54+
func Test_crypt_blowfish2()
55+
call Crypt_uncrypt('blowfish2')
56+
endfunc
57+
58+
func Uncrypt_stable(method, crypted_text, key, uncrypted_text)
59+
split Xtest.txt
60+
set bin noeol key= fenc=latin1
61+
exe "set cryptmethod=" . a:method
62+
call setline(1, a:crypted_text)
63+
w!
64+
bwipe!
65+
set nobin
66+
call feedkeys(":split Xtest.txt\<CR>" . a:key . "\<CR>", 'xt')
67+
call assert_equal(a:uncrypted_text, getline(1, len(a:uncrypted_text)))
68+
bwipe!
69+
call delete('Xtest.txt')
70+
set key=
71+
endfunc
72+
73+
func Test_uncrypt_zip()
74+
call Uncrypt_stable('zip', "VimCrypt~01!\u0006\u001clV'\u00de}Mg\u00a0\u00ea\u00a3V\u00a9\u00e7\u0007E#3\u008e2U\u00e9\u0097", "foofoo", ["1234567890", "aábbccddeëff"])
75+
endfunc
76+
77+
func Test_uncrypt_blowfish()
78+
call Uncrypt_stable('blowfish', "VimCrypt~02!k)\u00be\u0017\u0097#\u0016\u00ddS\u009c\u00f5=\u00ba\u00e0\u00c8#\u00a5M\u00b4\u0086J\u00c3A\u00cd\u00a5M\u00b4\u0086!\u0080\u0015\u009b\u00f5\u000f\u00e1\u00d2\u0019\u0082\u0016\u0098\u00f7\u000d\u00da", "barbar", ["asdfasdfasdf", "0001112223333"])
79+
endfunc
80+
81+
func Test_uncrypt_blowfish2()
82+
call Uncrypt_stable('blowfish', "VimCrypt~03!\u001e\u00d1N\u00e3;\u00d3\u00c0\u00a0^C)\u0004\u00f7\u007f.\u00b6\u00abF\u000eS\u0019\u00e0\u008b6\u00d2[T\u00cb\u00a7\u0085\u00d8\u00be9\u000b\u00812\u000bQ\u00b3\u00cc@\u0097\u000f\u00df\u009a\u00adIv\u00aa.\u00d8\u00c9\u00ee\u009e`\u00bd$\u00af%\u00d0", "barburp", ["abcdefghijklmnopqrstuvwxyz", "!@#$%^&*()_+=-`~"])
83+
endfunc

src/testdir/test_quickfix.vim

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,12 +1429,10 @@ function! Test_two_windows()
14291429
laddexpr 'one.txt:3:one one one'
14301430

14311431
let loc_one = getloclist(one_id)
1432-
echo string(loc_one)
14331432
call assert_equal('Xone/a/one.txt', bufname(loc_one[1].bufnr))
14341433
call assert_equal(3, loc_one[1].lnum)
14351434

14361435
let loc_two = getloclist(two_id)
1437-
echo string(loc_two)
14381436
call assert_equal('Xtwo/a/two.txt', bufname(loc_two[1].bufnr))
14391437
call assert_equal(5, loc_two[1].lnum)
14401438

@@ -1534,6 +1532,11 @@ function Xproperty_tests(cchar)
15341532
call assert_equal('N1', g:Xgetlist({'all':1}).title)
15351533
call g:Xsetlist([], ' ', {'title' : 'N2'})
15361534
call assert_equal(qfnr + 1, g:Xgetlist({'all':1}).nr)
1535+
1536+
let res = g:Xgetlist({'nr': 0})
1537+
call assert_equal(qfnr + 1, res.nr)
1538+
call assert_equal(['nr'], keys(res))
1539+
15371540
call g:Xsetlist([], ' ', {'title' : 'N3'})
15381541
call assert_equal('N2', g:Xgetlist({'nr':2, 'title':1}).title)
15391542

@@ -1546,7 +1549,7 @@ function Xproperty_tests(cchar)
15461549
call assert_equal({}, g:Xgetlist({'abc':1}))
15471550

15481551
if a:cchar == 'l'
1549-
call assert_equal({}, getloclist(99, ['title']))
1552+
call assert_equal({}, getloclist(99, {'title': 1}))
15501553
endif
15511554
endfunction
15521555

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,8 @@ static char *(features[]) =
779779

780780
static int included_patches[] =
781781
{ /* Add new patch number below this line */
782+
/**/
783+
17,
782784
/**/
783785
16,
784786
/**/

0 commit comments

Comments
 (0)