0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

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)
This commit is contained in:
Bram Moolenaar
2018-07-25 22:36:52 +02:00
parent 53901442f3
commit 0a08c63da1
6 changed files with 65 additions and 23 deletions

View File

@@ -3489,6 +3489,42 @@ 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(int 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_u cmd[32];
vim_snprintf((char *)cmd, sizeof(cmd), "split +%ld%s",
(long)curwin->w_cursor.lnum,
IS_LL_WINDOW(curwin) ? "ll" : "cc");
if (do_cmdline_cmd(cmd) == OK)
do_cmdline_cmd((char_u *) "clearjumps");
return;
}
do_cmdline_cmd((char_u *)(IS_LL_WINDOW(curwin) ? ".ll" : ".cc"));
}
/*
* ":cwindow": open the quickfix window if we have errors to display,
* close it if not.