diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/buffer.c | 2 | ||||
-rw-r--r-- | src/nvim/ex_cmds2.c | 3 | ||||
-rw-r--r-- | src/nvim/quickfix.c | 40 | ||||
-rw-r--r-- | src/nvim/testdir/test_options.vim | 26 |
4 files changed, 50 insertions, 21 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index cdb226b94d..d944c654b0 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -4488,7 +4488,7 @@ void fname_expand(buf_T *buf, char_u **ffname, char_u **sfname) if (*sfname == NULL) { // if no short file name given, use ffname *sfname = *ffname; } - *ffname = (char_u *)fix_fname((char *)*ffname); // expand to full path + *ffname = (char_u *)fix_fname((char *)(*ffname)); // expand to full path #ifdef WIN32 if (!buf->b_p_bin) { diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index 40ff29d4a8..a2ed37e37e 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -2826,6 +2826,9 @@ void ex_packadd(exarg_T *eap) void ex_options(exarg_T *eap) { vim_setenv("OPTWIN_CMD", cmdmod.tab ? "tab" : ""); + vim_setenv("OPTWIN_CMD", + cmdmod.tab ? "tab" : + (cmdmod.split & WSP_VERT) ? "vert" : ""); cmd_source((char_u *)SYS_OPTWIN_FILE, NULL); } diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 3ce8f0d21a..550f742106 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -200,13 +200,13 @@ typedef struct { #define IS_LL_WINDOW(wp) (bt_quickfix(wp->w_buffer) && wp->w_llist_ref != NULL) // Quickfix and location list stack check helper macros -#define IS_QF_STACK(qi) (qi == &ql_info) -#define IS_LL_STACK(qi) (qi != &ql_info) +#define IS_QF_STACK(qi) (qi == &ql_info) +#define IS_LL_STACK(qi) (qi != &ql_info) -/* - * Return location list for window 'wp' - * For location list window, return the referenced location list - */ +// +// Return location list for window 'wp' +// For location list window, return the referenced location list +// #define GET_LOC_LIST(wp) (IS_LL_WINDOW(wp) ? wp->w_llist_ref : wp->w_llist) // Looking up a buffer can be slow if there are many. Remember the last one @@ -3109,24 +3109,24 @@ qf_win_pos_update ( return win != NULL; } -/* - * Check whether the given window is displaying the specified quickfix/location - * list buffer - */ +/// Checks whether the given window is displaying the specified +/// quickfix/location list buffer. static int is_qf_win(win_T *win, qf_info_T *qi) { - /* - * A window displaying the quickfix buffer will have the w_llist_ref field - * set to NULL. - * A window displaying a location list buffer will have the w_llist_ref - * pointing to the location list. - */ - if (bt_quickfix(win->w_buffer)) + // + // A window displaying the quickfix buffer will have the w_llist_ref field + // set to NULL. + // A window displaying a location list buffer will have the w_llist_ref + // pointing to the location list. + // + if (bt_quickfix(win->w_buffer)) { if ((IS_QF_STACK(qi) && win->w_llist_ref == NULL) - || (IS_LL_STACK(qi) && win->w_llist_ref == qi)) - return TRUE; + || (IS_LL_STACK(qi) && win->w_llist_ref == qi)) { + return true; + } + } - return FALSE; + return false; } /// Find a window displaying the quickfix/location list 'qi' diff --git a/src/nvim/testdir/test_options.vim b/src/nvim/testdir/test_options.vim index 7b640ee2ff..78afa929d0 100644 --- a/src/nvim/testdir/test_options.vim +++ b/src/nvim/testdir/test_options.vim @@ -51,6 +51,32 @@ function! Test_options() endtry call assert_equal('ok', caught) + " Check if the option-window is opened horizontally. + wincmd j + call assert_notequal('option-window', bufname('')) + wincmd k + call assert_equal('option-window', bufname('')) + " close option-window + close + + " Open the option-window vertically. + vert options + " Check if the option-window is opened vertically. + wincmd l + call assert_notequal('option-window', bufname('')) + wincmd h + call assert_equal('option-window', bufname('')) + " close option-window + close + + " Open the option-window in a new tab. + tab options + " Check if the option-window is opened in a tab. + normal gT + call assert_notequal('option-window', bufname('')) + normal gt + call assert_equal('option-window', bufname('')) + " close option-window close endfunction |