Skip to content

Commit dfdc115

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents f02c28d + 9c4feff commit dfdc115

File tree

6 files changed

+62
-24
lines changed

6 files changed

+62
-24
lines changed

runtime/doc/eval.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7008,7 +7008,8 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()*
70087008
title quickfix list title text
70097009
Unsupported keys in {what} are ignored.
70107010
If the "nr" item is not present, then the current quickfix list
7011-
is modified.
7011+
is modified. When creating a new quickfix list, "nr" can be
7012+
set to a value one greater than the quickfix stack size.
70127013

70137014
Examples: >
70147015
:call setqflist([], 'r', {'title': 'My search'})

src/ex_cmds.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@
5151
#define BUFUNL 0x20000L /* accepts unlisted buffer too */
5252
#define ARGOPT 0x40000L /* allow "++opt=val" argument */
5353
#define SBOXOK 0x80000L /* allowed in the sandbox */
54-
#define CMDWIN 0x100000L /* allowed in cmdline window */
54+
#define CMDWIN 0x100000L /* allowed in cmdline window; when missing
55+
* disallows editing another buffer when
56+
* curbuf_lock is set */
5557
#define MODIFY 0x200000L /* forbidden in non-'modifiable' buffer */
5658
#define EXFLAGS 0x400000L /* allow flags after count in argument */
5759
#define FILES (XFILE | EXTRA) /* multiple extra files allowed */
@@ -1182,7 +1184,7 @@ EX(CMD_registers, "registers", ex_display,
11821184
EXTRA|NOTRLCOM|TRLBAR|CMDWIN,
11831185
ADDR_LINES),
11841186
EX(CMD_resize, "resize", ex_resize,
1185-
RANGE|NOTADR|TRLBAR|WORD1,
1187+
RANGE|NOTADR|TRLBAR|WORD1|CMDWIN,
11861188
ADDR_LINES),
11871189
EX(CMD_retab, "retab", ex_retab,
11881190
TRLBAR|RANGE|WHOLEFOLD|DFLALL|BANG|WORD1|CMDWIN|MODIFY,

src/quickfix.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,8 +1163,8 @@ qf_init_ext(
11631163
qffields_T fields;
11641164
#ifdef FEAT_WINDOWS
11651165
qfline_T *old_last = NULL;
1166-
int adding = FALSE;
11671166
#endif
1167+
int adding = FALSE;
11681168
static efm_T *fmt_first = NULL;
11691169
char_u *efm;
11701170
static char_u *last_efm = NULL;
@@ -1199,14 +1199,15 @@ qf_init_ext(
11991199
if (newlist || qi->qf_curlist == qi->qf_listcount)
12001200
/* make place for a new list */
12011201
qf_new_list(qi, qf_title);
1202-
#ifdef FEAT_WINDOWS
1203-
else if (qi->qf_lists[qi->qf_curlist].qf_count > 0)
1202+
else
12041203
{
12051204
/* Adding to existing list, use last entry. */
12061205
adding = TRUE;
1207-
old_last = qi->qf_lists[qi->qf_curlist].qf_last;
1208-
}
1206+
#ifdef FEAT_WINDOWS
1207+
if (qi->qf_lists[qi->qf_curlist].qf_count > 0)
1208+
old_last = qi->qf_lists[qi->qf_curlist].qf_last;
12091209
#endif
1210+
}
12101211

12111212
/* Use the local value of 'errorformat' if it's set. */
12121213
if (errorformat == p_efm && tv == NULL && *buf->b_p_efm != NUL)
@@ -4785,6 +4786,8 @@ get_errorlist_properties(win_T *wp, dict_T *what, dict_T *retdict)
47854786
(void)get_errorlist(wp, qf_idx, l);
47864787
dict_add_list(retdict, "items", l);
47874788
}
4789+
else
4790+
status = FAIL;
47884791
}
47894792

47904793
if ((status == OK) && (flags & QF_GETLIST_CONTEXT))
@@ -4795,9 +4798,12 @@ get_errorlist_properties(win_T *wp, dict_T *what, dict_T *retdict)
47954798
if (di != NULL)
47964799
{
47974800
copy_tv(qi->qf_lists[qf_idx].qf_ctx, &di->di_tv);
4798-
if (dict_add(retdict, di) == FAIL)
4801+
status = dict_add(retdict, di);
4802+
if (status == FAIL)
47994803
dictitem_free(di);
48004804
}
4805+
else
4806+
status = FAIL;
48014807
}
48024808
else
48034809
status = dict_add_nr_str(retdict, "context", 0L, (char_u *)"");
@@ -5020,6 +5026,7 @@ qf_set_properties(qf_info_T *qi, dict_T *what, int action)
50205026
if (ctx != NULL)
50215027
copy_tv(&di->di_tv, ctx);
50225028
qi->qf_lists[qf_idx].qf_ctx = ctx;
5029+
retval = OK;
50235030
}
50245031

