Skip to content

Commit 54d4387

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 854c1d8 + e07e797 commit 54d4387

25 files changed

Lines changed: 269 additions & 220 deletions

runtime/defaults.vim

Lines changed: 4 additions & 1 deletion
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 Jul 29
4+
" Last change: 2016 Aug 20
55
"
66
" This is loaded if no vimrc file was found.
77
" Except when Vim is run with "-u NONE" or "-C".
@@ -25,6 +25,9 @@ set ruler " show the cursor position all the time
2525
set showcmd " display incomplete commands
2626
set wildmenu " display completion matches in a status line
2727

28+
set ttimeout " time out for key codes
29+
set ttimeoutlen=100 " wait up to 100ms after Esc for special key
30+
2831
" Show @@@ in the last line if it is truncated.
2932
set display=truncate
3033

runtime/doc/options.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7557,6 +7557,9 @@ A jump table for the options with a short description can be found at |Q_op|.
75577557
By default, tag searches are case-sensitive. Case is ignored when
75587558
'ignorecase' is set and 'tagcase' is "followic", or when 'tagcase' is
75597559
"ignore".
7560+
Also when 'tagcase' is "followscs" and 'smartcase' is set, or
7561+
'tagcase' is "smart", and the pattern contains only lowercase
7562+
characters.
75607563

75617564
When 'tagbsearch' is off, tags searching is slower when a full match
75627565
exists, but faster when no full match exists. Tags in unsorted tags
@@ -7575,8 +7578,10 @@ A jump table for the options with a short description can be found at |Q_op|.
75757578
This option specifies how case is handled when searching the tags
75767579
file:
75777580
followic Follow the 'ignorecase' option
7581+
followscs Follow the 'smartcase' and 'ignorecase' options
75787582
ignore Ignore case
75797583
match Match case
7584+
smart Ignore case unless an upper case letter is used
75807585

75817586
*'taglength'* *'tl'*
75827587
'taglength' 'tl' number (default 0)

runtime/doc/starting.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1612,11 +1612,20 @@ most of the information will be restored).
16121612
*:ol* *:oldfiles*
16131613
:ol[dfiles] List the files that have marks stored in the viminfo
16141614
file. This list is read on startup and only changes
1615-
afterwards with ":rviminfo!". Also see |v:oldfiles|.
1615+
afterwards with `:rviminfo!`. Also see |v:oldfiles|.
16161616
The number can be used with |c_#<|.
16171617
{not in Vi, only when compiled with the |+eval|
16181618
feature}
16191619

1620+
:ol[dfiles] {pat}
1621+
:ol[dfiles] /{pat}/
1622+
Like `:oldfiles` but only files matching {pat} will
1623+
be included. {pat} is a Vim search pattern. Instead
1624+
of enclosing it in / any non-ID character (see
1625+
|'isident'|) can be used, so long as it does not
1626+
appear in {pat}. Without the enclosing character the
1627+
pattern cannot include the bar character.
1628+
16201629
:bro[wse] ol[dfiles][!]
16211630
List file names as with |:oldfiles|, and then prompt
16221631
for a number. When the number is valid that file from

runtime/doc/tagsrch.txt

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,23 @@ Note that when the current file changes, the priority list is mostly not
8484
changed, to avoid confusion when using ":tnext". It is changed when using
8585
":tag {ident}".
8686

87-
The ignore-case matches are not found for a ":tag" command when the
88-
'ignorecase' option is off and 'tagcase' is "followic" or when 'tagcase' is
89-
"match". They are found when a pattern is used (starting with a "/") and for
90-
":tselect", also when 'ignorecase' is off and 'tagcase' is "followic" or when
91-
'tagcase' is "match". Note that using ignore-case tag searching disables
92-
binary searching in the tags file, which causes a slowdown. This can be
93-
avoided by fold-case sorting the tag file. See the 'tagbsearch' option for an
94-
explanation.
87+
The ignore-case matches are not found for a ":tag" command when:
88+
- the 'ignorecase' option is off and 'tagcase' is "followic"
89+
- 'tagcase' is "match"
90+
- 'tagcase' is "smart" and the pattern contains an upper case character.
91+
- 'tagcase' is "followscs" and 'smartcase' option is on and the pattern
92+
contains an upper case character.
93+
94+
The gnore-case matches are found when:
95+
- a pattern is used (starting with a "/")
96+
- for ":tselect"
97+
- when 'tagcase' is "followic" and 'ignorecase' is off
98+
- when 'tagcase' is "match"
99+
- when 'tagcase' is "followscs" and the 'smartcase' option is off
100+
101+
Note that using ignore-case tag searching disables binary searching in the
102+
tags file, which causes a slowdown. This can be avoided by fold-case sorting
103+
the tag file. See the 'tagbsearch' option for an explanation.
95104

