Mercurial > vim
comparison src/quickfix.c @ 18886:050f5eaa9e50 v8.2.0004
patch 8.2.0004: get E685 and E931 if buffer reload is interrupted
Commit: https://github.com/vim/vim/commit/a6e8f888e7fc31b8ab7233509254fb2e2fe4089f
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Dec 14 16:18:15 2019 +0100
patch 8.2.0004: get E685 and E931 if buffer reload is interrupted
Problem: Get E685 and E931 if buffer reload is interrupted.
Solution: Do not abort deleting a dummy buffer. (closes https://github.com/vim/vim/issues/5361)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 14 Dec 2019 16:30:04 +0100 |
parents | f98368dd6615 |
children | 2ef19eed524a |
comparison
equal
deleted
inserted
replaced
18885:f4852c310de1 | 18886:050f5eaa9e50 |
---|---|
1923 qfbuf = buflist_findnr(qi->qf_bufnr); | 1923 qfbuf = buflist_findnr(qi->qf_bufnr); |
1924 if (qfbuf != NULL && qfbuf->b_nwindows == 0) | 1924 if (qfbuf != NULL && qfbuf->b_nwindows == 0) |
1925 { | 1925 { |
1926 // If the quickfix buffer is not loaded in any window, then | 1926 // If the quickfix buffer is not loaded in any window, then |
1927 // wipe the buffer. | 1927 // wipe the buffer. |
1928 close_buffer(NULL, qfbuf, DOBUF_WIPE, FALSE); | 1928 close_buffer(NULL, qfbuf, DOBUF_WIPE, FALSE, FALSE); |
1929 qi->qf_bufnr = INVALID_QFBUFNR; | 1929 qi->qf_bufnr = INVALID_QFBUFNR; |
1930 } | 1930 } |
1931 } | 1931 } |
1932 } | 1932 } |
1933 | 1933 |
6309 static void | 6309 static void |
6310 unload_dummy_buffer(buf_T *buf, char_u *dirname_start) | 6310 unload_dummy_buffer(buf_T *buf, char_u *dirname_start) |
6311 { | 6311 { |
6312 if (curbuf != buf) // safety check | 6312 if (curbuf != buf) // safety check |
6313 { | 6313 { |
6314 close_buffer(NULL, buf, DOBUF_UNLOAD, FALSE); | 6314 close_buffer(NULL, buf, DOBUF_UNLOAD, FALSE, TRUE); |
6315 | 6315 |
6316 // When autocommands/'autochdir' option changed directory: go back. | 6316 // When autocommands/'autochdir' option changed directory: go back. |
6317 restore_start_dir(dirname_start); | 6317 restore_start_dir(dirname_start); |
6318 } | 6318 } |
6319 } | 6319 } |