diff options
author | Jurica Bradaric <jbradaric@gmail.com> | 2016-02-10 22:37:39 +0100 |
---|---|---|
committer | Jurica Bradaric <jbradaric@gmail.com> | 2016-02-10 22:51:16 +0100 |
commit | 162d4bb3c621c5f2a19caa46cb35a2363744ac56 (patch) | |
tree | 14c7b5411e2bd7ab37a496fc5f7ba35e7bba7095 /src/nvim/normal.c | |
parent | 84281bf675f77f417d26a68611406ef43fd82f7f (diff) | |
download | rneovim-162d4bb3c621c5f2a19caa46cb35a2363744ac56.tar.gz rneovim-162d4bb3c621c5f2a19caa46cb35a2363744ac56.tar.bz2 rneovim-162d4bb3c621c5f2a19caa46cb35a2363744ac56.zip |
vim-patch:7.4.857
Problem: Dragging the current tab with the mouse doesn't work properly.
Solution: Take the current tabpage index into account. (Hirohito Higashi)
https://github.com/vim/vim/commit/4a4b821085847651b71d8ad9fab9f180635cb453
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r-- | src/nvim/normal.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 049d650f86..194aad4382 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -2347,9 +2347,12 @@ do_mouse ( if (mouse_row == 0 && firstwin->w_winrow > 0) { if (is_drag) { if (in_tab_line) { - tabpage_move(tab_page_click_defs[mouse_col].type == kStlClickTabClose - ? 9999 - : tab_page_click_defs[mouse_col].tabnr - 1); + if (tab_page_click_defs[mouse_col].type == kStlClickTabClose) { + tabpage_move(9999); + } else { + int tabnr = tab_page_click_defs[mouse_col].tabnr; + tabpage_move(tabnr < tabpage_index(curtab) ? tabnr - 1 : tabnr); + } } return false; } |