Merge branch 'master' into colored-cmdline

This commit is contained in:
ZyX 2017-07-31 13:13:14 +03:00
commit a356d3c895
12 changed files with 53 additions and 58 deletions

View File

@ -53,7 +53,6 @@
: scriptnames : scriptnames
:endif :endif
:set all :set all
:set termcap
:if has("autocmd") :if has("autocmd")
: au : au
:endif :endif

View File

@ -22,9 +22,7 @@ achieve special effects. These options come in three forms:
*:se* *:set* *:se* *:set*
:se[t] Show all options that differ from their default value. :se[t] Show all options that differ from their default value.
:se[t] all Show all but terminal options. :se[t] all Show all options.
:se[t] termcap Do nothing. Nvim uses |terminfo|.
*E518* *E519* *E518* *E519*
:se[t] {option}? Show value of {option}. :se[t] {option}? Show value of {option}.

View File

@ -572,7 +572,6 @@ In Insert or Command-line mode:
|:set| :se[t] show all modified options |:set| :se[t] show all modified options
|:set| :se[t] all show all options |:set| :se[t] all show all options
|:set| :se[t] termcap Do nothing. (|terminfo|)
|:set| :se[t] {option} set boolean option (switch it on), |:set| :se[t] {option} set boolean option (switch it on),
show string or number option show string or number option
|:set| :se[t] no{option} reset boolean option (switch it off) |:set| :se[t] no{option} reset boolean option (switch it off)

View File

@ -214,7 +214,7 @@ argument.
:set to display option values. :set to display option values.
When 'verbose' is non-zero messages are printed (for When 'verbose' is non-zero messages are printed (for
debugging, to stderr). debugging, to stderr).
$TERM (see |TERM|) is not used. |$TERM| is not used.
If Vim appears to be stuck try typing "qa!<Enter>". You don't If Vim appears to be stuck try typing "qa!<Enter>". You don't
get a prompt thus you can't see Vim is waiting for you to type get a prompt thus you can't see Vim is waiting for you to type
something. something.

View File

@ -4696,7 +4696,7 @@ cterm={attr-list} *highlight-cterm*
ctermfg={color-nr} *highlight-ctermfg* *E421* ctermfg={color-nr} *highlight-ctermfg* *E421*
ctermbg={color-nr} *highlight-ctermbg* ctermbg={color-nr} *highlight-ctermbg*
The {color-nr} argument is a color number. Its range is zero to The {color-nr} argument is a color number. Its range is zero to
(not including) the number of |terminfo-colors| available. (not including) the number of |tui-colors| available.
The actual color with this number depends on the type of terminal The actual color with this number depends on the type of terminal
and its settings. Sometimes the color also depends on the settings of and its settings. Sometimes the color also depends on the settings of
"cterm". For example, on some systems "cterm=bold ctermfg=3" gives "cterm". For example, on some systems "cterm=bold ctermfg=3" gives

View File

@ -61,7 +61,7 @@ entries for "xterm", "putty", "screen", "tmux", "rxvt", "iterm", "interix",
The lookup matches the initial portion of the terminal type, so (for example) The lookup matches the initial portion of the terminal type, so (for example)
"putty-256color" and "putty" will both be mapped to the built-in "putty" "putty-256color" and "putty" will both be mapped to the built-in "putty"
entry. The built-in terminfo entries describe the terminal as 256-colour entry. The built-in terminfo entries describe the terminal as 256-colour
capable if possible. See |termcap-colors|. capable if possible. See |tui-colors|.
If no built-in terminfo record matches the terminal type, the built-in "ansi" If no built-in terminfo record matches the terminal type, the built-in "ansi"
terminfo record is used as a final fallback. terminfo record is used as a final fallback.
@ -112,7 +112,7 @@ genuine Xterm will not work over an SSH connection, because the environment
variable, set by genuine Xterm, that it looks for is not automatically variable, set by genuine Xterm, that it looks for is not automatically
replicated over an SSH login session. replicated over an SSH login session.
*256-color* *terminfo-colors* *termcap-colors* *tui-colors*
Nvim uses 256 colours by default, ignoring |terminfo| for most terminal types, Nvim uses 256 colours by default, ignoring |terminfo| for most terminal types,
including "linux" (whose virtual terminals have had 256-colour support since including "linux" (whose virtual terminals have had 256-colour support since
4.8) and anything claiming to be "xterm". Also when $COLORTERM or $TERM 4.8) and anything claiming to be "xterm". Also when $COLORTERM or $TERM
@ -148,7 +148,7 @@ extension pioneered by dtterm. |terminfo| does not have a flag for this
extension. So Nvim simply assumes that (all) "dtterm", "xterm", "teraterm", extension. So Nvim simply assumes that (all) "dtterm", "xterm", "teraterm",
"rxvt" terminal types, and Konsole, are capable of this. "rxvt" terminal types, and Konsole, are capable of this.
*tui-cursor-shape* *tui-cursor-shape*
Nvim will adjust the shape of the cursor from a block to a line when in insert Nvim will adjust the shape of the cursor from a block to a line when in insert
mode (or as specified by the 'guicursor' option), on terminals that support mode (or as specified by the 'guicursor' option), on terminals that support
it. It uses the same |terminfo| extensions that were pioneered by tmux for it. It uses the same |terminfo| extensions that were pioneered by tmux for

