comparison src/quickfix.c @ 14397:19d99d9e670c v8.1.0213

patch 8.1.0213: CTRL-W CR does not work properly in a quickfix window commit https://github.com/vim/vim/commit/0a08c63da17dfd93ac2885e3f3f8a083a9b3131c Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jul 25 22:36:52 2018 +0200 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)
author Christian Brabandt <cb@256bit.org>
date Wed, 25 Jul 2018 22:45:04 +0200
parents df27d6270691
children 4a94173743d9
comparison
equal deleted inserted replaced
14396:cee68b7551a2 14397:19d99d9e670c
3488 sprintf((char *)buf, "%s %3d", (char *)p, nr); 3488 sprintf((char *)buf, "%s %3d", (char *)p, nr);
3489 return buf; 3489 return buf;
3490 } 3490 }
3491 3491
3492 /* 3492 /*
3493 * When "split" is FALSE: Open the entry/result under the cursor.
3494 * When "split" is TRUE: Open the entry/result under the cursor in a new window.
3495 */
3496 void
3497 qf_view_result(int split)
3498 {
3499 qf_info_T *qi = &ql_info;
3500
3501 if (!bt_quickfix(curbuf))
3502 return;
3503
3504 if (IS_LL_WINDOW(curwin))
3505 qi = GET_LOC_LIST(curwin);
3506
3507 if (qi == NULL || qi->qf_lists[qi->qf_curlist].qf_count == 0)
3508 {
3509 EMSG(_(e_quickfix));
3510 return;
3511 }
3512
3513 if (split)
3514 {
3515 char_u cmd[32];
3516
3517 vim_snprintf((char *)cmd, sizeof(cmd), "split +%ld%s",
3518 (long)curwin->w_cursor.lnum,
3519 IS_LL_WINDOW(curwin) ? "ll" : "cc");
3520 if (do_cmdline_cmd(cmd) == OK)
3521 do_cmdline_cmd((char_u *) "clearjumps");
3522 return;
3523 }
3524
3525 do_cmdline_cmd((char_u *)(IS_LL_WINDOW(curwin) ? ".ll" : ".cc"));
3526 }
3527
3528 /*
3493 * ":cwindow": open the quickfix window if we have errors to display, 3529 * ":cwindow": open the quickfix window if we have errors to display,
3494 * close it if not. 3530 * close it if not.
3495 * ":lwindow": open the location list window if we have locations to display, 3531 * ":lwindow": open the location list window if we have locations to display,
3496 * close it if not. 3532 * close it if not.
3497 */ 3533 */