summaryrefslogtreecommitdiff
path: root/src/quickfix.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-07-25 22:36:52 +0200
committerBram Moolenaar <Bram@vim.org>2018-07-25 22:36:52 +0200
commit0a08c63da17dfd93ac2885e3f3f8a083a9b3131c (patch)
tree9d557c0e8454c09c889e6ee033b178118bc9aa7e /src/quickfix.c
parent53901442f37a59e5495165f91db5574c0b43ab04 (diff)
downloadvim-git-0a08c63da17dfd93ac2885e3f3f8a083a9b3131c.tar.gz
patch 8.1.0213: CTRL-W CR does not work properly in a quickfix windowv8.1.0213
Problem: CTRL-W CR does not work properly in a quickfix window. Solution: Split the window if needed. (Jason Franklin)
Diffstat (limited to 'src/quickfix.c')
-rw-r--r--src/quickfix.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/quickfix.c b/src/quickfix.c
index f758980b4..aac1e3414 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -3490,6 +3490,42 @@ qf_types(int c, int nr)
}
/*
+ * 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.
* ":lwindow": open the location list window if we have locations to display,