Merge pull request #789 from ychin/fix_tabs_dragging

Fix dragging tabs not working properly
This commit is contained in:
Yee Cheng Chin
2018-11-25 01:56:08 -08:00
committed by GitHub
2 changed files with 12 additions and 1 deletions
+8
View File
@@ -2013,6 +2013,14 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
// based.
int idx = *((int*)bytes);
// Also, this index doesn't take itself into account, so if the move is
// to a later tab, need to add one to it since Vim's tabpage_move *does*
// count the current tab.
int curtab_index = tabpage_index(curtab);
if (idx >= curtab_index) {
idx += 1;
}
tabpage_move(idx);
} else if (SetTextDimensionsMsgID == msgid || LiveResizeMsgID == msgid
|| SetTextDimensionsNoResizeWindowMsgID == msgid
@@ -338,7 +338,10 @@
if(([self state] == NSOnState) && ([[_controlView styleName] isEqualToString:@"Metal"]))
cellFrame.size.width += 1.0;
[_controlView lockFocus];
NSBitmapImageRep *rep = [[[NSBitmapImageRep alloc] initWithFocusedViewRect:cellFrame] autorelease];
NSBitmapImageRep *rep = [[self controlView] bitmapImageRepForCachingDisplayInRect:cellFrame];
[[self controlView] cacheDisplayInRect:cellFrame toBitmapImageRep:rep];
[_controlView unlockFocus];
NSImage *image = [[[NSImage alloc] initWithSize:[rep size]] autorelease];
[image addRepresentation:rep];