Mercurial > vim
comparison src/ops.c @ 1924:75a69023117c v7.2.221
updated for version 7.2-221
author | vimboss |
---|---|
date | Wed, 01 Jul 2009 16:04:58 +0000 |
parents | a75120dc3e26 |
children | 2e915ea7110f |
comparison
equal
deleted
inserted
replaced
1923:3eb34a777f49 | 1924:75a69023117c |
---|---|
5589 | 5589 |
5590 /* Check it's OK */ | 5590 /* Check it's OK */ |
5591 if (dpy != NULL && str != NULL && motion_type >= 0 | 5591 if (dpy != NULL && str != NULL && motion_type >= 0 |
5592 && len < 1024*1024 && len > 0) | 5592 && len < 1024*1024 && len > 0) |
5593 { | 5593 { |
5594 #ifdef FEAT_MBYTE | |
5595 /* The CUT_BUFFER0 is supposed to always contain latin1. Convert from | |
5596 * 'enc' when it is a multi-byte encoding. When 'enc' is an 8-bit | |
5597 * encoding conversion usually doesn't work, so keep the text as-is. | |
5598 */ | |
5599 if (has_mbyte) | |
5600 { | |
5601 char_u *conv_str = str; | |
5602 vimconv_T vc; | |
5603 | |
5604 vc.vc_type = CONV_NONE; | |
5605 if (convert_setup(&vc, p_enc, (char_u *)"latin1") == OK) | |
5606 { | |
5607 conv_str = string_convert(&vc, str, (int*)&len); | |
5608 if (conv_str != NULL) | |
5609 { | |
5610 vim_free(str); | |
5611 str = conv_str; | |
5612 } | |
5613 convert_setup(&vc, NULL, NULL); | |
5614 } | |
5615 } | |
5616 #endif | |
5594 XStoreBuffer(dpy, (char *)str, (int)len, 0); | 5617 XStoreBuffer(dpy, (char *)str, (int)len, 0); |
5595 XFlush(dpy); | 5618 XFlush(dpy); |
5596 } | 5619 } |
5597 | 5620 |
5598 vim_free(str); | 5621 vim_free(str); |