diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-11-14 14:31:13 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-11-14 17:23:48 -0500 |
commit | 78c380f947445d327d33fa068c91a3bb2370c35c (patch) | |
tree | 2c2c815def3aab6e27f8cf2d98403f466c3d797d | |
parent | 27d630926cab78511075159012ce6ac920d8747e (diff) | |
download | rneovim-78c380f947445d327d33fa068c91a3bb2370c35c.tar.gz rneovim-78c380f947445d327d33fa068c91a3bb2370c35c.tar.bz2 rneovim-78c380f947445d327d33fa068c91a3bb2370c35c.zip |
vim-patch:8.2.1982: quickfix window now updated when adding invalid entries
Problem: Quickfix window now updated when adding invalid entries.
Solution: Update the quickfix buffer properly. (Yegappan Lakshmanan, closes
vim/vim#7291, closes vim/vim#7271)
https://github.com/vim/vim/commit/2ce7790348dab9cbfcc5d02c8258d0dd7ecacf95
N/A patches for version.c:
vim-patch:8.2.1979: "term_opencmd" option of term_start() is truncated
Problem: "term_opencmd" option of term_start() is truncated. (Sergey
Vlasov)
Solution: Allocate the buffer to hold the command. (closes vim/vim#7284)
https://github.com/vim/vim/commit/47c5ea44b975adca00eaacecee5c4108996178d9
vim-patch:8.2.1981: MinGW: parallel compilation might fail
Problem: MinGW: parallel compilation might fail.
Solution: Add dependencies on $(OUTDIR). (Masamichi Abe, closes vim/vim#7287)
https://github.com/vim/vim/commit/8496c9eadbf4ea3bf69e2e01456831eee2bddf0a
vim-patch:8.2.1985: crash when closing terminal popup with <Cmd> mapping
Problem: Crash when closing terminal popup with <Cmd> mapping.
Solution: Check b_term is not NULL. (closes vim/vim#7294)
https://github.com/vim/vim/commit/02764713a715c55e316e2bef5c9ade2fb767ee78
vim-patch:8.2.1987: MS-Windows: Win32.mak is no longer needed
Problem: MS-Windows: Win32.mak is no longer needed.
Solution: Do not include Win32.mak. (Jason McHugh, closes vim/vim#7290)
https://github.com/vim/vim/commit/6453cc8078af403956d0e8c1849cf5ec0aae86b2
-rw-r--r-- | src/nvim/quickfix.c | 8 | ||||
-rw-r--r-- | src/nvim/testdir/test_quickfix.vim | 13 |
2 files changed, 19 insertions, 2 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 6ca97c3072..d3ca65c53c 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -3975,11 +3975,15 @@ static void qf_fill_buffer(qf_list_T *qfl, buf_T *buf, qfline_T *old_last) *dirname = NUL; // Add one line for each error - if (old_last == NULL || old_last->qf_next == NULL) { + if (old_last == NULL) { qfp = qfl->qf_start; lnum = 0; } else { - qfp = old_last->qf_next; + if (old_last->qf_next != NULL) { + qfp = old_last->qf_next; + } else { + qfp = old_last; + } lnum = buf->b_ml.ml_line_count; } while (lnum < qfl->qf_count) { diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index 049163890e..3e97cd2dd0 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -4410,4 +4410,17 @@ func Test_search_in_dirstack() call delete('Xtestdir', 'rf') endfunc +" Test for adding an invalid entry with the quickfix window open and making +" sure that the window contents are not changed +func Test_add_invalid_entry_with_qf_window() + call setqflist([], 'f') + cexpr "Xfile1:10:aa" + copen + call setqflist(['bb'], 'a') + call assert_equal(1, line('$')) + call assert_equal(['Xfile1|10| aa'], getline(1, '$')) + call assert_equal([{'lnum': 10, 'bufnr': bufnr('Xfile1'), 'col': 0, 'pattern': '', 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'module': '', 'text': 'aa'}], getqflist()) + cclose +endfunc + " vim: shiftwidth=2 sts=2 expandtab |