Skip to content

Commit ce0bd68

Browse files
committed
Merge branch 'vim'
Conflicts: src/auto/configure
2 parents 3f6a4d7 + 7ea9af9 commit ce0bd68

File tree

25 files changed

+355
-81
lines changed

25 files changed

+355
-81
lines changed

.hgtags

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2758,3 +2758,18 @@ b21b5dcdca2197fc86b9bde77bd6777f0e2d5175 v7-4-031
27582758
91f6a28e010d49ae73c13c85dbb8b14c9e5edb36 v7-4-033
27592759
22dfcd1494e4f7ea8ddc96e8dd895482e77e3b5a v7-4-034
27602760
5481f188dcbb7143596f2d470c7d674bf36efe64 v7-4-035
2761+
90e2f0729a0df249931a2dbe5f4310ba6c91cab4 v7-4-036
2762+
c3d379c2a115b957d82eaa5f2215b688f36a22da v7-4-037
2763+
6daa78b6b99a2ec07d20336db47c9f8165098062 v7-4-038
2764+
4dfba3df303c51fe31efd1255338e9fcbedc5401 v7-4-039
2765+
8336fd924e057d8c797043430325379d9a3ae37b v7-4-040
2766+
408f2a1a953feef25a2c5c96352c82674655e797 v7-4-041
2767+
70915ede509a737ac78c421f43c4447c9682ba41 v7-4-042
2768+
6d11572e2c8b1117b90adf588ff1467b185c1b57 v7-4-043
2769+
c0e3990aed3f179ef006e6de1458e9818c9ab896 v7-4-044
2770+
8ced827b2e8ba49f9ae0da2033670fee83e7b55b v7-4-045
2771+
68056d414f09fccb39219d7fde77fa06769ffa3b v7-4-046
2772+
c21b2f52f1dd003d860e3b574602ed3fdc2b4f1c v7-4-047
2773+
31c9acfeda8f1b84d51a480c1efbb56f384e76b1 v7-4-048
2774+
15c1b8a20da6d650ee3ed0e73c2e3832093b60dd v7-4-049
2775+
eb33cadafcabfc9cb3fc0741e169e84cafec11f8 v7-4-050

runtime/syntax/css.vim

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
" Nikolai Weibull (Add CSS2 support)
77
" Maintainer: Jules Wang <[email protected]>
88
" URL: https://github.com/JulesWang/css.vim
9-
" Last Change: 2013 Aug 28
9+
" Last Change: 2013 Sep 24
1010

1111
" For version 5.x: Clear all syntax items
1212
" For version 6.x: Quit when a syntax file was already loaded
@@ -21,9 +21,6 @@ elseif exists("b:current_syntax") && b:current_syntax == "css"
2121
finish
2222
endif
2323

24-
" Required for cssHacks
25-
setlocal iskeyword-=_
26-
2724
let s:cpo_save = &cpo
2825
set cpo&vim
2926

@@ -77,23 +74,20 @@ syn match cssValueAngle contained "[-+]\=\d\+\(\.\d*\)\=\(deg\|grad\|rad\)" cont
7774
syn match cssValueTime contained "+\=\d\+\(\.\d*\)\=\(ms\|s\)" contains=cssUnitDecorators
7875
syn match cssValueFrequency contained "+\=\d\+\(\.\d*\)\=\(Hz\|kHz\)" contains=cssUnitDecorators
7976

