mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
vim-patch:8.2.1775: MS-Windows: adding a long quickfix list is slow (#13019)
vim-patch:8.2.1775: MS-Windows: adding a long quickfix list is slow Problem: MS-Windows: adding a long quickfix list is slow. Solution: Shorten the buffer name only for the first entry. (Yegappan Lakshmanan, closes vim/vim#7039, closes vim/vim#7033)8ec92c9779
N/A patches for version.c: vim-patch:8.1.2226: cannot use system copy/paste in non-xterm terminals Problem: Cannot use system copy/paste in non-xterm terminals. Solution: Instead of setting 'mouse' to "a" set it to "nvi" in defaults.vim.5b418992cf
vim-patch:8.2.1772: cannot use CTRL-W <Down> to move out of a terminal window Problem: Cannot use CTRL-W <Down> to move out of a terminal window. Solution: Use special_to_buf() instead of mb_char2bytes(). (closes vim/vim#7045)f43e7ac4ee
vim-patch:8.2.1774: GTK: hang when forced to exit Problem: GTK: hang when forced to exit. Solution: Do not clean up "mainwin" when really_exiting is set. (Zdenek Dohnal, closes vim/vim#7042)32fbc4f247
vim-patch:8.2.1776: filetype.vim may be loaded twice Problem: Filetype.vim may be loaded twice. Solution: Do "syntax on" after "filetype on". (Adam Stankiewicz, closes vim/vim#7049)17bb4d4607
This commit is contained in:
@@ -3752,7 +3752,7 @@ static void qf_update_buffer(qf_info_T *qi, qfline_T *old_last)
|
|||||||
|
|
||||||
// Add an error line to the quickfix buffer.
|
// Add an error line to the quickfix buffer.
|
||||||
static int qf_buf_add_line(buf_T *buf, linenr_T lnum, const qfline_T *qfp,
|
static int qf_buf_add_line(buf_T *buf, linenr_T lnum, const qfline_T *qfp,
|
||||||
char_u *dirname)
|
char_u *dirname, bool first_bufline)
|
||||||
FUNC_ATTR_NONNULL_ALL
|
FUNC_ATTR_NONNULL_ALL
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
@@ -3767,9 +3767,12 @@ static int qf_buf_add_line(buf_T *buf, linenr_T lnum, const qfline_T *qfp,
|
|||||||
if (qfp->qf_type == 1) { // :helpgrep
|
if (qfp->qf_type == 1) { // :helpgrep
|
||||||
STRLCPY(IObuff, path_tail(errbuf->b_fname), IOSIZE - 1);
|
STRLCPY(IObuff, path_tail(errbuf->b_fname), IOSIZE - 1);
|
||||||
} else {
|
} else {
|
||||||
// shorten the file name if not done already
|
// Shorten the file name if not done already.
|
||||||
if (errbuf->b_sfname == NULL
|
// For optimization, do this only for the first entry in a
|
||||||
|| path_is_absolute(errbuf->b_sfname)) {
|
// buffer.
|
||||||
|
if (first_bufline
|
||||||
|
&& (errbuf->b_sfname == NULL
|
||||||
|
|| path_is_absolute(errbuf->b_sfname))) {
|
||||||
if (*dirname == NUL) {
|
if (*dirname == NUL) {
|
||||||
os_dirname(dirname, MAXPATHL);
|
os_dirname(dirname, MAXPATHL);
|
||||||
}
|
}
|
||||||
@@ -3847,6 +3850,7 @@ static void qf_fill_buffer(qf_list_T *qfl, buf_T *buf, qfline_T *old_last)
|
|||||||
// Check if there is anything to display
|
// Check if there is anything to display
|
||||||
if (qfl != NULL) {
|
if (qfl != NULL) {
|
||||||
char_u dirname[MAXPATHL];
|
char_u dirname[MAXPATHL];
|
||||||
|
int prev_bufnr = -1;
|
||||||
|
|
||||||
*dirname = NUL;
|
*dirname = NUL;
|
||||||
|
|
||||||
@@ -3859,9 +3863,11 @@ static void qf_fill_buffer(qf_list_T *qfl, buf_T *buf, qfline_T *old_last)
|
|||||||
lnum = buf->b_ml.ml_line_count;
|
lnum = buf->b_ml.ml_line_count;
|
||||||
}
|
}
|
||||||
while (lnum < qfl->qf_count) {
|
while (lnum < qfl->qf_count) {
|
||||||
if (qf_buf_add_line(buf, lnum, qfp, dirname) == FAIL) {
|
if (qf_buf_add_line(buf, lnum, qfp, dirname,
|
||||||
|
prev_bufnr != qfp->qf_fnum) == FAIL) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
prev_bufnr = qfp->qf_fnum;
|
||||||
lnum++;
|
lnum++;
|
||||||
qfp = qfp->qf_next;
|
qfp = qfp->qf_next;
|
||||||
if (qfp == NULL) {
|
if (qfp == NULL) {
|
||||||
|
@@ -3473,6 +3473,18 @@ func Test_shorten_fname()
|
|||||||
" Displaying the quickfix list should simplify the file path
|
" Displaying the quickfix list should simplify the file path
|
||||||
silent! clist
|
silent! clist
|
||||||
call assert_equal('test_quickfix.vim', bufname('test_quickfix.vim'))
|
call assert_equal('test_quickfix.vim', bufname('test_quickfix.vim'))
|
||||||
|
" Add a few entries for the same file with different paths and check whether
|
||||||
|
" the buffer name is shortened
|
||||||
|
%bwipe
|
||||||
|
call setqflist([], 'f')
|
||||||
|
call setqflist([{'filename' : 'test_quickfix.vim', 'lnum' : 10},
|
||||||
|
\ {'filename' : '../testdir/test_quickfix.vim', 'lnum' : 20},
|
||||||
|
\ {'filename' : fname, 'lnum' : 30}], ' ')
|
||||||
|
copen
|
||||||
|
call assert_equal(['test_quickfix.vim|10| ',
|
||||||
|
\ 'test_quickfix.vim|20| ',
|
||||||
|
\ 'test_quickfix.vim|30| '], getline(1, '$'))
|
||||||
|
cclose
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Quickfix title tests
|
" Quickfix title tests
|
||||||
|
Reference in New Issue
Block a user