Skip to content

Commit 2ec88ec

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 862f54d + 88e8f9f commit 2ec88ec

File tree

12 files changed

+79
-64
lines changed

12 files changed

+79
-64
lines changed

src/Make_cyg_ming.mak

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,17 +258,25 @@ endif
258258
ifndef PYTHON3_VER
259259
PYTHON3_VER=31
260260
endif
261+
ifndef DYNAMIC_PYTHON3_DLL
262+
DYNAMIC_PYTHON3_DLL=python$(PYTHON3_VER).dll
263+
endif
264+
ifdef PYTHON3_HOME
265+
PYTHON3_HOME_DEF=-DPYTHON3_HOME=\"$(PYTHON3_HOME)\"
266+
endif
261267

262268
ifeq (no,$(DYNAMIC_PYTHON3))
263-
PYTHON3LIB=-L$(PYTHON3)/libs -lPYTHON$(PYTHON3_VER)
269+
PYTHON3LIB=-L$(PYTHON3)/libs -lpython$(PYTHON3_VER)
264270
endif
265271

272+
ifndef PYTHON3INC
266273
ifeq ($(CROSS),no)
267274
PYTHON3INC=-I $(PYTHON3)/include
268275
else
269276
PYTHON3INC=-I $(PYTHON3)/win32inc
270277
endif
271278
endif
279+
endif
272280

273281
# TCL interface:
274282
# TCL=[Path to TCL directory] (Set inside Make_cyg.mak or Make_ming.mak)
@@ -482,7 +490,7 @@ endif
482490
ifdef PYTHON3
483491
CFLAGS += -DFEAT_PYTHON3
484492
ifeq (yes, $(DYNAMIC_PYTHON3))
485-
CFLAGS += -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"PYTHON$(PYTHON3_VER).dll\"
493+
CFLAGS += -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"$(DYNAMIC_PYTHON3_DLL)\"
486494
endif
487495
endif
488496

@@ -814,7 +822,7 @@ $(OUTDIR)/if_python.o : if_python.c if_py_both.h $(INCL)
814822
$(CC) -c $(CFLAGS) $(PYTHONINC) $(PYTHON_HOME_DEF) $< -o $@
815823

816824
$(OUTDIR)/if_python3.o : if_python3.c if_py_both.h $(INCL)
817-
$(CC) -c $(CFLAGS) $(PYTHON3INC) $< -o $@
825+
$(CC) -c $(CFLAGS) $(PYTHON3INC) $(PYTHON3_HOME_DEF) $< -o $@
818826

819827
$(OUTDIR)/%.o : %.c $(INCL)
820828
$(CC) -c $(CFLAGS) $< -o $@

src/auto/configure

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4811,8 +4811,8 @@ if test "${with_features+set}" = set; then :
48114811
withval=$with_features; features="$withval"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $features" >&5
48124812
$as_echo "$features" >&6; }
48134813
else
4814-
features="normal"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: Defaulting to normal" >&5
4815-
$as_echo "Defaulting to normal" >&6; }
4814+
features="huge"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: Defaulting to huge" >&5
4815+
$as_echo "Defaulting to huge" >&6; }
48164816
fi
48174817

48184818

src/charset.c

Lines changed: 41 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,32 @@ static int chartab_initialized = FALSE;
3030
#define RESET_CHARTAB(buf, c) (buf)->b_chartab[(unsigned)(c) >> 3] &= ~(1 << ((c) & 0x7))
3131
#define GET_CHARTAB(buf, c) ((buf)->b_chartab[(unsigned)(c) >> 3] & (1 << ((c) & 0x7)))
3232

