Skip to content

Commit a7a8d32

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 2ecbffb + 33d66bd commit a7a8d32

6 files changed

Lines changed: 68 additions & 5 deletions

File tree

src/Make_cyg_ming.mak

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ endif
340340
# TCL_VER=[TCL version, eg 83, 84] (default is 86)
341341
# TCL_VER_LONG=[Tcl version, eg 8.3] (default is 8.6)
342342
# You must set TCL_VER_LONG when you set TCL_VER.
343+
# TCL_DLL=[TCL dll name, eg tcl86.dll] (default is tcl86.dll)
343344
ifdef TCL
344345
ifndef DYNAMIC_TCL
345346
DYNAMIC_TCL=yes
@@ -350,6 +351,9 @@ endif
350351
ifndef TCL_VER_LONG
351352
TCL_VER_LONG = 8.6
352353
endif
354+
ifndef TCL_DLL
355+
TCL_DLL = tcl$(TCL_VER).dll
356+
endif
353357
TCLINC += -I$(TCL)/include
354358
endif
355359

@@ -526,7 +530,7 @@ endif
526530
ifdef TCL
527531
CFLAGS += -DFEAT_TCL $(TCLINC)
528532
ifeq (yes, $(DYNAMIC_TCL))
529-
CFLAGS += -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl$(TCL_VER).dll\" -DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
533+
CFLAGS += -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"$(TCL_DLL)\" -DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
530534
endif
531535
endif
532536

src/Make_mvc.mak

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
# TCL_VER=[Tcl version, e.g. 80, 83] (default is 86)
8585
# TCL_VER_LONG=[Tcl version, eg 8.3] (default is 8.6)
8686
# You must set TCL_VER_LONG when you set TCL_VER.
87+
# TCL_DLL=[Tcl dll name, e.g. tcl86.dll] (default is tcl86.dll)
8788
#
8889
# Cscope support: CSCOPE=yes
8990
#
@@ -832,7 +833,9 @@ TCL_VER_LONG = 8.6
832833
!message Tcl requested (version $(TCL_VER)) - root dir is "$(TCL)"
833834
!if "$(DYNAMIC_TCL)" == "yes"
834835
!message Tcl DLL will be loaded dynamically
836+
!ifndef TCL_DLL
835837
TCL_DLL = tcl$(TCL_VER).dll
838+
!endif
836839
CFLAGS = $(CFLAGS) -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"$(TCL_DLL)\" \
837840
-DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
838841
TCL_OBJ = $(OUTDIR)\if_tcl.obj