View File

@ -309,13 +309,10 @@ example, 'guicursor' sets the terminal cursor style if possible.
*'term'* *E529* *E530* *E531* *'term'* *E529* *E530* *E531*
The 'term' option has a fixed value, present only for script compatibility and The 'term' option has a fixed value, present only for script compatibility and
intentionally not the same as any known terminal type name. It should be a intentionally not the same as any known terminal type name. It should be a
rare case in Nvim where one needs |term-dependent-settings|, for which use the rare case in Nvim where one needs |term-dependent-settings|.
|TERM| environment variable.
*termcap* *termcap*
Nvim never uses the termcap database and only uses |terminfo|. See Nvim never uses the termcap database, only |terminfo| and |builtin-terms|.
|builtin-terms| for what happens on operating systems without a terminfo
database.
*xterm-8bit* *xterm-8-bit* *xterm-8bit* *xterm-8-bit*
Xterm can be run in a mode where it uses true 8-bit CSI. Supporting this Xterm can be run in a mode where it uses true 8-bit CSI. Supporting this

View File

@ -19551,18 +19551,22 @@ static const char *find_option_end(const char **const arg, int *const opt_flags)
} else if (*p == 'l' && p[1] == ':') { } else if (*p == 'l' && p[1] == ':') {
*opt_flags = OPT_LOCAL; *opt_flags = OPT_LOCAL;
p += 2; p += 2;
} else } else {
*opt_flags = 0; *opt_flags = 0;
}
if (!ASCII_ISALPHA(*p)) if (!ASCII_ISALPHA(*p)) {
return NULL; return NULL;
}
*arg = p; *arg = p;
if (p[0] == 't' && p[1] == '_' && p[2] != NUL && p[3] != NUL) if (p[0] == 't' && p[1] == '_' && p[2] != NUL && p[3] != NUL) {
p += 4; /* termcap option */ p += 4; // t_xx/termcap option
else } else {
while (ASCII_ISALPHA(*p)) while (ASCII_ISALPHA(*p)) {
++p; p++;
}
}
return p; return p;
} }

View File