33+
/* table used below, see init_chartab() for an explanation */
34+
static char_u g_chartab[256];
35+
36+
/*
37+
* Flags for g_chartab[].
38+
*/
39+
#define CT_CELL_MASK 0x07 /* mask: nr of display cells (1, 2 or 4) */
40+
#define CT_PRINT_CHAR 0x10 /* flag: set for printable chars */
41+
#define CT_ID_CHAR 0x20 /* flag: set for ID chars */
42+
#define CT_FNAME_CHAR 0x40 /* flag: set for file name chars */
43+
3344
/*
34-
* Fill chartab[]. Also fills curbuf->b_chartab[] with flags for keyword
45+
* Fill g_chartab[]. Also fills curbuf->b_chartab[] with flags for keyword
3546
* characters for current buffer.
3647
*
3748
* Depends on the option settings 'iskeyword', 'isident', 'isfname',
3849
* 'isprint' and 'encoding'.
3950
*
40-
* The index in chartab[] depends on 'encoding':
51+
* The index in g_chartab[] depends on 'encoding':
4152
* - For non-multi-byte index with the byte (same as the character).
4253
* - For DBCS index with the first byte.
4354
* - For UTF-8 index with the character (when first byte is up to 0x80 it is
4455
* the same as the character, if the first byte is 0x80 and above it depends
4556
* on further bytes).
4657
*
47-
* The contents of chartab[]:
58+
* The contents of g_chartab[]:
4859
* - The lower two bits, masked by CT_CELL_MASK, give the number of display
4960
* cells the character occupies (1 or 2). Not valid for UTF-8 above 0x80.
5061
* - CT_PRINT_CHAR bit is set when the character is printable (no need to
@@ -86,36 +97,36 @@ buf_init_chartab(buf, global)
8697
*/
8798
c = 0;
8899
while (c < ' ')
89-
chartab[c++] = (dy_flags & DY_UHEX) ? 4 : 2;
100+
g_chartab[c++] = (dy_flags & DY_UHEX) ? 4 : 2;
90101
#ifdef EBCDIC
91102
while (c < 255)
92103
#else
93104
while (c <= '~')
94105
#endif
95-
chartab[c++] = 1 + CT_PRINT_CHAR;
106+
g_chartab[c++] = 1 + CT_PRINT_CHAR;
96107
#ifdef FEAT_FKMAP
97108
if (p_altkeymap)
98109
{
99110
while (c < YE)
100-
chartab[c++] = 1 + CT_PRINT_CHAR;
111+
g_chartab[c++] = 1 + CT_PRINT_CHAR;
101112
}
102113
#endif
103114
while (c < 256)
104115
{
105116
#ifdef FEAT_MBYTE
106117
/* UTF-8: bytes 0xa0 - 0xff are printable (latin1) */
107118
if (enc_utf8 && c >= 0xa0)
108-
chartab[c++] = CT_PRINT_CHAR + 1;
119+
g_chartab[c++] = CT_PRINT_CHAR + 1;
109120
/* euc-jp characters starting with 0x8e are single width */
110121
else if (enc_dbcs == DBCS_JPNU && c == 0x8e)
111-
chartab[c++] = CT_PRINT_CHAR + 1;
122+
g_chartab[c++] = CT_PRINT_CHAR + 1;
112123
/* other double-byte chars can be printable AND double-width */
113124
else if (enc_dbcs != 0 && MB_BYTE2LEN(c) == 2)
114-
chartab[c++] = CT_PRINT_CHAR + 2;
125+
g_chartab[c++] = CT_PRINT_CHAR + 2;
115126
else
116127
#endif
117128
/* the rest is unprintable by default */
118-
chartab[c++] = (dy_flags & DY_UHEX) ? 4 : 2;
129+
g_chartab[c++] = (dy_flags & DY_UHEX) ? 4 : 2;
119130
}
120131

121132
#ifdef FEAT_MBYTE
@@ -124,7 +135,7 @@ buf_init_chartab(buf, global)
124135
if ((enc_dbcs != 0 && MB_BYTE2LEN(c) > 1)
125136
|| (enc_dbcs == DBCS_JPNU && c == 0x8e)
126137
|| (enc_utf8 && c >= 0xa0))
127-
chartab[c] |= CT_FNAME_CHAR;
138+
g_chartab[c] |= CT_FNAME_CHAR;
128139
#endif
129140
}
130141

