Skip to content

Commit ab44a4c

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 54d4387 + 9baf297 commit ab44a4c

16 files changed

Lines changed: 233 additions & 97 deletions

runtime/defaults.vim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
" The default vimrc file.
22
"
33
" Maintainer: Bram Moolenaar <[email protected]>
4-
" Last change: 2016 Aug 20
4+
" Last change: 2016 Aug 21
55
"
66
" This is loaded if no vimrc file was found.
77
" Except when Vim is run with "-u NONE" or "-C".
@@ -107,9 +107,9 @@ if !exists(":DiffOrig")
107107
\ | wincmd p | diffthis
108108
endif
109109

110-
if has('langmap') && exists('+langnoremap')
110+
if has('langmap') && exists('+langremap')
111111
" Prevent that the langmap option applies to characters that result from a
112-
" mapping. If unset (default), this may break plugins (but it's backward
112+
" mapping. If set (default), this may break plugins (but it's backward
113113
" compatible).
114-
set langnoremap
114+
set nolangremap
115115
endif

runtime/doc/tabpage.txt

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,21 @@ In the GUI tab pages line you can use the right mouse button to open menu.
8787
Execute {cmd} and when it opens a new window open a new tab
8888
page instead. Doesn't work for |:diffsplit|, |:diffpatch|,
8989
|:execute| and |:normal|.
90-
When [count] is omitted the tab page appears after the current
91-
one.
92-
When [count] is specified the new tab page comes after tab
93-
page [count]. Use ":0tab cmd" to get the new tab page as the
94-
first one.
90+
If [count] is given the new tab page appears after the tab
91+
page [count] otherwise the new tab page will appear after the
92+
current one.
9593
Examples: >
96-
:tab split " opens current buffer in new tab page
97-
:tab help gt " opens tab page with help for "gt"
94+
:tab split " opens current buffer in new tab page
95+
:tab help gt " opens tab page with help for "gt"
96+
:.tab help gt " as above
97+
:+tab help " opens tab page with help after the next
98+
" tab page
99+
:-tab help " opens tab page with help before the
100+
" current one
101+
:0tab help " opens tab page with help before the
102+
" first one
103+
:$tab help " opens tab page with help after the last
104+
" one
98105
99106
CTRL-W gf Open a new tab page and edit the file name under the cursor.
100107
See |CTRL-W_gf|.
@@ -141,10 +148,11 @@ something else.
141148
given, then they become hidden. But modified buffers are
142149
never abandoned, so changes cannot get lost. >
143150
:tabonly " close all tab pages except the current
151+
" one
144152
145153
:{count}tabo[nly][!]
146154
Close all tab pages except the {count}th one. >
147-
:.tabonly " one
155+
:.tabonly " as above
148156
:-tabonly " close all tab pages except the previous
149157
" one
150158
:+tabonly " close all tab pages except the next one

src/evalfunc.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3587,8 +3587,7 @@ common_function(typval_T *argvars, typval_T *rettv, int is_funcref)
35873587
use_string = TRUE;
35883588
}
35893589

