mirror of
https://github.com/neovim/neovim.git
synced 2025-09-15 15:58:17 +00:00
vim-patch:8.1.0213: CTRL-W CR does not work properly in a quickfix window
Problem: CTRL-W CR does not work properly in a quickfix window.
Solution: Split the window if needed. (Jason Franklin)
0a08c63da1
This commit is contained in:
@@ -2845,6 +2845,39 @@ static char_u *qf_types(int c, int nr)
|
||||
return buf;
|
||||
}
|
||||
|
||||
// When "split" is false: Open the entry/result under the cursor.
|
||||
// When "split" is true: Open the entry/result under the cursor in a new window.
|
||||
void qf_view_result(bool split)
|
||||
{
|
||||
qf_info_T *qi = &ql_info;
|
||||
|
||||
if (!bt_quickfix(curbuf)) {
|
||||
return;
|
||||
}
|
||||
if (IS_LL_WINDOW(curwin)) {
|
||||
qi = GET_LOC_LIST(curwin);
|
||||
}
|
||||
if (qi == NULL
|
||||
|| qi->qf_lists[qi->qf_curlist].qf_count == 0) {
|
||||
EMSG(_(e_quickfix));
|
||||
return;
|
||||
}
|
||||
|
||||
if (split) {
|
||||
char cmd[32];
|
||||
|
||||
snprintf(cmd, sizeof(cmd), "split +%" PRId64 "%s",
|
||||
(int64_t)curwin->w_cursor.lnum,
|
||||
IS_LL_WINDOW(curwin) ? "ll" : "cc");
|
||||
if (do_cmdline_cmd(cmd) == OK) {
|
||||
do_cmdline_cmd("clearjumps");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
do_cmdline_cmd((IS_LL_WINDOW(curwin) ? ".ll" : ".cc"));
|
||||
}
|
||||
|
||||
/*
|
||||
* ":cwindow": open the quickfix window if we have errors to display,
|
||||
* close it if not.
|
||||
|
Reference in New Issue
Block a user