Skip to content

Commit 7e1b43e

Browse files
committed
Fix tab dragging not working when dragging a tab to the right
Vim's tabmove has two positions where it doesn't do anything, so need to add 1 to index when moving tab to the right. Fix #257
1 parent e126fa9 commit 7e1b43e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/MacVim/MMBackend.m

+8
Original file line numberDiff line numberDiff line change
@@ -2013,6 +2013,14 @@ - (void)handleInputEvent:(int)msgid data:(NSData *)data
20132013
// based.
20142014
int idx = *((int*)bytes);
20152015

2016+
// Also, this index doesn't take itself into account, so if the move is
2017+
// to a later tab, need to add one to it since Vim's tabpage_move *does*
2018+
// count the current tab.
2019+
int curtab_index = tabpage_index(curtab);
2020+
if (idx >= curtab_index) {
2021+
idx += 1;
2022+
}
2023+
20162024
tabpage_move(idx);
20172025
} else if (SetTextDimensionsMsgID == msgid || LiveResizeMsgID == msgid
20182026
|| SetTextDimensionsNoResizeWindowMsgID == msgid

0 commit comments

Comments
 (0)