forked from aniani/vim
patch 8.0.0574: get only one quickfix list after :caddbuf
Problem: Get only one quickfix list after :caddbuf. Solution: Reset qf_multiline. (Yegappan Lakshmanan)
This commit is contained in:
parent
91b6e4591a
commit
99895eac1c
@ -2750,12 +2750,18 @@ qf_free(qf_info_T *qi, int idx)
|
|||||||
vim_free(qi->qf_lists[idx].qf_title);
|
vim_free(qi->qf_lists[idx].qf_title);
|
||||||
qi->qf_lists[idx].qf_title = NULL;
|
qi->qf_lists[idx].qf_title = NULL;
|
||||||
qi->qf_lists[idx].qf_index = 0;
|
qi->qf_lists[idx].qf_index = 0;
|
||||||
|
qi->qf_lists[idx].qf_start = NULL;
|
||||||
qi->qf_lists[idx].qf_last = NULL;
|
qi->qf_lists[idx].qf_last = NULL;
|
||||||
|
qi->qf_lists[idx].qf_ptr = NULL;
|
||||||
|
qi->qf_lists[idx].qf_nonevalid = TRUE;
|
||||||
|
|
||||||
qf_clean_dir_stack(&qi->qf_dir_stack);
|
qf_clean_dir_stack(&qi->qf_dir_stack);
|
||||||
qi->qf_directory = NULL;
|
qi->qf_directory = NULL;
|
||||||
qf_clean_dir_stack(&qi->qf_file_stack);
|
qf_clean_dir_stack(&qi->qf_file_stack);
|
||||||
qi->qf_currfile = NULL;
|
qi->qf_currfile = NULL;
|
||||||
|
qi->qf_multiline = FALSE;
|
||||||
|
qi->qf_multiignore = FALSE;
|
||||||
|
qi->qf_multiscan = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -4923,6 +4929,7 @@ qf_free_stack(win_T *wp, qf_info_T *qi)
|
|||||||
/* If the location list window is open, then create a new empty
|
/* If the location list window is open, then create a new empty
|
||||||
* location list */
|
* location list */
|
||||||
qf_info_T *new_ll = ll_new_list();
|
qf_info_T *new_ll = ll_new_list();
|
||||||
|
|
||||||
orig_wp->w_llist_ref = new_ll;
|
orig_wp->w_llist_ref = new_ll;
|
||||||
if (llwin != NULL)
|
if (llwin != NULL)
|
||||||
{
|
{
|
||||||
|
@ -24,8 +24,8 @@ func s:setup_commands(cchar)
|
|||||||
command! -nargs=* Xgetbuffer <mods>cgetbuffer <args>
|
command! -nargs=* Xgetbuffer <mods>cgetbuffer <args>
|
||||||
command! -nargs=* Xaddbuffer <mods>caddbuffer <args>
|
command! -nargs=* Xaddbuffer <mods>caddbuffer <args>
|
||||||
command! -nargs=* Xrewind <mods>crewind <args>
|
command! -nargs=* Xrewind <mods>crewind <args>
|
||||||
command! -nargs=* -bang Xnext <mods>cnext<bang> <args>
|
command! -count -nargs=* -bang Xnext <mods><count>cnext<bang> <args>
|
||||||
command! -nargs=* -bang Xprev <mods>cprev<bang> <args>
|
command! -count -nargs=* -bang Xprev <mods><count>cprev<bang> <args>
|
||||||
command! -nargs=* -bang Xfirst <mods>cfirst<bang> <args>
|
command! -nargs=* -bang Xfirst <mods>cfirst<bang> <args>
|
||||||
command! -nargs=* -bang Xlast <mods>clast<bang> <args>
|
command! -nargs=* -bang Xlast <mods>clast<bang> <args>
|
||||||
command! -nargs=* -bang Xnfile <mods>cnfile<bang> <args>
|
command! -nargs=* -bang Xnfile <mods>cnfile<bang> <args>
|
||||||
@ -56,8 +56,8 @@ func s:setup_commands(cchar)
|
|||||||
command! -nargs=* Xgetbuffer <mods>lgetbuffer <args>
|
command! -nargs=* Xgetbuffer <mods>lgetbuffer <args>
|
||||||
command! -nargs=* Xaddbuffer <mods>laddbuffer <args>
|
command! -nargs=* Xaddbuffer <mods>laddbuffer <args>
|
||||||
command! -nargs=* Xrewind <mods>lrewind <args>
|
command! -nargs=* Xrewind <mods>lrewind <args>
|
||||||
command! -nargs=* -bang Xnext <mods>lnext<bang> <args>
|
command! -count -nargs=* -bang Xnext <mods><count>lnext<bang> <args>
|
||||||
command! -nargs=* -bang Xprev <mods>lprev<bang> <args>
|
command! -count -nargs=* -bang Xprev <mods><count>lprev<bang> <args>
|
||||||
command! -nargs=* -bang Xfirst <mods>lfirst<bang> <args>
|
command! -nargs=* -bang Xfirst <mods>lfirst<bang> <args>
|
||||||
command! -nargs=* -bang Xlast <mods>llast<bang> <args>
|
command! -nargs=* -bang Xlast <mods>llast<bang> <args>
|
||||||
command! -nargs=* -bang Xnfile <mods>lnfile<bang> <args>
|
command! -nargs=* -bang Xnfile <mods>lnfile<bang> <args>
|
||||||
@ -395,7 +395,9 @@ func Xtest_browse(cchar)
|
|||||||
Xgetexpr ['Xqftestfile1:5:Line5',
|
Xgetexpr ['Xqftestfile1:5:Line5',
|
||||||
\ 'Xqftestfile1:6:Line6',
|
\ 'Xqftestfile1:6:Line6',
|
||||||
\ 'Xqftestfile2:10:Line10',
|
\ 'Xqftestfile2:10:Line10',
|
||||||
\ 'Xqftestfile2:11:Line11']
|
\ 'Xqftestfile2:11:Line11',
|
||||||
|
\ 'RegularLine1',
|
||||||
|
\ 'RegularLine2']
|
||||||
|
|
||||||
Xfirst
|
Xfirst
|
||||||
call assert_fails('Xprev', 'E553')
|
call assert_fails('Xprev', 'E553')
|
||||||
@ -407,6 +409,7 @@ func Xtest_browse(cchar)
|
|||||||
call assert_equal('Xqftestfile1', bufname('%'))
|
call assert_equal('Xqftestfile1', bufname('%'))
|
||||||
call assert_equal(6, line('.'))
|
call assert_equal(6, line('.'))
|
||||||
Xlast
|
Xlast
|
||||||
|
Xprev
|
||||||
call assert_equal('Xqftestfile2', bufname('%'))
|
call assert_equal('Xqftestfile2', bufname('%'))
|
||||||
call assert_equal(11, line('.'))
|
call assert_equal(11, line('.'))
|
||||||
call assert_fails('Xnext', 'E553')
|
call assert_fails('Xnext', 'E553')
|
||||||
@ -415,6 +418,13 @@ func Xtest_browse(cchar)
|
|||||||
call assert_equal('Xqftestfile1', bufname('%'))
|
call assert_equal('Xqftestfile1', bufname('%'))
|
||||||
call assert_equal(5, line('.'))
|
call assert_equal(5, line('.'))
|
||||||
|
|
||||||
|
10Xnext
|
||||||
|
call assert_equal('Xqftestfile2', bufname('%'))
|
||||||
|
call assert_equal(11, line('.'))
|
||||||
|
10Xprev
|
||||||
|
call assert_equal('Xqftestfile1', bufname('%'))
|
||||||
|
call assert_equal(5, line('.'))
|
||||||
|
|
||||||
Xexpr ""
|
Xexpr ""
|
||||||
call assert_fails('Xnext', 'E42:')
|
call assert_fails('Xnext', 'E42:')
|
||||||
|
|
||||||
@ -455,9 +465,30 @@ func s:test_xhelpgrep(cchar)
|
|||||||
let title_text = ':lhelpgrep quickfix'
|
let title_text = ':lhelpgrep quickfix'
|
||||||
endif
|
endif
|
||||||
call assert_true(w:quickfix_title =~ title_text, w:quickfix_title)
|
call assert_true(w:quickfix_title =~ title_text, w:quickfix_title)
|
||||||
|
|
||||||
|
" Jumping to a help topic should open the help window
|
||||||
|
only
|
||||||
|
Xnext
|
||||||
|
call assert_true(&buftype == 'help')
|
||||||
|
call assert_true(winnr('$') == 2)
|
||||||
|
" Jumping to the next match should reuse the help window
|
||||||
|
Xnext
|
||||||
|
call assert_true(&buftype == 'help')
|
||||||
|
call assert_true(winnr() == 1)
|
||||||
|
call assert_true(winnr('$') == 2)
|
||||||
|
" Jumping to the next match from the quickfix window should reuse the help
|
||||||
|
" window
|
||||||
|
Xopen
|
||||||
|
Xnext
|
||||||
|
call assert_true(&buftype == 'help')
|
||||||
|
call assert_true(winnr() == 1)
|
||||||
|
call assert_true(winnr('$') == 2)
|
||||||
|
|
||||||
" This wipes out the buffer, make sure that doesn't cause trouble.
|
" This wipes out the buffer, make sure that doesn't cause trouble.
|
||||||
Xclose
|
Xclose
|
||||||
|
|
||||||
|
new | only
|
||||||
|
|
||||||
" Search for non existing help string
|
" Search for non existing help string
|
||||||
call assert_fails('Xhelpgrep a1b2c3', 'E480:')
|
call assert_fails('Xhelpgrep a1b2c3', 'E480:')
|
||||||
endfunc
|
endfunc
|
||||||
@ -596,10 +627,7 @@ func Test_locationlist()
|
|||||||
lrewind
|
lrewind
|
||||||
enew
|
enew
|
||||||
lopen
|
lopen
|
||||||
lnext
|
4lnext
|
||||||
lnext
|
|
||||||
lnext
|
|
||||||
lnext
|
|
||||||
vert split
|
vert split
|
||||||
wincmd L
|
wincmd L
|
||||||
lopen
|
lopen
|
||||||
@ -1057,6 +1085,25 @@ func Test_efm2()
|
|||||||
call assert_equal(1, l[4].valid)
|
call assert_equal(1, l[4].valid)
|
||||||
call assert_equal('unittests/dbfacadeTest.py', bufname(l[4].bufnr))
|
call assert_equal('unittests/dbfacadeTest.py', bufname(l[4].bufnr))
|
||||||
|
|
||||||
|
" The following sequence of commands used to crash Vim
|
||||||
|
set efm=%W%m
|
||||||
|
cgetexpr ['msg1']
|
||||||
|
let l = getqflist()
|
||||||
|
call assert_equal(1, len(l), string(l))
|
||||||
|
call assert_equal('msg1', l[0].text)
|
||||||
|
set efm=%C%m
|
||||||
|
lexpr 'msg2'
|
||||||
|
let l = getloclist(0)
|
||||||
|
call assert_equal(1, len(l), string(l))
|
||||||
|
call assert_equal('msg2', l[0].text)
|
||||||
|
lopen
|
||||||
|
call setqflist([], 'r')
|
||||||
|
caddbuf
|
||||||
|
let l = getqflist()
|
||||||
|
call assert_equal(1, len(l), string(l))
|
||||||
|
call assert_equal('|| msg2', l[0].text)
|
||||||
|
|
||||||
|
new | only
|
||||||
let &efm = save_efm
|
let &efm = save_efm
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
@ -1387,18 +1434,18 @@ func Test_switchbuf()
|
|||||||
let winid = win_getid()
|
let winid = win_getid()
|
||||||
cfirst | cnext
|
cfirst | cnext
|
||||||
call assert_equal(winid, win_getid())
|
call assert_equal(winid, win_getid())
|
||||||
cnext | cnext
|
2cnext
|
||||||
call assert_equal(winid, win_getid())
|
call assert_equal(winid, win_getid())
|
||||||
cnext | cnext
|
2cnext
|
||||||
call assert_equal(winid, win_getid())
|
call assert_equal(winid, win_getid())
|
||||||
enew
|
enew
|
||||||
|
|
||||||
set switchbuf=useopen
|
set switchbuf=useopen
|
||||||
cfirst | cnext
|
cfirst | cnext
|
||||||
call assert_equal(file1_winid, win_getid())
|
call assert_equal(file1_winid, win_getid())
|
||||||
cnext | cnext
|
2cnext
|
||||||
call assert_equal(file2_winid, win_getid())
|
call assert_equal(file2_winid, win_getid())
|
||||||
cnext | cnext
|
2cnext
|
||||||
call assert_equal(file2_winid, win_getid())
|
call assert_equal(file2_winid, win_getid())
|
||||||
|
|
||||||
enew | only
|
enew | only
|
||||||
@ -1408,9 +1455,9 @@ func Test_switchbuf()
|
|||||||
tabfirst
|
tabfirst
|
||||||
cfirst | cnext
|
cfirst | cnext
|
||||||
call assert_equal(2, tabpagenr())
|
call assert_equal(2, tabpagenr())
|
||||||
cnext | cnext
|
2cnext
|
||||||
call assert_equal(3, tabpagenr())
|
call assert_equal(3, tabpagenr())
|
||||||
cnext | cnext
|
2cnext
|
||||||
call assert_equal(3, tabpagenr())
|
call assert_equal(3, tabpagenr())
|
||||||
tabfirst | tabonly | enew
|
tabfirst | tabonly | enew
|
||||||
|
|
||||||
@ -1975,3 +2022,15 @@ func Test_qf_free()
|
|||||||
call XfreeTests('c')
|
call XfreeTests('c')
|
||||||
call XfreeTests('l')
|
call XfreeTests('l')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_no_reuse_mem()
|
||||||
|
set efm=E,%W%m,
|
||||||
|
cgetexpr ['C']
|
||||||
|
set efm=%C%m
|
||||||
|
lexpr '0'
|
||||||
|
lopen
|
||||||
|
call setqflist([], 'r')
|
||||||
|
caddbuf
|
||||||
|
|
||||||
|
set efm&
|
||||||
|
endfunc
|
||||||
|
@ -764,6 +764,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
574,
|
||||||
/**/
|
/**/
|
||||||
573,
|
573,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user