mirror of
https://github.com/neovim/neovim.git
synced 2025-09-17 16:58:17 +00:00
vim-patch:8.2.2069: the quickfix window is not updated after setqflist()
Problem: The quickfix window is not updated after setqflist(). Solution: Update the quickfix buffer. (Yegappan Lakshmanan, closes vim/vim#7390, closes vim/vim#7385)287153c5d4
N/A patches for version.c: vim-patch:8.2.2067: cursor position in popup terminal is wrong Problem: Cursor position in popup terminal is wrong. Solution: Don't check the flags.f5452691ba
This commit is contained in:
@@ -6155,7 +6155,7 @@ static int qf_setprop_items_from_lines(
|
|||||||
qf_free_items(&qi->qf_lists[qf_idx]);
|
qf_free_items(&qi->qf_lists[qf_idx]);
|
||||||
}
|
}
|
||||||
if (qf_init_ext(qi, qf_idx, NULL, NULL, &di->di_tv, errorformat,
|
if (qf_init_ext(qi, qf_idx, NULL, NULL, &di->di_tv, errorformat,
|
||||||
false, (linenr_T)0, (linenr_T)0, NULL, NULL) > 0) {
|
false, (linenr_T)0, (linenr_T)0, NULL, NULL) >= 0) {
|
||||||
retval = OK;
|
retval = OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6256,9 +6256,12 @@ static int qf_set_properties(qf_info_T *qi, const dict_T *what, int action,
|
|||||||
retval = qf_setprop_curidx(qi, qfl, di);
|
retval = qf_setprop_curidx(qi, qfl, di);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (retval == OK) {
|
if (newlist || retval == OK) {
|
||||||
qf_list_changed(qfl);
|
qf_list_changed(qfl);
|
||||||
}
|
}
|
||||||
|
if (newlist) {
|
||||||
|
qf_update_buffer(qi, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
@@ -4485,4 +4485,62 @@ func Test_quickfix_window_fails_to_open()
|
|||||||
call delete('XquickfixFails')
|
call delete('XquickfixFails')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" Test for updating the quickfix buffer whenever the assocaited quickfix list
|
||||||
|
" is changed.
|
||||||
|
func Xqfbuf_update(cchar)
|
||||||
|
call s:setup_commands(a:cchar)
|
||||||
|
|
||||||
|
Xexpr "F1:1:line1"
|
||||||
|
Xopen
|
||||||
|
call assert_equal(['F1|1| line1'], getline(1, '$'))
|
||||||
|
call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||||
|
|
||||||
|
" Test setqflist() using the 'lines' key in 'what'
|
||||||
|
" add a new entry
|
||||||
|
call g:Xsetlist([], 'a', {'lines' : ['F2:2: line2']})
|
||||||
|
call assert_equal(['F1|1| line1', 'F2|2| line2'], getline(1, '$'))
|
||||||
|
call assert_equal(2, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||||
|
" replace all the entries with a single entry
|
||||||
|
call g:Xsetlist([], 'r', {'lines' : ['F3:3: line3']})
|
||||||
|
call assert_equal(['F3|3| line3'], getline(1, '$'))
|
||||||
|
call assert_equal(3, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||||
|
" remove all the entries
|
||||||
|
call g:Xsetlist([], 'r', {'lines' : []})
|
||||||
|
call assert_equal([''], getline(1, '$'))
|
||||||
|
call assert_equal(4, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||||
|
" add a new list
|
||||||
|
call g:Xsetlist([], ' ', {'lines' : ['F4:4: line4']})
|
||||||
|
call assert_equal(['F4|4| line4'], getline(1, '$'))
|
||||||
|
call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||||
|
|
||||||
|
" Test setqflist() using the 'items' key in 'what'
|
||||||
|
" add a new entry
|
||||||
|
call g:Xsetlist([], 'a', {'items' : [{'filename' : 'F5', 'lnum' : 5, 'text' : 'line5'}]})
|
||||||
|
call assert_equal(['F4|4| line4', 'F5|5| line5'], getline(1, '$'))
|
||||||
|
call assert_equal(2, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||||
|
" replace all the entries with a single entry
|
||||||
|
call g:Xsetlist([], 'r', {'items' : [{'filename' : 'F6', 'lnum' : 6, 'text' : 'line6'}]})
|
||||||
|
call assert_equal(['F6|6| line6'], getline(1, '$'))
|
||||||
|
call assert_equal(3, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||||
|
" remove all the entries
|
||||||
|
call g:Xsetlist([], 'r', {'items' : []})
|
||||||
|
call assert_equal([''], getline(1, '$'))
|
||||||
|
call assert_equal(4, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||||
|
" add a new list
|
||||||
|
call g:Xsetlist([], ' ', {'items' : [{'filename' : 'F7', 'lnum' : 7, 'text' : 'line7'}]})
|
||||||
|
call assert_equal(['F7|7| line7'], getline(1, '$'))
|
||||||
|
call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||||
|
|
||||||
|
call g:Xsetlist([], ' ', {})
|
||||||
|
call assert_equal([''], getline(1, '$'))
|
||||||
|
call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||||
|
|
||||||
|
Xclose
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func Test_qfbuf_update()
|
||||||
|
call Xqfbuf_update('c')
|
||||||
|
call Xqfbuf_update('l')
|
||||||
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
Reference in New Issue
Block a user