@@ -232,9 +243,9 @@ buf_init_chartab(buf, global)
232243
if (i == 0) /* (re)set ID flag */
233244
{
234245
if (tilde)
235-
chartab[c] &= ~CT_ID_CHAR;
246+
g_chartab[c] &= ~CT_ID_CHAR;
236247
else
237-
chartab[c] |= CT_ID_CHAR;
248+
g_chartab[c] |= CT_ID_CHAR;
238249
}
239250
else if (i == 1) /* (re)set printable */
240251
{
@@ -256,23 +267,23 @@ buf_init_chartab(buf, global)
256267
{
257268
if (tilde)
258269
{
259-
chartab[c] = (chartab[c] & ~CT_CELL_MASK)
270+
g_chartab[c] = (g_chartab[c] & ~CT_CELL_MASK)
260271
+ ((dy_flags & DY_UHEX) ? 4 : 2);
261-
chartab[c] &= ~CT_PRINT_CHAR;
272+
g_chartab[c] &= ~CT_PRINT_CHAR;
262273
}
263274
else
264275
{
265-
chartab[c] = (chartab[c] & ~CT_CELL_MASK) + 1;
266-
chartab[c] |= CT_PRINT_CHAR;
276+
g_chartab[c] = (g_chartab[c] & ~CT_CELL_MASK) + 1;
277+
g_chartab[c] |= CT_PRINT_CHAR;
267278
}
268279
}
269280
}
270281
else if (i == 2) /* (re)set fname flag */
271282
{
272283
if (tilde)
273-
chartab[c] &= ~CT_FNAME_CHAR;
284+
g_chartab[c] &= ~CT_FNAME_CHAR;
274285
else
275-
chartab[c] |= CT_FNAME_CHAR;
286+
g_chartab[c] |= CT_FNAME_CHAR;
276287
}
277288
else /* i == 3 */ /* (re)set keyword flag */
278289
{
@@ -531,9 +542,9 @@ str_foldcase(str, orglen, buf, buflen)
531542
#endif
532543

533544
/*
534-
* Catch 22: chartab[] can't be initialized before the options are
545+
* Catch 22: g_chartab[] can't be initialized before the options are
535546
* initialized, and initializing options may cause transchar() to be called!
536-
* When chartab_initialized == FALSE don't use chartab[].
547+
* When chartab_initialized == FALSE don't use g_chartab[].
537548
* Does NOT work for multi-byte characters, c must be <= 255.
538549
* Also doesn't work for the first byte of a multi-byte, "c" must be a
539550
* character!
@@ -718,7 +729,7 @@ byte2cells(b)
718729
if (enc_utf8 && b >= 0x80)
719730
return 0;
720731
#endif
721-
return (chartab[b] & CT_CELL_MASK);
732+
return (g_chartab[b] & CT_CELL_MASK);
722733
}
723734

724735
/*
@@ -748,7 +759,7 @@ char2cells(c)
748759
}
749760
}
750761
#endif
751-
return (chartab[c & 0xff] & CT_CELL_MASK);
762+
return (g_chartab[c & 0xff] & CT_CELL_MASK);
752763
}
753764

754765
/*
@@ -765,7 +776,7 @@ ptr2cells(p)
765776
return utf_ptr2cells(p);
766777
/* For DBCS we can tell the cell count from the first byte. */
767778
#endif
768-
return (chartab[*p] & CT_CELL_MASK);
779+
return (g_chartab[*p] & CT_CELL_MASK);
769780
}
770781

771782
/*
@@ -900,7 +911,7 @@ win_linetabsize(wp, line, len)
900911
vim_isIDc(c)
901912
int c;
902913
{
903-
return (c > 0 && c < 0x100 && (chartab[c] & CT_ID_CHAR));
914+
return (c > 0 && c < 0x100 && (g_chartab[c] & CT_ID_CHAR));
904915
}
905916

906917
/*
@@ -966,7 +977,7 @@ vim_iswordp_buf(p, buf)
966977
vim_isfilec(c)
967978
int c;
968979
{
969-
return (c >= 0x100 || (c > 0 && (chartab[c] & CT_FNAME_CHAR)));
980+
return (c >= 0x100 || (c > 0 && (g_chartab[c] & CT_FNAME_CHAR)));
970981
}
971982

972983
/*
@@ -999,7 +1010,7 @@ vim_isprintc(c)
9991010
if (enc_utf8 && c >= 0x100)
10001011
return utf_printable(c);
10011012
#endif
1002-
return (c >= 0x100 || (c > 0 && (chartab[c] & CT_PRINT_CHAR)));
1013+
return (c >= 0x100 || (c > 0 && (g_chartab[c] & CT_PRINT_CHAR)));
10031014
}
10041015

10051016
/*
@@ -1016,7 +1027,7 @@ vim_isprintc_strict(c)
10161027
if (enc_utf8 && c >= 0x100)
10171028
return utf_printable(c);
10181029
#endif
1019-
return (c >= 0x100 || (c > 0 && (chartab[c] & CT_PRINT_CHAR)));
1030+
return (c >= 0x100 || (c > 0 && (g_chartab[c] & CT_PRINT_CHAR)));
10201031
}
10211032

10221033
/*
@@ -1368,7 +1379,7 @@ getvcol(wp, pos, start, cursor, end)
13681379
if (enc_utf8 && c >= 0x80)
13691380
incr = utf_ptr2cells(ptr);
13701381
else
1371-
incr = CHARSIZE(c);
1382+
incr = g_chartab[c] & CT_CELL_MASK;
13721383

13731384
/* If a double-cell char doesn't fit at the end of a line
13741385
* it wraps to the next line, it's like this char is three
@@ -1382,7 +1393,7 @@ getvcol(wp, pos, start, cursor, end)
13821393
}
13831394
else
13841395
#endif
1385-
incr = CHARSIZE(c);
1396+
incr = g_chartab[c] & CT_CELL_MASK;
13861397
}
13871398

13881399
if (posptr != NULL && ptr >= posptr) /* character at pos->col */

