vim-patch:9.2.0585: line number wrong after undoing a deletion in quickfix buffer (#40081)

Problem:  Deleting a quickfix line and undoing it leaves the entry
          pointing one line below where it should.
Solution: Don't shift already cleared entries in qf_mark_adjust.

closes: vim/vim#20379

64982d6010
This commit is contained in:
glepnir
2026-06-02 13:30:12 +08:00
committed by GitHub
parent 6b6efb37eb
commit a5d4b4e0fc
2 changed files with 51 additions and 0 deletions

View File

@@ -3727,6 +3727,10 @@ bool qf_mark_adjust(buf_T *buf, win_T *wp, linenr_T line1, linenr_T line2, linen
FOR_ALL_QFL_ITEMS(qfl, qfp, i) {
if (qfp->qf_fnum == buf->b_fnum) {
found_one = true;
if (qfp->qf_cleared) {
continue;
}
if (qfp->qf_lnum >= line1 && qfp->qf_lnum <= line2) {
if (amount == MAXLNUM) {
qfp->qf_cleared = true;