diff src/quickfix.c @ 13105:bfa7f5b23c53 v8.0.1427

patch 8.0.1427: the :leftabove modifier doesn't work for :copen commit https://github.com/vim/vim/commit/de04654ddc865af94ef04b1738b335a924be7923 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Dec 26 13:53:11 2017 +0100 patch 8.0.1427: the :leftabove modifier doesn't work for :copen Problem: The :leftabove modifier doesn't work for :copen. Solution: Respect the split modifier. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/2496)
author Christian Brabandt <cb@256bit.org>
date Tue, 26 Dec 2017 14:00:05 +0100
parents a0c6910e7fa4
children 9812a9ca3ab2
line wrap: on
line diff
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -3222,6 +3222,8 @@ ex_copen(exarg_T *eap)
     }
     else
     {
+	int flags = 0;
+
 	qf_buf = qf_find_buf(qi);
 
 	/* The current window becomes the previous window afterwards. */
@@ -3229,10 +3231,14 @@ ex_copen(exarg_T *eap)
 
 	if ((eap->cmdidx == CMD_copen || eap->cmdidx == CMD_cwindow)
 		&& cmdmod.split == 0)
-	    /* Create the new window at the very bottom, except when
+	    /* Create the new quickfix window at the very bottom, except when
 	     * :belowright or :aboveleft is used. */
 	    win_goto(lastwin);
-	if (win_split(height, WSP_BELOW | WSP_NEWLOC) == FAIL)
+	/* Default is to open the window below the current window */
+	if (cmdmod.split == 0)
+	    flags = WSP_BELOW;
+	flags |= WSP_NEWLOC;
+	if (win_split(height, flags) == FAIL)
 	    return;		/* not enough room for window */
 	RESET_BINDING(curwin);