src/configure.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ dnl Check user requested features.
455455
AC_MSG_CHECKING(--with-features argument)
456456
AC_ARG_WITH(features, [ --with-features=TYPE tiny, small, normal, big or huge (default: normal)],
457457
features="$withval"; AC_MSG_RESULT($features),
458-
features="normal"; AC_MSG_RESULT(Defaulting to normal))
458+
features="huge"; AC_MSG_RESULT(Defaulting to huge))
459459

460460
dovimdiff=""
461461
dogvimdiff=""

src/feature.h

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,25 @@
5454
#endif
5555

5656
/*
57-
* These executables are made available with the +big feature, because they
58-
* are supposed to have enough RAM: Win32 (console & GUI), dos32, OS/2 and VMS.
57+
* For Unix, Mac and Win32 use +huge by default. These days CPUs are fast and
58+
* Memory is cheap.
59+
* Use +big for older systems: Other MS-Windows, dos32, OS/2 and VMS.
5960
* The dos16 version has very little RAM available, use +small.
61+
* Otherwise use +normal
6062
*/
6163
#if !defined(FEAT_TINY) && !defined(FEAT_SMALL) && !defined(FEAT_NORMAL) \
6264
&& !defined(FEAT_BIG) && !defined(FEAT_HUGE)
63-
# if defined(MSWIN) || defined(DJGPP) || defined(VMS) || defined(MACOS) || defined(AMIGA)
64-
# define FEAT_BIG
65+
# if defined(UNIX) || defined(WIN3264) || defined(MACOS)
66+
# define FEAT_HUGE
6567
# else
66-
# ifdef MSDOS
67-
# define FEAT_SMALL
68+
# if defined(MSWIN) || defined(DJGPP) || defined(VMS) || defined(MACOS) || defined(AMIGA)
69+
# define FEAT_BIG
6870
# else
69-
# define FEAT_NORMAL
71+
# ifdef MSDOS
72+
# define FEAT_SMALL
73+
# else
74+
# define FEAT_NORMAL
75+
# endif
7076
# endif
7177
# endif
7278
#endif

src/globals.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,9 +1014,6 @@ EXTERN int vgetc_im_active; /* Input Method was active for last
10141014
#endif
10151015
EXTERN int maptick INIT(= 0); /* tick for each non-mapped char */
10161016

1017-
EXTERN char_u chartab[256]; /* table used in charset.c; See
1018-
init_chartab() for explanation */
1019-
10201017
EXTERN int must_redraw INIT(= 0); /* type of redraw necessary */
10211018
EXTERN int skip_redraw INIT(= FALSE); /* skip redraw once */
10221019
EXTERN int do_redraw INIT(= FALSE); /* extra redraw once */

src/macros.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,6 @@
121121
/* Returns empty string if it is NULL. */
122122
#define EMPTY_IF_NULL(x) ((x) ? (x) : (u_char *)"")
123123

124-
/* macro version of chartab().
125-
* Only works with values 0-255!
126-
* Doesn't work for UTF-8 mode with chars >= 0x80. */
127-
#define CHARSIZE(c) (chartab[c] & CT_CELL_MASK)
128-
129124
#ifdef FEAT_LANGMAP
130125
/*
131126
* Adjust chars in a language according to 'langmap' option.

src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,8 +1655,8 @@ init_locale()
16551655
/* Initialize the gettext library */
16561656
dyn_libintl_init();
16571657
# endif
1658-
/* expand_env() doesn't work yet, because chartab[] is not initialized
1659-
* yet, call vim_getenv() directly */
1658+
/* expand_env() doesn't work yet, because g_chartab[] is not
1659+
* initialized yet, call vim_getenv() directly */
16601660
p = vim_getenv((char_u *)"VIMRUNTIME", &mustfree);
16611661
if (p != NULL && *p != NUL)
16621662
{

src/option.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6014,9 +6014,9 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
60146014
#endif
60156015

60166016
/*
6017-
* 'isident', 'iskeyword', 'isprint or 'isfname' option: refill chartab[]
6017+
* 'isident', 'iskeyword', 'isprint or 'isfname' option: refill g_chartab[]
60186018
* If the new option is invalid, use old value. 'lisp' option: refill
6019-
* chartab[] for '-' char
6019+
* g_chartab[] for '-' char
60206020
*/
60216021
else if ( varp == &p_isi
60226022
|| varp == &(curbuf->b_p_isk)

src/screen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4598,7 +4598,7 @@ win_line(wp, lnum, startrow, endrow, nochange)
45984598
/*
45994599
* Handling of non-printable characters.
46004600
*/
4601-
if (!(chartab[c & 0xff] & CT_PRINT_CHAR))
4601+
if (!vim_isprintc(c))
46024602
{
46034603
/*
46044604
* when getting a character from the file, we may have to

0 commit comments

Comments
 (0)