3590-
if (((use_string && vim_strchr(s, AUTOLOAD_CHAR) == NULL)
3591-
|| is_funcref))
3590+
if ((use_string && vim_strchr(s, AUTOLOAD_CHAR) == NULL) || is_funcref)
35923591
{
35933592
name = s;
35943593
trans_name = trans_function_name(&name, FALSE,
@@ -3597,7 +3596,8 @@ common_function(typval_T *argvars, typval_T *rettv, int is_funcref)
35973596
s = NULL;
35983597
}
35993598

3600-
if (s == NULL || *s == NUL || (use_string && VIM_ISDIGIT(*s)))
3599+
if (s == NULL || *s == NUL || (use_string && VIM_ISDIGIT(*s))
3600+
|| (is_funcref && trans_name == NULL))
36013601
EMSG2(_(e_invarg2), s);
36023602
/* Don't check an autoload name for existence here. */
36033603
else if (trans_name != NULL && (is_funcref
@@ -11518,7 +11518,11 @@ f_submatch(typval_T *argvars, typval_T *rettv)
1151811518
no = (int)get_tv_number_chk(&argvars[0], &error);
1151911519
if (error)
1152011520
return;
11521-
error = FALSE;
11521+
if (no < 0 || no >= NSUBEXP)
11522+
{
11523+
EMSGN(_("E935: invalid submatch number: %d"), no);
11524+
return;
11525+
}
1152211526
if (argvars[1].v_type != VAR_UNKNOWN)
1152311527
retList = (int)get_tv_number_chk(&argvars[1], &error);
1152411528
if (error)

src/ex_cmds.c

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8392,6 +8392,60 @@ ex_drop(exarg_T *eap)
83928392
}
83938393
#endif
83948394

8395+
#if defined(FEAT_QUICKFIX) || defined(FEAT_EVAL) || defined(PROTO)
8396+
/*
8397+
* Skip over the pattern argument of ":vimgrep /pat/[g][j]".
8398+
* Put the start of the pattern in "*s", unless "s" is NULL.
8399+
* If "flags" is not NULL put the flags in it: VGR_GLOBAL, VGR_NOJUMP.
8400+
* If "s" is not NULL terminate the pattern with a NUL.
8401+
* Return a pointer to the char just past the pattern plus flags.
8402+
*/
8403+
char_u *
8404+
skip_vimgrep_pat(char_u *p, char_u **s, int *flags)
8405+
{
8406+
int c;
8407+
8408+
if (vim_isIDc(*p))
8409+
{
8410+
/* ":vimgrep pattern fname" */
8411+
if (s != NULL)
8412+
*s = p;
8413+
p = skiptowhite(p);
8414+
if (s != NULL && *p != NUL)
8415+
*p++ = NUL;
8416+
}
8417+
else
8418+
{
8419+
/* ":vimgrep /pattern/[g][j] fname" */
8420+
if (s != NULL)
8421+
*s = p + 1;
8422+
c = *p;
8423+
p = skip_regexp(p + 1, c, TRUE, NULL);
8424+
if (*p != c)
8425+
return NULL;
8426+
8427+
/* Truncate the pattern. */
8428+
if (s != NULL)
8429+
*p = NUL;
8430+
++p;
8431+
8432+
/* Find the flags */
8433+
while (*p == 'g' || *p == 'j')
8434+
{
8435+
if (flags != NULL)
8436+
{
8437+
if (*p == 'g')
8438+
*flags |= VGR_GLOBAL;
8439+
else
8440+
*flags |= VGR_NOJUMP;
8441+
}
8442+
++p;
8443+
}
8444+
}
8445+
return p;
8446+
}
8447+
#endif
8448+
83958449
#if defined(FEAT_EVAL) || defined(PROTO)
83968450
/*
83978451
* List v:oldfiles in a nice way.

src/ex_docmd.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,9 +1865,7 @@ do_one_cmd(
18651865
/*
18661866
* 2. Handle command modifiers.
18671867
*/
1868-
p = ea.cmd;
1869-
if (VIM_ISDIGIT(*ea.cmd))
1870-
p = skipwhite(skipdigits(ea.cmd));
1868+
p = skip_range(ea.cmd, NULL);
18711869
switch (*p)
18721870
{
18731871
/* When adding an entry, also modify cmd_exists(). */
@@ -1999,10 +1997,19 @@ do_one_cmd(
19991997
case 't': if (checkforcmd(&p, "tab", 3))
20001998
{
20011999
#ifdef FEAT_WINDOWS
2002-
if (vim_isdigit(*ea.cmd))
2003-
cmdmod.tab = atoi((char *)ea.cmd) + 1;
2004-
else
2000+
long tabnr = get_address(&ea, &ea.cmd, ADDR_TABS,
2001+
ea.skip, FALSE);
2002+
if (tabnr == MAXLNUM)
20052003
cmdmod.tab = tabpage_index(curtab) + 1;
2004+
else
2005+
{
2006+
if (tabnr < 0 || tabnr > LAST_TAB_NR)
2007+
{
2008+
errormsg = (char_u *)_(e_invrange);
2009+
goto doend;
2010+
}
2011+
cmdmod.tab = tabnr + 1;
2012+
}
20062013
ea.cmd = p;
20072014
#endif
20082015
continue;

src/macros.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
do { \
136136
if (*p_langmap \
137137
&& (condition) \
138-
&& (!p_lnr || (p_lnr && typebuf_maplen() == 0)) \
138+
&& (p_lrm || (!p_lrm && KeyTyped)) \
139139
&& !KeyStuffed \
140140
&& (c) >= 0) \
141141
{ \
@@ -150,7 +150,7 @@
150150
do { \
151151
if (*p_langmap \
152152
&& (condition) \
153-
&& (!p_lnr || (p_lnr && typebuf_maplen() == 0)) \
153+
&& (p_lrm || (!p_lrm && KeyTyped)) \
154154
&& !KeyStuffed \
155155
&& (c) >= 0 && (c) < 256) \
156156
c = langmap_mapchar[c]; \

src/option.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,6 +1739,13 @@ static struct vimoption options[] =
17391739
(char_u *)&p_lnr, PV_NONE,
17401740
#else
17411741
(char_u *)NULL, PV_NONE,
1742+
#endif
1743+
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
1744+
{"langremap", "lrm", P_BOOL|P_VI_DEF,
1745+
#ifdef FEAT_LANGMAP
1746+
(char_u *)&p_lrm, PV_NONE,
1747+
#else
1748+
(char_u *)NULL, PV_NONE,
17421749
#endif
17431750
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
17441751
{"laststatus", "ls", P_NUM|P_VI_DEF|P_RALL,
@@ -7989,6 +7996,15 @@ set_bool_option(
79897996
compatible_set();
79907997
}
79917998

7999+
#ifdef FEAT_LANGMAP
8000+
if ((int *)varp == &p_lrm)
8001+
/* 'langremap' -> !'langnoremap' */
8002+
p_lnr = !p_lrm;
8003+
else if ((int *)varp == &p_lnr)
8004+
/* 'langnoremap' -> !'langremap' */
8005+
p_lrm = !p_lnr;
8006+
#endif
8007+
79928008
#ifdef FEAT_PERSISTENT_UNDO
79938009
/* 'undofile' */
79948010
else if ((int *)varp == &curbuf->b_p_udf || (int *)varp == &p_udf)

src/option.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,7 @@ EXTERN char_u *p_km; /* 'keymodel' */
616616
#ifdef FEAT_LANGMAP
617617
EXTERN char_u *p_langmap; /* 'langmap'*/
618618
EXTERN int p_lnr; /* 'langnoremap' */
619+
EXTERN int p_lrm; /* 'langremap' */
619620
#endif
620621
#if defined(FEAT_MENU) && defined(FEAT_MULTI_LANG)
621622
EXTERN char_u *p_lm; /* 'langmenu' */

src/proto/ex_cmds.pro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,6 @@ char_u *get_sign_name(expand_T *xp, int idx);
6565
void set_context_in_sign_cmd(expand_T *xp, char_u *arg);
6666
void ex_smile(exarg_T *eap);
6767
void ex_drop(exarg_T *eap);
68+
char_u *skip_vimgrep_pat(char_u *p, char_u **s, int *flags);
6869
void ex_oldfiles(exarg_T *eap);
6970
/* vim: set ft=c : */

src/proto/quickfix.pro

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ void ex_cc(exarg_T *eap);
2626
void ex_cnext(exarg_T *eap);
2727
void ex_cfile(exarg_T *eap);
2828
void ex_vimgrep(exarg_T *eap);
29-
char_u *skip_vimgrep_pat(char_u *p, char_u **s, int *flags);
30-
int get_errorlist_properties(win_T *wp, dict_T *what, dict_T *retdict);
3129
int get_errorlist(win_T *wp, int qf_idx, list_T *list);
30+
int get_errorlist_properties(win_T *wp, dict_T *what, dict_T *retdict);
3231
int set_errorlist(win_T *wp, list_T *list, int action, char_u *title, dict_T *what);
3332
void ex_cbuffer(exarg_T *eap);
3433
void ex_cexpr(exarg_T *eap);

0 commit comments

Comments
 (0)