80-
8177
" @media
82-
syn match cssMedia "@media\>" nextgroup=cssMediaType,cssMediaFeature,cssMediaBlock,cssMediaComma,cssMediaKeyword2 skipwhite skipnl
83-
syn keyword cssMediaType contained screen print aural braille embossed handheld projection tty tv all contained skipwhite skipnl nextgroup=cssMediaFeature,cssMediaBlock
84-
syn match cssMediaFeature /\(and\)\=\s*(.\{-})/ contained skipwhite skipnl contains=cssMediaProp,cssValueLength,cssMediaKeyword,cssValueInteger,cssMediaAttr,cssVendor nextgroup=cssMediaFeature,cssMediaBlock,cssMediaComma
85-
syn keyword cssMediaKeyword and contained
86-
syn keyword cssMediaKeyword2 only not contained nextgroup=cssMediaType skipwhite skipnl
87-
78+
syn match cssMedia "@media\>" nextgroup=cssMediaQuery,cssMediaBlock skipwhite skipnl
79+
syn match cssMediaQuery /\(only\|not\)\=\s*[a-z]*\(\s\|,\)\@=\(\(\s\+and\)\=\s\+(.\{-})\)*/ contained skipwhite skipnl contains=cssMediaProp,cssValueLength,cssMediaKeyword,cssValueInteger,cssMediaAttr,cssVendor,cssMediaType nextgroup=cssMediaBlock,cssMediaComma
80+
syn keyword cssMediaType contained screen print aural braille embossed handheld projection tty tv speech all contained skipwhite skipnl
81+
syn keyword cssMediaKeyword only not and contained
8882
syn region cssMediaBlock transparent matchgroup=cssBraces start='{' end='}' contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssTagName,cssClassName,cssIdentifier,cssPseudoClass,cssSelectorOp,cssSelectorOp2,cssAttributeSelector fold
89-
syn match cssMediaComma "," nextgroup=cssMediaType,cssMediaKeyword2 skipwhite skipnl contained
83+
syn match cssMediaComma "," nextgroup=cssMediaQuery skipwhite skipnl contained
9084

9185
" Reference: http://www.w3.org/TR/css3-mediaqueries/
92-
syn keyword cssMediaProp contained width height orientation monochrome scan grid
86+
syn keyword cssMediaProp contained width height orientation scan grid
9387
syn match cssMediaProp contained /\(\(device\)-\)\=aspect-ratio/
9488
syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-pixel-ratio/
9589
syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-\(height\|width\)/
96-
syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(height\|width\|resolution\|color\(-index\)\=\)/
90+
syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(height\|width\|resolution\|monochrome\|color\(-index\)\=\)/
9791
syn keyword cssMediaAttr contained portrait landscape progressive interlace
9892