@ -1185,10 +1185,6 @@ do_set (
showoptions(1, opt_flags); showoptions(1, opt_flags);
did_show = TRUE; did_show = TRUE;
} }
} else if (STRNCMP(arg, "termcap",
7) == 0 && !(opt_flags & OPT_MODELINE)) {
did_show = TRUE;
arg += 7;
} else { } else {
prefix = 1; prefix = 1;
if (STRNCMP(arg, "no", 2) == 0) { if (STRNCMP(arg, "no", 2) == 0) {
@ -6070,8 +6066,8 @@ int ExpandSettings(expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***
int count = 0; int count = 0;
char_u *str; char_u *str;
int loop; int loop;
static char *(names[]) = {"all", "termcap"}; static char *(names[]) = { "all" };
int ic = regmatch->rm_ic; /* remember the ignore-case flag */ int ic = regmatch->rm_ic; // remember the ignore-case flag
/* do this loop twice: /* do this loop twice:
* loop == 0: count the number of matching options * loop == 0: count the number of matching options

View File

@ -132,7 +132,7 @@ $(SCRIPTS) $(SCRIPTS_GUI): $(NVIM_PRG) test1.out
RM_ON_RUN := test.out X* viminfo RM_ON_RUN := test.out X* viminfo
RM_ON_START := test.ok RM_ON_START := test.ok
RUN_VIM := VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(TOOL) $(NVIM_PRG) -u unix.vim -U NONE -i viminfo --noplugin -s dotest.in RUN_VIM := VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(TOOL) $(NVIM_PRG) -u unix.vim -U NONE -i viminfo --headless --noplugin -s dotest.in
clean: clean:
-rm -rf *.out \ -rm -rf *.out \
@ -201,7 +201,7 @@ nolog:
# New style of tests uses Vim script with assert calls. These are easier # New style of tests uses Vim script with assert calls. These are easier
# to write and a lot easier to read and debug. # to write and a lot easier to read and debug.
# Limitation: Only works with the +eval feature. # Limitation: Only works with the +eval feature.
RUN_VIMTEST = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(TOOL) $(NVIM_PRG) -u unix.vim -U NONE --noplugin RUN_VIMTEST = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(TOOL) $(NVIM_PRG) -u unix.vim -U NONE --headless --noplugin
newtests: newtestssilent newtests: newtestssilent
@/bin/sh -c "if test -f messages && grep -q 'FAILED' messages; then \ @/bin/sh -c "if test -f messages && grep -q 'FAILED' messages; then \

View File

@ -342,7 +342,10 @@ func Test_BufEnter()
call mkdir('Xdir') call mkdir('Xdir')
split Xdir split Xdir
call assert_equal('+++', g:val) call assert_equal('+++', g:val)
bwipe!
" On MS-Windows we can't edit the directory, make sure we wipe the right
" buffer.
bwipe! Xdir
call delete('Xdir', 'd') call delete('Xdir', 'd')
au! BufEnter au! BufEnter
@ -351,40 +354,37 @@ endfunc
" Closing a window might cause an endless loop " Closing a window might cause an endless loop
" E814 for older Vims " E814 for older Vims
function Test_autocmd_bufwipe_in_SessLoadPost() function Test_autocmd_bufwipe_in_SessLoadPost()
if has('win32')
throw 'Skipped: test hangs on MS-Windows'
endif
tabnew tabnew
set noswapfile set noswapfile
let g:bufnr=bufnr('%')
mksession! mksession!
let content=['set nocp noswapfile', let content = ['set nocp noswapfile',
\ 'let v:swapchoice="e"', \ 'let v:swapchoice="e"',
\ 'augroup test_autocmd_sessionload', \ 'augroup test_autocmd_sessionload',
\ 'autocmd!', \ 'autocmd!',
\ 'autocmd SessionLoadPost * 4bw!|qall!', \ 'autocmd SessionLoadPost * 4bw!',
\ 'augroup END', \ 'augroup END',
\ '',
\ 'func WriteErrors()',
\ ' call writefile([execute("messages")], "Xerrors")',
\ 'endfunc',
\ 'au VimLeave * call WriteErrors()',
\ ] \ ]
call writefile(content, 'Xvimrc') call writefile(content, 'Xvimrc')
let a=system(v:progpath. ' --headless -i NONE -u Xvimrc --noplugins -S Session.vim') call system(v:progpath. ' --headless -i NONE -u Xvimrc --noplugins -S Session.vim -c cq')
call assert_match('E814', a) let errors = join(readfile('Xerrors'))
call assert_match('E814', errors)
unlet! g:bufnr
set swapfile set swapfile
for file in ['Session.vim', 'Xvimrc'] for file in ['Session.vim', 'Xvimrc', 'Xerrors']
call delete(file) call delete(file)
endfor endfor
endfunc endfunc
" SEGV occurs in older versions. " SEGV occurs in older versions.
function Test_autocmd_bufwipe_in_SessLoadPost2() function Test_autocmd_bufwipe_in_SessLoadPost2()
if has('win32')
throw 'Skipped: test hangs on MS-Windows'
endif
tabnew tabnew
set noswapfile set noswapfile
let g:bufnr=bufnr('%')
mksession! mksession!
let content = ['set nocp noswapfile', let content = ['set nocp noswapfile',
@ -399,22 +399,24 @@ function Test_autocmd_bufwipe_in_SessLoadPost2()
\ ' exec ''bwipeout '' . b', \ ' exec ''bwipeout '' . b',
\ ' endif', \ ' endif',
\ ' endfor', \ ' endfor',
\ 'redraw!', \ ' echomsg "SessionLoadPost DONE"',
\ 'echon "SessionLoadPost DONE"',
\ 'qall!',
\ 'endfunction', \ 'endfunction',
\ 'au SessionLoadPost * call DeleteInactiveBufs()'] \ 'au SessionLoadPost * call DeleteInactiveBufs()',
\ '',
\ 'func WriteErrors()',
\ ' call writefile([execute("messages")], "Xerrors")',
\ 'endfunc',
\ 'au VimLeave * call WriteErrors()',
\ ]
call writefile(content, 'Xvimrc') call writefile(content, 'Xvimrc')
let a=system(v:progpath. ' --headless -i NONE -u Xvimrc --noplugins -S Session.vim') call system(v:progpath. ' --headless -i NONE -u Xvimrc --noplugins -S Session.vim -c cq')
" this probably only matches on unix let errors = join(readfile('Xerrors'))
if has("unix") " This probably only ever matches on unix.
call assert_notmatch('Caught deadly signal SEGV', a) call assert_notmatch('Caught deadly signal SEGV', errors)
endif call assert_match('SessionLoadPost DONE', errors)
call assert_match('SessionLoadPost DONE', a)
unlet! g:bufnr
set swapfile set swapfile
for file in ['Session.vim', 'Xvimrc'] for file in ['Session.vim', 'Xvimrc', 'Xerrors']
call delete(file) call delete(file)
endfor endfor
endfunc endfunc

View File

@ -231,7 +231,7 @@ static const int included_patches[] = {
// 501, // 501,
// 500, // 500,
499, 499,
// 498, 498,
// 497, // 497,
// 496, // 496,
// 495, // 495,