mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.0.0990: with DBCS 'encoding' wrong pasting register into terminal
Problem: When 'encoding' is a double-byte encoding, pasting a register into a terminal ends up with the wrong characters. Solution: Convert from 'encoding' to utf-8. (Yasuhiro Matsumoto, closes #2007)
This commit is contained in:
parent
77f7474d08
commit
285f243e50
@ -38,6 +38,7 @@
|
|||||||
* in tl_scrollback are no longer used.
|
* in tl_scrollback are no longer used.
|
||||||
*
|
*
|
||||||
* TODO:
|
* TODO:
|
||||||
|
* - better check for blinking - reply from Thomas Dickey Aug 22
|
||||||
* - test for writing lines to terminal job does not work on MS-Windows
|
* - test for writing lines to terminal job does not work on MS-Windows
|
||||||
* - implement term_setsize()
|
* - implement term_setsize()
|
||||||
* - add test for giving error for invalid 'termsize' value.
|
* - add test for giving error for invalid 'termsize' value.
|
||||||
@ -45,6 +46,10 @@
|
|||||||
* - support minimal size when 'termsize' is empty?
|
* - support minimal size when 'termsize' is empty?
|
||||||
* - do not set bufhidden to "hide"? works like a buffer with changes.
|
* - do not set bufhidden to "hide"? works like a buffer with changes.
|
||||||
* document that CTRL-W :hide can be used.
|
* document that CTRL-W :hide can be used.
|
||||||
|
* - GUI: when using tabs, focus in terminal, click on tab does not work.
|
||||||
|
* - GUI: when 'confirm' is set and trying to exit Vim, dialog offers to save
|
||||||
|
* changes to "!shell".
|
||||||
|
* (justrajdeep, 2017 Aug 22)
|
||||||
* - command argument with spaces doesn't work #1999
|
* - command argument with spaces doesn't work #1999
|
||||||
* :terminal ls dir\ with\ spaces
|
* :terminal ls dir\ with\ spaces
|
||||||
* - implement job options when starting a terminal. Allow:
|
* - implement job options when starting a terminal. Allow:
|
||||||
@ -1261,9 +1266,31 @@ term_paste_register(int prev_c UNUSED)
|
|||||||
for (item = l->lv_first; item != NULL; item = item->li_next)
|
for (item = l->lv_first; item != NULL; item = item->li_next)
|
||||||
{
|
{
|
||||||
char_u *s = get_tv_string(&item->li_tv);
|
char_u *s = get_tv_string(&item->li_tv);
|
||||||
|
#ifdef WIN3264
|
||||||
|
char_u *tmp = s;
|
||||||
|
|
||||||
|
if (!enc_utf8 && enc_codepage > 0)
|
||||||
|
{
|
||||||
|
WCHAR *ret = NULL;
|
||||||
|
int length = 0;
|
||||||
|
|
||||||
|
MultiByteToWideChar_alloc(enc_codepage, 0, (char*)s, STRLEN(s),
|
||||||
|
&ret, &length);
|
||||||
|
if (ret != NULL)
|
||||||
|
{
|
||||||
|
WideCharToMultiByte_alloc(CP_UTF8, 0,
|
||||||
|
ret, length, (char **)&s, &length, 0, 0);
|
||||||
|
vim_free(ret);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
channel_send(curbuf->b_term->tl_job->jv_channel, PART_IN,
|
channel_send(curbuf->b_term->tl_job->jv_channel, PART_IN,
|
||||||
s, STRLEN(s), NULL);
|
s, STRLEN(s), NULL);
|
||||||
|
#ifdef WIN3264
|
||||||
|
if (tmp != s)
|
||||||
|
vim_free(s);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (item->li_next != NULL || type == MLINE)
|
if (item->li_next != NULL || type == MLINE)
|
||||||
channel_send(curbuf->b_term->tl_job->jv_channel, PART_IN,
|
channel_send(curbuf->b_term->tl_job->jv_channel, PART_IN,
|
||||||
(char_u *)"\r", 1, NULL);
|
(char_u *)"\r", 1, NULL);
|
||||||
|
@ -769,6 +769,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 */
|
||||||
|
/**/
|
||||||
|
990,
|
||||||
/**/
|
/**/
|
||||||
989,
|
989,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user