9993
" @page
@@ -103,14 +97,15 @@ syn match cssPageHeaderProp /@\(\(top\|left\|right\|bottom\)-\(left\|center\|rig
10397
syn keyword cssPageProp content size contained
10498

10599
" @keyframe
106-
syn match cssKeyFrame "@\(-.*-\)\=keyframes\>\(\s*\<\S*\>\)\=" nextgroup=cssKeyFrameBlock contains=cssVendor skipwhite skipnl
100+
syn match cssKeyFrame "@\(-[a-z]*-\)\=keyframes\>\(\s*\<\S*\>\)\=" nextgroup=cssKeyFrameBlock contains=cssVendor skipwhite skipnl
107101
syn region cssKeyFrameBlock contained transparent matchgroup=cssBraces start="{" end="}" contains=cssKeyFrameSelector,cssDefinition
108102
syn match cssKeyFrameSelector /\(\d*%\|from\|to\)\=/ contained skipwhite skipnl
109103

110104
" @import
111-
syn region cssInclude start=/@import\>/ end=/\ze;/ contains=cssComment,cssURL,cssUnicodeEscape,cssMediaType,cssStringQ,cssStringQQ
112-
syn region cssInclude start=/@charset\>/ end=/\ze;/ contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment
113-
syn region cssInclude start=/@namespace\>/ end=/\ze;/ contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment
105+
syn region cssInclude start=/@import\>/ end=/\ze;/ contains=cssComment,cssURL,cssUnicodeEscape,cssMediaQuery,cssStringQ,cssStringQQ,cssIncludeKeyword
106+
syn region cssInclude start=/@charset\>/ end=/\ze;/ contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssIncludeKeyword
107+
syn region cssInclude start=/@namespace\>/ end=/\ze;/ contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssIncludeKeyword
108+
syn match cssIncludeKeyword /\(@import\|@charset\|@namespace\)/ contained
114109

115110
" @font-face
116111
" http://www.w3.org/TR/css3-fonts/#at-font-face-rule
@@ -458,7 +453,7 @@ syn match cssPseudoClassId contained "\<\(input-\)\=placeholder\>"
458453

459454

460455
" Comment
461-
syn region cssComment start="/\*" end="\*/" contains=@Spell
456+
syn region cssComment start="/\*" end="\*/" contains=@Spell fold
462457

463458
syn match cssUnicodeEscape "\\\x\{1,6}\s\?"
464459
syn match cssSpecialCharQQ +\\"+ contained
@@ -593,6 +588,7 @@ if version >= 508 || !exists("did_css_syn_inits")
593588
HiLink cssColor Constant
594589
HiLink cssIdentifier Function
595590
HiLink cssInclude Include
591+
HiLink cssIncludeKeyword atKeyword
596592
HiLink cssImportant Special
597593
HiLink cssBraces Function
598594
HiLink cssBraceError Error
@@ -602,19 +598,17 @@ if version >= 508 || !exists("did_css_syn_inits")
602598
HiLink cssStringQQ String
603599
HiLink cssStringQ String
604600
HiLink cssAttributeSelector String
605-
HiLink cssMedia Special
601+
HiLink cssMedia atKeyword
606602
HiLink cssMediaType Special
607603
HiLink cssMediaComma Normal
608-
HiLink cssMediaFeature Normal
609604
HiLink cssMediaKeyword Statement
610-
HiLink cssMediaKeyword2 Statement
611605
HiLink cssMediaProp cssProp
612606
HiLink cssMediaAttr cssAttr
613-
HiLink cssPage Special
607+
HiLink cssPage atKeyword
614608
HiLink cssPagePseudo PreProc
615609
HiLink cssPageHeaderProp PreProc
616610
HiLink cssPageProp cssProp
617-
HiLink cssKeyFrame Special
611+
HiLink cssKeyFrame atKeyword
618612
HiLink cssKeyFrameSelector Constant
619613
HiLink cssFontDescriptor Special
620614
HiLink cssFontDescriptorFunction Constant
@@ -626,6 +620,7 @@ if version >= 508 || !exists("did_css_syn_inits")
626620
HiLink cssAttr Constant
627621
HiLink cssUnitDecorators Number
628622
HiLink cssNoise Noise
623+
HiLink atKeyword Comment
629624
delcommand HiLink
630625
endif
631626

src/auto/configure

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3643,6 +3643,24 @@ if test "$GCC" = yes; then
36433643
fi
36443644
fi
36453645

3646+
{ echo "$as_me:$LINENO: checking for recent clang version" >&5
3647+
echo $ECHO_N "checking for recent clang version... $ECHO_C" >&6; }
3648+
CLANG_VERSION_STRING=`"$CC" --version 2>/dev/null | sed -n -e 's/^.*clang.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/p'`
3649+
if test x"$CLANG_VERSION_STRING" != x"" ; then
3650+
CLANG_MAJOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*/\1/p'`
3651+
CLANG_MINOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*/\1/p'`
3652+
CLANG_REVISION=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\)/\1/p'`
3653+
CLANG_VERSION=`expr $CLANG_MAJOR '*' 1000000 '+' $CLANG_MINOR '*' 1000 '+' $CLANG_REVISION`
3654+
{ echo "$as_me:$LINENO: result: $CLANG_VERSION" >&5
3655+
echo "${ECHO_T}$CLANG_VERSION" >&6; }
3656+
if test "$CLANG_VERSION" -ge 500002075 ; then
3657+
CFLAGS=`echo "$CFLAGS" | sed -n -e 's/-fno-strength-reduce/ /p'`
3658+
fi
3659+
else
3660+
{ echo "$as_me:$LINENO: result: no" >&5
3661+
echo "${ECHO_T}no" >&6; }
3662+
fi
3663+
36463664
if test "$cross_compiling" = yes; then
36473665
{ echo "$as_me:$LINENO: result: cannot compile a simple program; if not cross compiling check CC and CFLAGS" >&5
36483666
echo "${ECHO_T}cannot compile a simple program; if not cross compiling check CC and CFLAGS" >&6; }

src/configure.in

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,29 @@ if test "$GCC" = yes; then
6262
fi
6363
fi
6464

65+
dnl clang-500.2.75 or around has abandoned -f[no-]strength-reduce and issues a
66+
dnl warning when that flag is passed to. Accordingly, adjust CFLAGS based on
67+
dnl the version number of the clang in use.
68+
dnl Note that this does not work to get the version of clang 3.1 or 3.2.
69+
AC_MSG_CHECKING(for recent clang version)
70+
CLANG_VERSION_STRING=`"$CC" --version 2>/dev/null | sed -n -e 's/^.*clang.*\([[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\).*$/\1/p'`
71+
if test x"$CLANG_VERSION_STRING" != x"" ; then
72+
CLANG_MAJOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/\([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*/\1/p'`
73+
CLANG_MINOR=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)\.[[0-9]][[0-9]]*/\1/p'`
74+
CLANG_REVISION=`echo "$CLANG_VERSION_STRING" | sed -n -e 's/[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\.\([[0-9]][[0-9]]*\)/\1/p'`
75+
CLANG_VERSION=`expr $CLANG_MAJOR '*' 1000000 '+' $CLANG_MINOR '*' 1000 '+' $CLANG_REVISION`
76+
AC_MSG_RESULT($CLANG_VERSION)
77+
dnl If you find the same issue with versions earlier than 500.2.75,
78+
dnl change the constant 500002075 below appropriately. To get the
79+
dnl integer corresponding to a version number, refer to the
80+
dnl definition of CLANG_VERSION above.
81+
if test "$CLANG_VERSION" -ge 500002075 ; then
82+
CFLAGS=`echo "$CFLAGS" | sed -n -e 's/-fno-strength-reduce/ /p'`
83+
fi
84+
else
85+
AC_MSG_RESULT(no)
86+
fi
87+
6588
dnl If configure thinks we are cross compiling, there might be something
6689
dnl wrong with the CC or CFLAGS settings, give a useful warning message
6790
if test "$cross_compiling" = yes; then

src/eval.c

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -915,12 +915,13 @@ eval_clear()
915915
/* autoloaded script names */
916916
ga_clear_strings(&ga_loaded);
917917

918-
/* script-local variables */
918+
/* Script-local variables. First clear all the variables and in a second
919+
* loop free the scriptvar_T, because a variable in one script might hold
920+
* a reference to the whole scope of another script. */
919921
for (i = 1; i <= ga_scripts.ga_len; ++i)
920-
{
921922
vars_clear(&SCRIPT_VARS(i));
923+
for (i = 1; i <= ga_scripts.ga_len; ++i)
922924
vim_free(SCRIPT_SV(i));
923-
}
924925
ga_clear(&ga_scripts);
925926

926927
/* unreferenced lists and dicts */
@@ -13073,9 +13074,18 @@ get_user_input(argvars, rettv, inputdialog)
1307313074
}
1307413075

1307513076
if (defstr != NULL)
13077+
{
13078+
# ifdef FEAT_EX_EXTRA
13079+
int save_ex_normal_busy = ex_normal_busy;
13080+
ex_normal_busy = 0;
13081+
# endif
1307613082
rettv->vval.v_string =
1307713083
getcmdline_prompt(inputsecret_flag ? NUL : '@', p, echo_attr,
1307813084
xp_type, xp_arg);
13085+
# ifdef FEAT_EX_EXTRA
13086+
ex_normal_busy = save_ex_normal_busy;
13087+
# endif
13088+
}
1307913089
if (inputdialog && rettv->vval.v_string == NULL
1308013090
&& argvars[1].v_type != VAR_UNKNOWN
1308113091
&& argvars[2].v_type != VAR_UNKNOWN)
@@ -24328,6 +24338,7 @@ do_string_sub(str, pat, sub, flags)
2432824338
garray_T ga;
2432924339
char_u *ret;
2433024340
char_u *save_cpo;
24341+
int zero_width;
2433124342

2433224343
/* Make 'cpoptions' empty, so that the 'l' flag doesn't work here */
2433324344
save_cpo = p_cpo;
@@ -24366,20 +24377,17 @@ do_string_sub(str, pat, sub, flags)
2436624377
(void)vim_regsub(&regmatch, sub, (char_u *)ga.ga_data
2436724378
+ ga.ga_len + i, TRUE, TRUE, FALSE);
2436824379
ga.ga_len += i + sublen - 1;
24369-
/* avoid getting stuck on a match with an empty string */
24370-
if (tail == regmatch.endp[0])
24380+
zero_width = (tail == regmatch.endp[0]
24381+
|| regmatch.startp[0] == regmatch.endp[0]);
24382+
tail = regmatch.endp[0];
24383+
if (*tail == NUL)
24384+
break;
24385+
if (zero_width)
2437124386
{
24372-
if (*tail == NUL)
24373-
break;
24387+
/* avoid getting stuck on a match with an empty string */
2437424388
*((char_u *)ga.ga_data + ga.ga_len) = *tail++;
2437524389
++ga.ga_len;
2437624390
}
24377-
else
24378-
{
24379-
tail = regmatch.endp[0];
24380-
if (*tail == NUL)
24381-
break;
24382-
}
2438324391
if (!do_all)
2438424392
break;
2438524393
}

