diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-12-26 13:53:11 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-12-26 13:53:11 +0100 |
commit | de04654ddc865af94ef04b1738b335a924be7923 (patch) | |
tree | 4c35f34d9bca284a4f252ac0345ee3ba1afe35c0 | |
parent | 9e3dfc650190e96739abc004eb9948afa68136b4 (diff) |
patch 8.0.1427: the :leftabove modifier doesn't work for :copenv8.0.1427
Problem: The :leftabove modifier doesn't work for :copen.
Solution: Respect the split modifier. (Yegappan Lakshmanan, closes #2496)
-rw-r--r-- | src/quickfix.c | 10 | ||||
-rw-r--r-- | src/testdir/test_quickfix.vim | 27 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 37 insertions, 2 deletions
diff --git a/src/quickfix.c b/src/quickfix.c index 05e5946283..8e745213ac 100644 --- 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); diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim index 0787e60e3d..fb78f6983a 100644 --- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -3078,3 +3078,30 @@ func Test_lvimgrep_crash() augroup END enew | only endfunc + +" Test for the position of the quickfix and location list window +func Test_qfwin_pos() + " Open two windows + new | only + new + cexpr ['F1:10:L10'] + copen + " Quickfix window should be the bottom most window + call assert_equal(3, winnr()) + close + " Open at the very top + wincmd t + topleft copen + call assert_equal(1, winnr()) + close + " open left of the current window + wincmd t + below new + leftabove copen + call assert_equal(2, winnr()) + close + " open right of the current window + rightbelow copen + call assert_equal(3, winnr()) + close +endfunc diff --git a/src/version.c b/src/version.c index 17547222f8..15aec195fb 100644 --- a/src/version.c +++ b/src/version.c @@ -772,6 +772,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1427, +/**/ 1426, /**/ 1425, |