mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 23:38:17 +00:00
vim-patch:7.4.1884
Problem: Updating marks in a quickfix list is very slow when the list is
long.
Solution: Only update marks if the buffer has a quickfix entry.
2f095a4bc4
This commit is contained in:
@@ -609,6 +609,7 @@ struct file_buffer {
|
|||||||
int b_p_bomb; ///< 'bomb'
|
int b_p_bomb; ///< 'bomb'
|
||||||
char_u *b_p_bh; ///< 'bufhidden'
|
char_u *b_p_bh; ///< 'bufhidden'
|
||||||
char_u *b_p_bt; ///< 'buftype'
|
char_u *b_p_bt; ///< 'buftype'
|
||||||
|
bool b_has_qf_entry; ///< quickfix exists for buffer
|
||||||
int b_p_bl; ///< 'buflisted'
|
int b_p_bl; ///< 'buflisted'
|
||||||
int b_p_cin; ///< 'cindent'
|
int b_p_cin; ///< 'cindent'
|
||||||
char_u *b_p_cino; ///< 'cinoptions'
|
char_u *b_p_cino; ///< 'cinoptions'
|
||||||
@@ -1037,7 +1038,7 @@ struct window_S {
|
|||||||
int w_wrow, w_wcol; /* cursor position in window */
|
int w_wrow, w_wcol; /* cursor position in window */
|
||||||
|
|
||||||
linenr_T w_botline; /* number of the line below the bottom of
|
linenr_T w_botline; /* number of the line below the bottom of
|
||||||
the screen */
|
the window */
|
||||||
int w_empty_rows; /* number of ~ rows in window */
|
int w_empty_rows; /* number of ~ rows in window */
|
||||||
int w_filler_rows; /* number of filler rows at the end of the
|
int w_filler_rows; /* number of filler rows at the end of the
|
||||||
window */
|
window */
|
||||||
|
@@ -1015,9 +1015,14 @@ static int qf_add_entry(qf_info_T *qi, char_u *dir, char_u *fname, int bufnum,
|
|||||||
qfline_T *qfp = xmalloc(sizeof(qfline_T));
|
qfline_T *qfp = xmalloc(sizeof(qfline_T));
|
||||||
qfline_T **lastp; // pointer to qf_last or NULL
|
qfline_T **lastp; // pointer to qf_last or NULL
|
||||||
|
|
||||||
if (bufnum != 0)
|
if (bufnum != 0) {
|
||||||
|
buf_T *buf = buflist_findnr(bufnum);
|
||||||
|
|
||||||
qfp->qf_fnum = bufnum;
|
qfp->qf_fnum = bufnum;
|
||||||
else
|
if (buf != NULL) {
|
||||||
|
buf->b_has_qf_entry = true;
|
||||||
|
}
|
||||||
|
} else
|
||||||
qfp->qf_fnum = qf_get_fnum(dir, fname);
|
qfp->qf_fnum = qf_get_fnum(dir, fname);
|
||||||
qfp->qf_text = vim_strsave(mesg);
|
qfp->qf_text = vim_strsave(mesg);
|
||||||
qfp->qf_lnum = lnum;
|
qfp->qf_lnum = lnum;
|
||||||
@@ -1190,45 +1195,47 @@ void copy_loclist(win_T *from, win_T *to)
|
|||||||
to->w_llist->qf_curlist = qi->qf_curlist; /* current list */
|
to->w_llist->qf_curlist = qi->qf_curlist; /* current list */
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// Get buffer number for file "dir.name".
|
||||||
* get buffer number for file "dir.name"
|
// Also sets the b_has_qf_entry flag.
|
||||||
*/
|
|
||||||
static int qf_get_fnum(char_u *directory, char_u *fname)
|
static int qf_get_fnum(char_u *directory, char_u *fname)
|
||||||
{
|
{
|
||||||
|
char_u *ptr;
|
||||||
|
buf_T *buf;
|
||||||
if (fname == NULL || *fname == NUL) /* no file name */
|
if (fname == NULL || *fname == NUL) /* no file name */
|
||||||
return 0;
|
return 0;
|
||||||
{
|
|
||||||
char_u *ptr;
|
|
||||||
int fnum;
|
|
||||||
|
|
||||||
#ifdef BACKSLASH_IN_FILENAME
|
#ifdef BACKSLASH_IN_FILENAME
|
||||||
if (directory != NULL)
|
if (directory != NULL)
|
||||||
slash_adjust(directory);
|
slash_adjust(directory);
|
||||||
slash_adjust(fname);
|
slash_adjust(fname);
|
||||||
#endif
|
#endif
|
||||||
if (directory != NULL && !vim_isAbsName(fname)) {
|
if (directory != NULL && !vim_isAbsName(fname)) {
|
||||||
ptr = (char_u *)concat_fnames((char *)directory, (char *)fname, TRUE);
|
ptr = (char_u *)concat_fnames((char *)directory, (char *)fname, TRUE);
|
||||||
/*
|
/*
|
||||||
* Here we check if the file really exists.
|
* Here we check if the file really exists.
|
||||||
* This should normally be true, but if make works without
|
* This should normally be true, but if make works without
|
||||||
* "leaving directory"-messages we might have missed a
|
* "leaving directory"-messages we might have missed a
|
||||||
* directory change.
|
* directory change.
|
||||||
*/
|
*/
|
||||||
if (!os_path_exists(ptr)) {
|
if (!os_path_exists(ptr)) {
|
||||||
xfree(ptr);
|
|
||||||
directory = qf_guess_filepath(fname);
|
|
||||||
if (directory)
|
|
||||||
ptr = (char_u *)concat_fnames((char *)directory, (char *)fname, TRUE);
|
|
||||||
else
|
|
||||||
ptr = vim_strsave(fname);
|
|
||||||
}
|
|
||||||
/* Use concatenated directory name and file name */
|
|
||||||
fnum = buflist_add(ptr, 0);
|
|
||||||
xfree(ptr);
|
xfree(ptr);
|
||||||
return fnum;
|
directory = qf_guess_filepath(fname);
|
||||||
|
if (directory)
|
||||||
|
ptr = (char_u *)concat_fnames((char *)directory, (char *)fname, TRUE);
|
||||||
|
else
|
||||||
|
ptr = vim_strsave(fname);
|
||||||
}
|
}
|
||||||
return buflist_add(fname, 0);
|
/* Use concatenated directory name and file name */
|
||||||
|
buf = buflist_new(ptr, NULL, (linenr_T)0, 0);
|
||||||
|
xfree(ptr);
|
||||||
|
} else {
|
||||||
|
buf = buflist_new(fname, NULL, (linenr_T)0, 0);
|
||||||
}
|
}
|
||||||
|
if (buf == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
buf->b_has_qf_entry = true;
|
||||||
|
return buf->b_fnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -2104,7 +2111,11 @@ void qf_mark_adjust(win_T *wp, linenr_T line1, linenr_T line2, long amount, long
|
|||||||
qfline_T *qfp;
|
qfline_T *qfp;
|
||||||
int idx;
|
int idx;
|
||||||
qf_info_T *qi = &ql_info;
|
qf_info_T *qi = &ql_info;
|
||||||
|
bool found_one = false;
|
||||||
|
|
||||||
|
if (!curbuf->b_has_qf_entry) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (wp != NULL) {
|
if (wp != NULL) {
|
||||||
if (wp->w_llist == NULL)
|
if (wp->w_llist == NULL)
|
||||||
return;
|
return;
|
||||||
@@ -2117,6 +2128,7 @@ void qf_mark_adjust(win_T *wp, linenr_T line1, linenr_T line2, long amount, long
|
|||||||
i < qi->qf_lists[idx].qf_count && qfp != NULL;
|
i < qi->qf_lists[idx].qf_count && qfp != NULL;
|
||||||
++i, qfp = qfp->qf_next)
|
++i, qfp = qfp->qf_next)
|
||||||
if (qfp->qf_fnum == curbuf->b_fnum) {
|
if (qfp->qf_fnum == curbuf->b_fnum) {
|
||||||
|
found_one = true;
|
||||||
if (qfp->qf_lnum >= line1 && qfp->qf_lnum <= line2) {
|
if (qfp->qf_lnum >= line1 && qfp->qf_lnum <= line2) {
|
||||||
if (amount == MAXLNUM)
|
if (amount == MAXLNUM)
|
||||||
qfp->qf_cleared = TRUE;
|
qfp->qf_cleared = TRUE;
|
||||||
@@ -2125,6 +2137,10 @@ void qf_mark_adjust(win_T *wp, linenr_T line1, linenr_T line2, long amount, long
|
|||||||
} else if (amount_after && qfp->qf_lnum > line2)
|
} else if (amount_after && qfp->qf_lnum > line2)
|
||||||
qfp->qf_lnum += amount_after;
|
qfp->qf_lnum += amount_after;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!found_one) {
|
||||||
|
curbuf->b_has_qf_entry = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -556,7 +556,7 @@ static int included_patches[] = {
|
|||||||
// 1887 NA
|
// 1887 NA
|
||||||
// 1886 NA
|
// 1886 NA
|
||||||
// 1885 NA
|
// 1885 NA
|
||||||
// 1884,
|
1884,
|
||||||
// 1883 NA
|
// 1883 NA
|
||||||
1882,
|
1882,
|
||||||
1881,
|
1881,
|
||||||
|
Reference in New Issue
Block a user