mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Do not accept dropped text of type public.plain-text
The stringForType: method seems unable to handle this type, as a textClipping file dragged to TextMate (on 10.11) will result in a string with null bytes, presumably because the data was UTF-16 but interpreted as ASCII / MacRoman.
This change mirrors what we did for services in commit 062a939189
This commit is contained in:
@@ -3400,7 +3400,7 @@ static char const* kOakMenuItemTitle = "OakMenuItemTitle";
|
||||
{
|
||||
return @[ NSColorPboardType, NSFilenamesPboardType,
|
||||
@"WebURLsWithTitlesPboardType", (NSString*)kUTTypeURL, @"public.url-name", NSURLPboardType,
|
||||
@"public.plain-text" ];
|
||||
NSStringPboardType ];
|
||||
}
|
||||
|
||||
- (void)setDropMarkAtPoint:(NSPoint)aPoint
|
||||
@@ -3591,7 +3591,7 @@ static char const* kOakMenuItemTitle = "OakMenuItemTitle";
|
||||
documentView->set_ranges(ng::range_t(pos));
|
||||
documentView->insert(text::join(paths, "\n"));
|
||||
}
|
||||
else if(NSString* text = [pboard stringForType:[pboard availableTypeFromArray:@[ @"public.plain-text" ]]] ?: [pboard stringForType:NSStringPboardType])
|
||||
else if(NSString* text = [pboard stringForType:[pboard availableTypeFromArray:@[ NSStringPboardType ]]])
|
||||
{
|
||||
D(DBF_OakTextView_DragNDrop, bug("plain text: %s\n", [text UTF8String]););
|
||||
if(shouldMove)
|
||||
|
||||
Reference in New Issue
Block a user