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:
Jan Edmund Lazo
2019-06-11 23:16:16 -04:00
parent 005316ae41
commit 22d58ab664
4 changed files with 55 additions and 14 deletions

View File

@@ -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.