src/ex_cmds.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4740,11 +4740,17 @@ do_sub(eap)
47404740
char_u *resp;
47414741
colnr_T sc, ec;
47424742

4743-
print_line_no_prefix(lnum, FALSE, FALSE);
4743+
print_line_no_prefix(lnum, do_number, do_list);
47444744

47454745
getvcol(curwin, &curwin->w_cursor, &sc, NULL, NULL);
47464746
curwin->w_cursor.col = regmatch.endpos[0].col - 1;
47474747
getvcol(curwin, &curwin->w_cursor, NULL, NULL, &ec);
4748+
if (do_number || curwin->w_p_nu)
4749+
{
4750+
int numw = number_width(curwin) + 1;
4751+
sc += numw;
4752+
ec += numw;
4753+
}
47484754
msg_start();
47494755
for (i = 0; i < (long)sc; ++i)
47504756
msg_putchar(' ');

src/if_tcl.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ typedef int HANDLE;
165165
*/
166166
static HANDLE hTclLib = NULL;
167167
Tcl_Interp* (*dll_Tcl_CreateInterp)();
168+
void (*dll_Tcl_FindExecutable)(const void *);
168169

169170
/*
170171
* Table of name to function pointer of tcl.
@@ -175,6 +176,7 @@ static struct {
175176
TCL_PROC* ptr;
176177
} tcl_funcname_table[] = {
177178
{"Tcl_CreateInterp", (TCL_PROC*)&dll_Tcl_CreateInterp},
179+
{"Tcl_FindExecutable", (TCL_PROC*)&dll_Tcl_FindExecutable},
178180
{NULL, NULL},
179181
};
180182

@@ -248,11 +250,12 @@ tcl_enabled(verbose)
248250
{
249251
Tcl_Interp *interp;
250252

253+
dll_Tcl_FindExecutable(find_executable_arg);
254+
251255
if (interp = dll_Tcl_CreateInterp())
252256
{
253257
if (Tcl_InitStubs(interp, DYNAMIC_TCL_VER, 0))
254258
{
255-
Tcl_FindExecutable(find_executable_arg);
256259
Tcl_DeleteInterp(interp);
257260
stubs_initialized = TRUE;
258261
}

src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ vim_main2(int argc UNUSED, char **argv UNUSED)
834834
starttermcap(); /* start termcap if not done by wait_return() */
835835
TIME_MSG("start termcap");
836836
#if defined(FEAT_TERMRESPONSE) && defined(FEAT_MBYTE)
837-
may_req_ambiguous_character_width();
837+
may_req_ambiguous_char_width();
838838
#endif
839839

