Mercurial > vim
diff src/ui.c @ 12487:3f16cf18386c v8.0.1123
patch 8.0.1123: cannot define a toolbar for a window
commit https://github.com/vim/vim/commit/1b9645de3c05f37b5c30e78f999351b0cf486ade
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Sep 17 23:03:31 2017 +0200
patch 8.0.1123: cannot define a toolbar for a window
Problem: Cannot define a toolbar for a window.
Solution: Add a window-local toolbar.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 17 Sep 2017 23:15:04 +0200 |
parents | 68d7bc045dbe |
children | 3ca08bf99396 |
line wrap: on
line diff
--- a/src/ui.c +++ b/src/ui.c @@ -2657,7 +2657,7 @@ retnomove: } #if defined(FEAT_CMDWIN) && defined(FEAT_CLIPBOARD) /* Continue a modeless selection in another window. */ - if (cmdwin_type != 0 && row < W_WINROW(curwin)) + if (cmdwin_type != 0 && row < curwin->w_winrow) return IN_OTHER_WIN; #endif return IN_BUFFER; @@ -2692,6 +2692,17 @@ retnomove: if (wp == NULL) return IN_UNKNOWN; dragwin = NULL; + +#ifdef FEAT_MENU + if (row == -1) + { + /* A click in the window toolbar does not enter another window or + * change Visual highlighting. */ + winbar_click(wp, col); + return IN_OTHER_WIN; + } +#endif + /* * winpos and height may change in win_enter()! */ @@ -2829,7 +2840,7 @@ retnomove: #if defined(FEAT_CMDWIN) && defined(FEAT_CLIPBOARD) /* Continue a modeless selection in another window. */ - if (cmdwin_type != 0 && row < W_WINROW(curwin)) + if (cmdwin_type != 0 && row < curwin->w_winrow) return IN_OTHER_WIN; #endif @@ -3117,7 +3128,12 @@ mouse_find_win(int *rowp, int *colp UNUS * exist. */ FOR_ALL_WINDOWS(wp) if (wp == fp->fr_win) + { +#ifdef FEAT_MENU + *rowp -= wp->w_winbar_height; +#endif return wp; + } return NULL; }