forked from aniani/vim
updated for version 7.3.227
Problem: Mac OS doesn't have the linewise clipboard fix. Solution: Also change the Mac OS file. (Bjorn Winckler)
This commit is contained in:
parent
251e191271
commit
54b08a5e78
@ -65,7 +65,7 @@ clip_mch_request_selection(VimClipboard *cbd)
|
|||||||
NSString *bestType = [pb availableTypeFromArray:supportedTypes];
|
NSString *bestType = [pb availableTypeFromArray:supportedTypes];
|
||||||
if (!bestType) goto releasepool;
|
if (!bestType) goto releasepool;
|
||||||
|
|
||||||
int motion_type = MCHAR;
|
int motion_type = MAUTO;
|
||||||
NSString *string = nil;
|
NSString *string = nil;
|
||||||
|
|
||||||
if ([bestType isEqual:VimPboardType])
|
if ([bestType isEqual:VimPboardType])
|
||||||
@ -89,9 +89,7 @@ clip_mch_request_selection(VimClipboard *cbd)
|
|||||||
|
|
||||||
if (!string)
|
if (!string)
|
||||||
{
|
{
|
||||||
/* Use NSStringPboardType. The motion type is set to line-wise if the
|
/* Use NSStringPboardType. The motion type is detected automatically.
|
||||||
* string contains at least one EOL character, otherwise it is set to
|
|
||||||
* character-wise (block-wise is never used).
|
|
||||||
*/
|
*/
|
||||||
NSMutableString *mstring =
|
NSMutableString *mstring =
|
||||||
[[pb stringForType:NSStringPboardType] mutableCopy];
|
[[pb stringForType:NSStringPboardType] mutableCopy];
|
||||||
@ -108,19 +106,13 @@ clip_mch_request_selection(VimClipboard *cbd)
|
|||||||
options:0 range:range];
|
options:0 range:range];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Scan for newline character to decide whether the string should be
|
|
||||||
* pasted line-wise or character-wise.
|
|
||||||
*/
|
|
||||||
motion_type = MCHAR;
|
|
||||||
if (0 < n || NSNotFound != [mstring rangeOfString:@"\n"].location)
|
|
||||||
motion_type = MLINE;
|
|
||||||
|
|
||||||
string = mstring;
|
string = mstring;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Default to MAUTO, uses MCHAR or MLINE depending on trailing NL. */
|
||||||
if (!(MCHAR == motion_type || MLINE == motion_type || MBLOCK == motion_type
|
if (!(MCHAR == motion_type || MLINE == motion_type || MBLOCK == motion_type
|
||||||
|| MAUTO == motion_type))
|
|| MAUTO == motion_type))
|
||||||
motion_type = MCHAR;
|
motion_type = MAUTO;
|
||||||
|
|
||||||
char_u *str = (char_u*)[string UTF8String];
|
char_u *str = (char_u*)[string UTF8String];
|
||||||
int len = [string lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
|
int len = [string lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
|
||||||
|
@ -709,6 +709,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
227,
|
||||||
/**/
|
/**/
|
||||||
226,
|
226,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user