aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/eval.c18
-rw-r--r--src/nvim/eval.lua2
-rw-r--r--src/nvim/log.c7
-rw-r--r--src/nvim/log.h2
-rw-r--r--src/nvim/option.c8
-rw-r--r--src/nvim/quickfix.c2
-rw-r--r--src/nvim/testdir/Makefile4
-rw-r--r--src/nvim/testdir/test_autocmd.vim58
-rw-r--r--src/nvim/tui/tui.c15
-rw-r--r--src/nvim/version.c10
10 files changed, 65 insertions, 61 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 2988225110..78c8dd02db 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -19546,18 +19546,22 @@ static const char *find_option_end(const char **const arg, int *const opt_flags)
} else if (*p == 'l' && p[1] == ':') {
*opt_flags = OPT_LOCAL;
p += 2;
- } else
+ } else {
*opt_flags = 0;
+ }
- if (!ASCII_ISALPHA(*p))
+ if (!ASCII_ISALPHA(*p)) {
return NULL;
+ }
*arg = p;
- if (p[0] == 't' && p[1] == '_' && p[2] != NUL && p[3] != NUL)
- p += 4; /* termcap option */
- else
- while (ASCII_ISALPHA(*p))
- ++p;
+ if (p[0] == 't' && p[1] == '_' && p[2] != NUL && p[3] != NUL) {
+ p += 4; // t_xx/termcap option
+ } else {
+ while (ASCII_ISALPHA(*p)) {
+ p++;
+ }
+ }
return p;
}
diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua
index 08baae4086..0e359fb61c 100644
--- a/src/nvim/eval.lua
+++ b/src/nvim/eval.lua
@@ -29,7 +29,7 @@ return {
assert_exception={args={1, 2}},
assert_fails={args={1, 2}},
assert_false={args={1, 2}},
- assert_inrange={args={2, 3}},
+ assert_inrange={args={3, 4}},
assert_match={args={2, 3}},
assert_notequal={args={2, 3}},
assert_notmatch={args={2, 3}},
diff --git a/src/nvim/log.c b/src/nvim/log.c
index 252fe5438d..b64aef3cac 100644
--- a/src/nvim/log.c
+++ b/src/nvim/log.c
@@ -25,6 +25,10 @@ static uv_mutex_t mutex;
# include "log.c.generated.h"
#endif
+#ifdef HAVE_EXECINFO_BACKTRACE
+# include <execinfo.h>
+#endif
+
static bool log_try_create(char *fname)
{
if (fname == NULL || fname[0] == '\0') {
@@ -173,8 +177,7 @@ FILE *open_log_file(void)
return stderr;
}
-#if defined(__linux__)
-# include <execinfo.h>
+#ifdef HAVE_EXECINFO_BACKTRACE
void log_callstack(const char *const func_name, const int line_num)
{
void *trace[100];
diff --git a/src/nvim/log.h b/src/nvim/log.h
index 2bd18f5776..743a8d17aa 100644
--- a/src/nvim/log.h
+++ b/src/nvim/log.h
@@ -61,7 +61,7 @@
__VA_ARGS__)
#endif
-#if defined(__linux__)
+#ifdef HAVE_EXECINFO_BACKTRACE
# define LOG_CALLSTACK() log_callstack(__func__, __LINE__)
#endif
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 98ca72b2bb..8ba10fd38a 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -1185,10 +1185,6 @@ do_set (
showoptions(1, opt_flags);
did_show = TRUE;
}
- } else if (STRNCMP(arg, "termcap",
- 7) == 0 && !(opt_flags & OPT_MODELINE)) {
- did_show = TRUE;
- arg += 7;
} else {
prefix = 1;
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;
char_u *str;
int loop;
- static char *(names[]) = {"all", "termcap"};
- int ic = regmatch->rm_ic; /* remember the ignore-case flag */
+ static char *(names[]) = { "all" };
+ int ic = regmatch->rm_ic; // remember the ignore-case flag
/* do this loop twice:
* loop == 0: count the number of matching options
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 4997209556..e6b1e7b95a 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -3127,7 +3127,7 @@ static char_u *get_mef_name(void)
STRCPY(name, p_mef);
sprintf((char *)name + (p - p_mef), "%d%d", start, off);
STRCAT(name, p + 2);
- // Don't accept a symbolic link, its a security risk.
+ // Don't accept a symbolic link, it's a security risk.
FileInfo file_info;
bool file_or_link_found = os_fileinfo_link((char *)name, &file_info);
if (!file_or_link_found) {
diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile
index 510e8820f4..b45bd6ee14 100644
--- a/src/nvim/testdir/Makefile
+++ b/src/nvim/testdir/Makefile
@@ -132,7 +132,7 @@ $(SCRIPTS) $(SCRIPTS_GUI): $(NVIM_PRG) test1.out
RM_ON_RUN := test.out X* viminfo
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:
-rm -rf *.out \
@@ -201,7 +201,7 @@ nolog:
# New style of tests uses Vim script with assert calls. These are easier
# to write and a lot easier to read and debug.
# Limitation: Only works with the +eval feature.
-RUN_VIMTEST = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(VALGRIND) $(NVIM_PRG) -u unix.vim -U NONE --noplugin
+RUN_VIMTEST = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(VALGRIND) $(NVIM_PRG) -u unix.vim -U NONE --headless --noplugin
newtests: newtestssilent
@/bin/sh -c "if test -f messages && grep -q 'FAILED' messages; then \
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim
index c4110eba94..835df42a10 100644
--- a/src/nvim/testdir/test_autocmd.vim
+++ b/src/nvim/testdir/test_autocmd.vim
@@ -342,7 +342,10 @@ func Test_BufEnter()
call mkdir('Xdir')
split Xdir
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')
au! BufEnter
@@ -351,40 +354,37 @@ endfunc
" Closing a window might cause an endless loop
" E814 for older Vims
function Test_autocmd_bufwipe_in_SessLoadPost()
- if has('win32')
- throw 'Skipped: test hangs on MS-Windows'
- endif
tabnew
set noswapfile
- let g:bufnr=bufnr('%')
mksession!
- let content=['set nocp noswapfile',
+ let content = ['set nocp noswapfile',
\ 'let v:swapchoice="e"',
\ 'augroup test_autocmd_sessionload',
\ 'autocmd!',
- \ 'autocmd SessionLoadPost * 4bw!|qall!',
+ \ 'autocmd SessionLoadPost * 4bw!',
\ 'augroup END',
+ \ '',
+ \ 'func WriteErrors()',
+ \ ' call writefile([execute("messages")], "Xerrors")',
+ \ 'endfunc',
+ \ 'au VimLeave * call WriteErrors()',
\ ]
call writefile(content, 'Xvimrc')
- let a=system(v:progpath. ' --headless -i NONE -u Xvimrc --noplugins -S Session.vim')
- call assert_match('E814', a)
+ call system(v:progpath. ' --headless -i NONE -u Xvimrc --noplugins -S Session.vim -c cq')
+ let errors = join(readfile('Xerrors'))
+ call assert_match('E814', errors)
- unlet! g:bufnr
set swapfile
- for file in ['Session.vim', 'Xvimrc']
+ for file in ['Session.vim', 'Xvimrc', 'Xerrors']
call delete(file)
endfor
endfunc
" SEGV occurs in older versions.
function Test_autocmd_bufwipe_in_SessLoadPost2()
- if has('win32')
- throw 'Skipped: test hangs on MS-Windows'
- endif
tabnew
set noswapfile
- let g:bufnr=bufnr('%')
mksession!
let content = ['set nocp noswapfile',
@@ -399,22 +399,24 @@ function Test_autocmd_bufwipe_in_SessLoadPost2()
\ ' exec ''bwipeout '' . b',
\ ' endif',
\ ' endfor',
- \ 'redraw!',
- \ 'echon "SessionLoadPost DONE"',
- \ 'qall!',
+ \ ' echomsg "SessionLoadPost DONE"',
\ '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')
- let a=system(v:progpath. ' --headless -i NONE -u Xvimrc --noplugins -S Session.vim')
- " this probably only matches on unix
- if has("unix")
- call assert_notmatch('Caught deadly signal SEGV', a)
- endif
- call assert_match('SessionLoadPost DONE', a)
-
- unlet! g:bufnr
+ call system(v:progpath. ' --headless -i NONE -u Xvimrc --noplugins -S Session.vim -c cq')
+ let errors = join(readfile('Xerrors'))
+ " This probably only ever matches on unix.
+ call assert_notmatch('Caught deadly signal SEGV', errors)
+ call assert_match('SessionLoadPost DONE', errors)
+
set swapfile
- for file in ['Session.vim', 'Xvimrc']
+ for file in ['Session.vim', 'Xvimrc', 'Xerrors']
call delete(file)
endfor
endfunc
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c
index 0975b87ea3..c29ec09638 100644
--- a/src/nvim/tui/tui.c
+++ b/src/nvim/tui/tui.c
@@ -1537,11 +1537,11 @@ static void augment_terminfo(TUIData *data, const char *term,
bool teraterm = terminfo_is_term_family(term, "teraterm");
bool putty = terminfo_is_term_family(term, "putty");
bool screen = terminfo_is_term_family(term, "screen");
+ bool tmux = terminfo_is_term_family(term, "tmux") || !!os_getenv("TMUX");
bool iterm = terminfo_is_term_family(term, "iterm")
|| terminfo_is_term_family(term, "iTerm.app");
// None of the following work over SSH; see :help TERM .
bool iterm_pretending_xterm = xterm && iterm_env;
- bool tmux_wrap = screen && !!os_getenv("TMUX");
const char * xterm_version = os_getenv("XTERM_VERSION");
bool true_xterm = xterm && !!xterm_version;
@@ -1573,12 +1573,11 @@ static void augment_terminfo(TUIData *data, const char *term,
// specific ones.
// can use colons like ISO 8613-6:1994/ITU T.416:1993 says.
- bool has_colon_rgb = false
- // per GNOME bug #685759 and bug #704449
- || (vte_version >= 3600)
- || iterm || iterm_pretending_xterm // per analysis of VT100Terminal.m
- // per http://invisible-island.net/xterm/xterm.log.html#xterm_282
- || true_xterm;
+ bool has_colon_rgb = !tmux && !screen
+ && ((vte_version >= 3600) // per GNOME bug #685759, #704449
+ || iterm || iterm_pretending_xterm // per analysis of VT100Terminal.m
+ // per http://invisible-island.net/xterm/xterm.log.html#xterm_282
+ || true_xterm);
data->unibi_ext.set_rgb_foreground = unibi_find_ext_str(ut, "setrgbf");
if (-1 == data->unibi_ext.set_rgb_foreground) {
@@ -1606,7 +1605,7 @@ static void augment_terminfo(TUIData *data, const char *term,
// all panes, which is not particularly desirable. A better approach
// would use a tmux control sequence and an extra if(screen) test.
data->unibi_ext.set_cursor_color = (int)unibi_add_ext_str(
- ut, NULL, TMUX_WRAP(tmux_wrap, "\033]Pl%p1%06x\033\\"));
+ ut, NULL, TMUX_WRAP(tmux, "\033]Pl%p1%06x\033\\"));
} else if (xterm || (vte_version != 0) || rxvt) {
// This seems to be supported for a long time in VTE
// urxvt also supports this
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 4f83b09e1b..1035963136 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -231,7 +231,7 @@ static const int included_patches[] = {
// 501,
// 500,
499,
- // 498,
+ 498,
// 497,
// 496,
// 495,
@@ -605,7 +605,7 @@ static const int included_patches[] = {
127,
// 126,
// 125,
- // 124,
+ 124,
// 123 NA
// 122 NA
121,
@@ -666,7 +666,7 @@ static const int included_patches[] = {
66,
// 65 NA
64,
- // 63,
+ // 63 NA
62,
// 61 NA
60,
@@ -683,7 +683,7 @@ static const int included_patches[] = {
49,
// 48 NA
47,
- // 46,
+ 46,
// 45 NA
// 44,
43,
@@ -717,7 +717,7 @@ static const int included_patches[] = {
// 15 NA
// 14 NA
// 13 NA
- // 12,
+ 12,
// 11 NA
// 10 NA
// 9 NA