50255032
return retval;

src/screen.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,8 @@ update_screen(int type_arg)
648648
{
649649
screenclear(); /* will reset clear_cmdline */
650650
type = NOT_VALID;
651+
/* must_redraw may be set indirectly, avoid another redraw later */
652+
must_redraw = 0;
651653
}
652654

653655
if (clear_cmdline) /* going to clear cmdline (done below) */

src/testdir/test_quickfix.vim

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1720,7 +1720,8 @@ func Xproperty_tests(cchar)
17201720
Xopen
17211721
wincmd p
17221722
call g:Xsetlist([{'filename':'foo', 'lnum':27}])
1723-
call g:Xsetlist([], 'a', {'title' : 'Sample'})
1723+
let s = g:Xsetlist([], 'a', {'title' : 'Sample'})
1724+
call assert_equal(0, s)
17241725
let d = g:Xgetlist({"title":1})
17251726
call assert_equal('Sample', d.title)
17261727

@@ -1774,7 +1775,8 @@ func Xproperty_tests(cchar)
17741775
endif
17751776

17761777
" Context related tests
1777-
call g:Xsetlist([], 'a', {'context':[1,2,3]})
1778+
let s = g:Xsetlist([], 'a', {'context':[1,2,3]})
1779+
call assert_equal(0, s)
17781780
call test_garbagecollect_now()
17791781
let d = g:Xgetlist({'context':1})
17801782
call assert_equal([1,2,3], d.context)
@@ -1839,8 +1841,9 @@ func Xproperty_tests(cchar)
18391841
" Test for setting/getting items
18401842
Xexpr ""
18411843
let qfprev = g:Xgetlist({'nr':0})
1842-
call g:Xsetlist([], ' ', {'title':'Green',
1844+
let s = g:Xsetlist([], ' ', {'title':'Green',
18431845
\ 'items' : [{'filename':'F1', 'lnum':10}]})
1846+
call assert_equal(0, s)
18441847
let qfcur = g:Xgetlist({'nr':0})
18451848
call assert_true(qfcur.nr == qfprev.nr + 1)
18461849
let l = g:Xgetlist({'items':1})
@@ -2187,18 +2190,6 @@ func Test_bufoverflow()
21872190
set efm&vim
21882191
endfunc
21892192

2190-
func Test_cclose_from_copen()
2191-
augroup QF_Test
2192-
au!
2193-
au FileType qf :call assert_fails(':cclose', 'E788')
2194-
augroup END
2195-
copen
2196-
augroup QF_Test
2197-
au!
2198-
augroup END
2199-
augroup! QF_Test
2200-
endfunc
2201-
22022193
" Tests for getting the quickfix stack size
22032194
func XsizeTests(cchar)
22042195
call s:setup_commands(a:cchar)
@@ -2228,6 +2219,18 @@ func Test_Qf_Size()
22282219
call XsizeTests('l')
22292220
endfunc
22302221

2222+
func Test_cclose_from_copen()
2223+
augroup QF_Test
2224+
au!
2225+
au FileType qf :call assert_fails(':cclose', 'E788')
2226+
augroup END
2227+
copen
2228+
augroup QF_Test
2229+
au!
2230+
augroup END
2231+
augroup! QF_Test
2232+
endfunc
2233+
22312234
func Test_cclose_in_autocmd()
22322235
" Problem is only triggered if "starting" is zero, so that the OptionsSet
22332236
" event will be triggered.
@@ -2243,3 +2246,20 @@ func Test_cclose_in_autocmd()
22432246
augroup! QF_Test
22442247
call test_override('starting', 0)
22452248
endfunc
2249+
2250+
func Test_resize_from_copen()
2251+
augroup QF_Test
2252+
au!
2253+
au FileType qf resize 5
2254+
augroup END
2255+
try
2256+
" This should succeed without any exception. No other buffers are
2257+
" involved in the autocmd.
2258+
copen
2259+
finally
2260+
augroup QF_Test
2261+
au!
2262+
augroup END
2263+
augroup! QF_Test
2264+
endtry
2265+
endfunc

src/version.c

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

780780
static int included_patches[] =
781781
{ /* Add new patch number below this line */
782+
/**/
783+
688,
784+
/**/
785+
687,
786+
/**/
787+
686,
782788
/**/
783789
685,
784790
/**/

0 commit comments

Comments
 (0)