96105
==============================================================================
97106
2. Tag stack *tag-stack* *tagstack* *E425*
@@ -442,13 +451,18 @@ file "tags". It can also be used to access a common tags file.
442451
The next file in the list is not used when:
443452
- A matching static tag for the current buffer has been found.
444453
- A matching global tag has been found.
445-
This also depends on whether case is ignored. Case is ignored when
446-
'ignorecase' is set and 'tagcase' is "followic", or when 'tagcase' is
447-
"ignore". If case is not ignored, and the tags file only has a match without
448-
matching case, the next tags file is searched for a match with matching case.
449-
If no tag with matching case is found, the first match without matching case
450-
is used. If case is ignored, and a matching global tag with or without
451-
matching case is found, this one is used, no further tags files are searched.
454+
This also depends on whether case is ignored. Case is ignored when:
455+
- 'tagcase' is "followic" and 'ignorecase' is set
456+
- 'tagcase' is "ignore"
457+
- 'tagcase' is "smart" and and the pattern only contains lower case
458+
characters.
459+
- 'tagcase' is "followscs" and 'smartcase' is set and and the pattern only
460+
contains lower case characters.
461+
If case is not ignored, and the tags file only has a match without matching
462+
case, the next tags file is searched for a match with matching case. If no
463+
tag with matching case is found, the first match without matching case is
464+
used. If case is ignored, and a matching global tag with or without matching
465+
case is found, this one is used, no further tags files are searched.
452466

453467
When a tag file name starts with "./", the '.' is replaced with the path of
454468
the current file. This makes it possible to use a tags file in the directory

src/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2048,7 +2048,6 @@ test1 \
20482048
test_marks \
20492049
test_nested_function \
20502050
test_search_mbyte \
2051-
test_tagcase \
20522051
test_utf8 \
20532052
test_wordcount \
20542053
test_writefile \
@@ -2140,6 +2139,7 @@ test_arglist \
21402139
test_syntax \
21412140
test_tabline \
21422141
test_tabpage \
2142+
test_tagcase \
21432143
test_tagjump \
21442144
test_textobjects \
21452145
test_timers \

src/buffer.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ open_buffer(
219219
# endif
220220
# ifdef S_ISSOCK
221221
|| S_ISSOCK(perm)
222+
# endif
223+
# ifdef OPEN_CHR_FILES
224+
|| (S_ISCHR(perm) && is_dev_fd_file(curbuf->b_ffname))
222225
# endif
223226
))
224227
read_fifo = TRUE;

src/eval.c

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -8929,60 +8929,6 @@ last_set_msg(scid_T scriptID)
89298929
}
89308930
}
89318931

8932-
/*
8933-
* List v:oldfiles in a nice way.
8934-
*/
8935-
void
8936-
ex_oldfiles(exarg_T *eap UNUSED)
8937-
{
8938-
list_T *l = vimvars[VV_OLDFILES].vv_list;
8939-
listitem_T *li;
8940-
int nr = 0;
8941-
8942-
if (l == NULL)
8943-
msg((char_u *)_("No old files"));
8944-
else
8945-
{
8946-
msg_start();
8947-
msg_scroll = TRUE;
8948-
for (li = l->lv_first; li != NULL && !got_int; li = li->li_next)
8949-
{
8950-
msg_outnum((long)++nr);
8951-
MSG_PUTS(": ");
8952-
msg_outtrans(get_tv_string(&li->li_tv));
8953-
msg_putchar('\n');
8954-
out_flush(); /* output one line at a time */
8955-
ui_breakcheck();
8956-
}
8957-
/* Assume "got_int" was set to truncate the listing. */
8958-
got_int = FALSE;
8959-
8960-
#ifdef FEAT_BROWSE_CMD
8961-
if (cmdmod.browse)
8962-
{
8963-
quit_more = FALSE;
8964-
nr = prompt_for_number(FALSE);
8965-
msg_starthere();
8966-
if (nr > 0)
8967-
{
8968-
char_u *p = list_find_str(get_vim_var_list(VV_OLDFILES),
8969-
(long)nr);
8970-
8971-
if (p != NULL)
8972-
{
8973-
p = expand_env_save(p);
8974-
eap->arg = p;
8975-
eap->cmdidx = CMD_edit;
8976-
cmdmod.browse = FALSE;
8977-
do_exedit(eap, NULL);
8978-
vim_free(p);
8979-
}
8980-
}
8981-
}
8982-
#endif
8983-
}
8984-
}
8985-
89868932
/* reset v:option_new, v:option_old and v:option_type */
89878933
void
89888934
reset_v_option_vars(void)

