Mercurial > vim
comparison src/quickfix.c @ 11447:698ee9d4fe9f v8.0.0607
patch 8.0.0607: after :bwipe + :new bufref might still be valid
commit https://github.com/vim/vim/commit/45e5fd135da5710f24a1acc142692f120f8b0b78
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jun 4 14:58:02 2017 +0200
patch 8.0.0607: after :bwipe + :new bufref might still be valid
Problem: When creating a bufref, then using :bwipe and :new it might get
the same memory and bufref_valid() returns true.
Solution: Add br_fnum to check the buffer number didn't change.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 04 Jun 2017 15:00:04 +0200 |
parents | 461ac47c3793 |
children | d2f00eb352b9 |
comparison
equal
deleted
inserted
replaced
11446:b9783d95d9d6 | 11447:698ee9d4fe9f |
---|---|
159 | 159 |
160 /* | 160 /* |
161 * Looking up a buffer can be slow if there are many. Remember the last one | 161 * Looking up a buffer can be slow if there are many. Remember the last one |
162 * to make this a lot faster if there are multiple matches in the same file. | 162 * to make this a lot faster if there are multiple matches in the same file. |
163 */ | 163 */ |
164 static char_u *qf_last_bufname = NULL; | 164 static char_u *qf_last_bufname = NULL; |
165 static bufref_T qf_last_bufref = {NULL, 0}; | 165 static bufref_T qf_last_bufref = {NULL, 0, 0}; |
166 | 166 |
167 /* | 167 /* |
168 * Read the errorfile "efile" into memory, line by line, building the error | 168 * Read the errorfile "efile" into memory, line by line, building the error |
169 * list. Set the error list's title to qf_title. | 169 * list. Set the error list's title to qf_title. |
170 * Return -1 for error, number of errors for success. | 170 * Return -1 for error, number of errors for success. |
2730 for (i = 0; i < qi->qf_listcount; ++i) | 2730 for (i = 0; i < qi->qf_listcount; ++i) |
2731 qf_msg(qi, i, i == qi->qf_curlist ? "> " : " "); | 2731 qf_msg(qi, i, i == qi->qf_curlist ? "> " : " "); |
2732 } | 2732 } |
2733 | 2733 |
2734 /* | 2734 /* |
2735 * Free error list "idx". | 2735 * Free all the entries in the error list "idx". |
2736 */ | 2736 */ |
2737 static void | 2737 static void |
2738 qf_free(qf_info_T *qi, int idx) | 2738 qf_free(qf_info_T *qi, int idx) |
2739 { | 2739 { |
2740 qfline_T *qfp; | 2740 qfline_T *qfp; |