src/fileio.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1370,7 +1370,8 @@ readfile(
13701370
* Decrypt the read bytes. This is done before checking for
13711371
* EOF because the crypt layer may be buffering.
13721372
*/
1373-
if (cryptkey != NULL && size > 0)
1373+
if (cryptkey != NULL && curbuf->b_cryptstate != NULL
1374+
&& size > 0)
13741375
{
13751376
if (crypt_works_inplace(curbuf->b_cryptstate))
13761377
{

src/terminal.c

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,18 @@
3838
* in tl_scrollback are no longer used.
3939
*
4040
* TODO:
41+
* - better check for blinking - reply from Thomas Dickey Aug 22
4142
* - test for writing lines to terminal job does not work on MS-Windows
4243
* - implement term_setsize()
4344
* - add test for giving error for invalid 'termsize' value.
4445
* - support minimal size when 'termsize' is "rows*cols".
4546
* - support minimal size when 'termsize' is empty?
4647
* - do not set bufhidden to "hide"? works like a buffer with changes.
4748
* document that CTRL-W :hide can be used.
49+
* - GUI: when using tabs, focus in terminal, click on tab does not work.
50+
* - GUI: when 'confirm' is set and trying to exit Vim, dialog offers to save
51+
* changes to "!shell".
52+
* (justrajdeep, 2017 Aug 22)
4853
* - command argument with spaces doesn't work #1999
4954
* :terminal ls dir\ with\ spaces
5055
* - implement job options when starting a terminal. Allow:
@@ -945,7 +950,7 @@ move_terminal_to_buffer(term_T *term)
945950
width = 1;
946951
vim_memset(p + pos.col, 0, sizeof(cellattr_T));
947952
if (ga_grow(&ga, 1) == OK)
948-
ga.ga_len += mb_char2bytes(' ',
953+
ga.ga_len += utf_char2bytes(' ',
949954
(char_u *)ga.ga_data + ga.ga_len);
950955
}
951956
else
@@ -1266,9 +1271,31 @@ term_paste_register(int prev_c UNUSED)
12661271
for (item = l->lv_first; item != NULL; item = item->li_next)
12671272
{
12681273
char_u *s = get_tv_string(&item->li_tv);
1274+
#ifdef WIN3264
1275+
char_u *tmp = s;
1276+
1277+
if (!enc_utf8 && enc_codepage > 0)
1278+
{
1279+
WCHAR *ret = NULL;
1280+
int length = 0;
12691281

1282+
MultiByteToWideChar_alloc(enc_codepage, 0, (char*)s, STRLEN(s),
1283+
&ret, &length);
1284+
if (ret != NULL)
1285+
{
1286+
WideCharToMultiByte_alloc(CP_UTF8, 0,
1287+
ret, length, (char **)&s, &length, 0, 0);
1288+
vim_free(ret);
1289+
}
1290+
}
1291+
#endif
12701292
channel_send(curbuf->b_term->tl_job->jv_channel, PART_IN,
12711293
s, STRLEN(s), NULL);
1294+
#ifdef WIN3264
1295+
if (tmp != s)
1296+
vim_free(s);
1297+
#endif
1298+
12721299
if (item->li_next != NULL || type == MLINE)
12731300
channel_send(curbuf->b_term->tl_job->jv_channel, PART_IN,
12741301
(char_u *)"\r", 1, NULL);
@@ -1815,6 +1842,24 @@ handle_settermprop(
18151842
* displayed */
18161843
if (*skipwhite((char_u *)value->string) == NUL)
18171844
term->tl_title = NULL;
1845+
#ifdef WIN3264
1846+
else if (!enc_utf8 && enc_codepage > 0)
1847+
{
1848+
WCHAR *ret = NULL;
1849+
int length = 0;
1850+
1851+
MultiByteToWideChar_alloc(CP_UTF8, 0,
1852+
(char*)value->string, STRLEN(value->string),
1853+
&ret, &length);
1854+
if (ret != NULL)
1855+
{
1856+
WideCharToMultiByte_alloc(enc_codepage, 0,
1857+
ret, length, (char**)&term->tl_title,
1858+
&length, 0, 0);
1859+
vim_free(ret);
1860+
}
1861+
}
1862+
#endif
18181863
else
18191864
term->tl_title = vim_strsave((char_u *)value->string);
18201865
vim_free(term->tl_status_text);
@@ -1921,7 +1966,7 @@ handle_pushline(int cols, const VTermScreenCell *cells, void *user)
19211966
break;
19221967
}
19231968
for (i = 0; (c = cells[col].chars[i]) > 0 || i == 0; ++i)
1924-
ga.ga_len += mb_char2bytes(c == NUL ? ' ' : c,
1969+
ga.ga_len += utf_char2bytes(c == NUL ? ' ' : c,
19251970
(char_u *)ga.ga_data + ga.ga_len);
19261971
p[col].width = cells[col].width;
19271972
p[col].attrs = cells[col].attrs;

src/undo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ undo_write(bufinfo_T *bi, char_u *ptr, size_t len)
921921
static int
922922
undo_flush(bufinfo_T *bi)
923923
{
924-
if (bi->bi_buffer != NULL && bi->bi_used > 0)
924+
if (bi->bi_buffer != NULL && bi->bi_state != NULL && bi->bi_used > 0)
925925
{
926926
crypt_encode_inplace(bi->bi_state, bi->bi_buffer, bi->bi_used);
927927
if (fwrite(bi->bi_buffer, bi->bi_used, (size_t)1, bi->bi_fp) != 1)

src/version.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,16 @@ static char *(features[]) =
784784

785785
static int included_patches[] =
786786
{ /* Add new patch number below this line */
787+
/**/
788+
992,
789+
/**/
790+
991,
791+
/**/
792+
990,
793+
/**/
794+
989,
795+
/**/
796+
988,
787797
/**/
788798
987,
789799
/**/

0 commit comments

Comments
 (0)