src/ex_cmds.c

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8391,3 +8391,84 @@ ex_drop(exarg_T *eap)
83918391
}
83928392
}
83938393
#endif
8394+
8395+
#if defined(FEAT_EVAL) || defined(PROTO)
8396+
/*
8397+
* List v:oldfiles in a nice way.
8398+
*/
8399+
void
8400+
ex_oldfiles(exarg_T *eap UNUSED)
8401+
{
8402+
list_T *l = get_vim_var_list(VV_OLDFILES);
8403+
listitem_T *li;
8404+
int nr = 0;
8405+
char_u *reg_pat = NULL;
8406+
char_u *fname;
8407+
regmatch_T regmatch;
8408+
8409+
if (l == NULL)
8410+
msg((char_u *)_("No old files"));
8411+
else
8412+
{
8413+
if (*eap->arg != NUL)
8414+
{
8415+
if (skip_vimgrep_pat(eap->arg, &reg_pat, NULL) == NULL)
8416+
{
8417+
EMSG(_(e_invalpat));
8418+
return;
8419+
}
8420+
regmatch.regprog = vim_regcomp(reg_pat, p_magic ? RE_MAGIC : 0);
8421+
if (regmatch.regprog == NULL)
8422+
return;
8423+
}
8424+
8425+
msg_start();
8426+
msg_scroll = TRUE;
8427+
for (li = l->lv_first; li != NULL && !got_int; li = li->li_next)
8428+
{
8429+
++nr;
8430+
fname = get_tv_string(&li->li_tv);
8431+
if (reg_pat == NULL || *reg_pat == NUL
8432+
|| vim_regexec(&regmatch, fname, (colnr_T)0))
8433+
{
8434+
msg_outnum((long)nr);
8435+
MSG_PUTS(": ");
8436+
msg_outtrans(fname);
8437+
msg_putchar('\n');
8438+
out_flush(); /* output one line at a time */
8439+
ui_breakcheck();
8440+
}
8441+
}
8442+
if (*eap->arg != NUL)
8443+
vim_regfree(regmatch.regprog);
8444+
8445+
/* Assume "got_int" was set to truncate the listing. */
8446+
got_int = FALSE;
8447+
8448+
# ifdef FEAT_BROWSE_CMD
8449+
if (cmdmod.browse)
8450+
{
8451+
quit_more = FALSE;
8452+
nr = prompt_for_number(FALSE);
8453+
msg_starthere();
8454+
if (nr > 0)
8455+
{
8456+
char_u *p = list_find_str(get_vim_var_list(VV_OLDFILES),
8457+
(long)nr);
8458+
8459+
if (p != NULL)
8460+
{
8461+
p = expand_env_save(p);
8462+
eap->arg = p;
8463+
eap->cmdidx = CMD_edit;
8464+
cmdmod.browse = FALSE;
8465+
do_exedit(eap, NULL);
8466+
vim_free(p);
8467+
}
8468+
}
8469+
}
8470+
# endif
8471+
}
8472+
}
8473+
#endif
8474+

src/ex_cmds.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ EX(CMD_open, "open", ex_open,
998998
RANGE|BANG|EXTRA,
999999
ADDR_LINES),
10001000
EX(CMD_oldfiles, "oldfiles", ex_oldfiles,
1001-
BANG|TRLBAR|SBOXOK|CMDWIN,
1001+
BANG|TRLBAR|NOTADR|EXTRA|SBOXOK|CMDWIN,
10021002
ADDR_LINES),
10031003
EX(CMD_omap, "omap", ex_map,
10041004
EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,

src/fileio.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@
2727
/* Is there any system that doesn't have access()? */
2828
#define USE_MCH_ACCESS
2929

30-
#if (defined(sun) || defined(__FreeBSD__)) && defined(S_ISCHR)
31-
# define OPEN_CHR_FILES
32-
static int is_dev_fd_file(char_u *fname);
33-
#endif
3430
#ifdef FEAT_MBYTE
3531
static char_u *next_fenc(char_u **pp);
3632
# ifdef FEAT_EVAL
@@ -2718,14 +2714,14 @@ readfile(
27182714
return OK;
27192715
}
27202716

2721-
#ifdef OPEN_CHR_FILES
2717+
#if defined(OPEN_CHR_FILES) || defined(PROTO)
27222718
/*
27232719
* Returns TRUE if the file name argument is of the form "/dev/fd/\d\+",
27242720
* which is the name of files used for process substitution output by
27252721
* some shells on some operating systems, e.g., bash on SunOS.
27262722
* Do not accept "/dev/fd/[012]", opening these may hang Vim.
27272723
*/
2728-
static int
2724+
int
27292725
is_dev_fd_file(char_u *fname)
27302726
{
27312727
return (STRNCMP(fname, "/dev/fd/", 8) == 0

0 commit comments

Comments
 (0)