840840
#ifdef FEAT_MOUSE

src/normal.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5271,8 +5271,12 @@ nv_zet(cap)
52715271
{
52725272
pos_T pos = curwin->w_cursor;
52735273

5274-
/* Find bad word under the cursor. */
5274+
/* Find bad word under the cursor. When 'spell' is
5275+
* off this fails and find_ident_under_cursor() is
5276+
* used below. */
5277+
emsg_off++;
52755278
len = spell_move_to(curwin, FORWARD, TRUE, TRUE, NULL);
5279+
emsg_off--;
52765280
if (len != 0 && curwin->w_cursor.col <= pos.col)
52775281
ptr = ml_get_pos(&curwin->w_cursor);
52785282
curwin->w_cursor = pos;

src/ops.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3808,9 +3808,6 @@ do_put(regname, dir, count, flags)
38083808
FALSE /* stop after 1 paste */
38093809
#endif
38103810
);
3811-
#ifdef FEAT_VISUAL
3812-
VIsual_active = FALSE;
3813-
#endif
38143811

38153812
curbuf->b_op_end = curwin->w_cursor;
38163813
/* For "CTRL-O p" in Insert mode, put cursor after last char */
@@ -3972,6 +3969,10 @@ do_put(regname, dir, count, flags)
39723969
if (regname == '=')
39733970
vim_free(y_array);
39743971

3972+
#ifdef FEAT_VISUAL
3973+
VIsual_active = FALSE;
3974+
#endif
3975+
39753976
/* If the cursor is past the end of the line put it at the end. */
39763977
adjust_cursor_eol();
39773978
}

0 commit comments

Comments
 (0)