Compare commits

..

27 Commits

Author SHA1 Message Date
e1a32310d5 patch 8.0.1719: cannot specify which Python executable configure should use
Problem:    Cannot specify which Python executable configure should use.
Solution:   Add --with-python-command and --with-python3-command.
2018-04-15 16:03:25 +02:00
6c672194cd patch 8.0.1718: terminal scrollback test fails on MS-Windows
Problem:    Terminal scrollback test fails on MS-Windows.
Solution:   Check for the last line of output anticipating there might be an
            empty line below it.
2018-04-15 13:28:42 +02:00
3cba73423e patch 8.0.1717: C89 check causes too much trouble
Problem:    C89 check causes too much trouble.
Solution:   Remove enforcing C89 for now.
2018-04-15 13:12:46 +02:00
ac3e830065 patch 8.0.1716: test for term_setsize() does not give a good error message
Problem:    Test for term_setsize() does not give a good error message.
Solution:   use assert_inrange().
2018-04-15 13:10:44 +02:00
8c94a54905 patch 8.0.1715: terminal buffer can be 1 more than 'terminalscroll' lines
Problem:    Terminal buffer can be 1 more than 'terminalscroll' lines.
Solution:   Change > to >=.
2018-04-15 12:55:13 +02:00
6e72cd0d72 patch 8.0.1714: term_setsize() does not give an error in a normal buffer
Problem:    Term_setsize() does not give an error in a normal buffer.
Solution:   Add an error message.
2018-04-14 21:31:35 +02:00
b3623a382a patch 8.0.1713: terminal debugger doesn't handle arguments
Problem:    Terminal debugger doesn't handle arguments.
Solution:   Use <f-args> and pass all the arguments to gdb, e.g. the core file
            or process number. (suggested by Christian Brabandt) Disallow
            starting the debugger twice.
2018-04-14 18:59:50 +02:00
8c041b6b95 patch 8.0.1712: terminal scrollback is not limited
Problem:    Terminal scrollback is not limited.
Solution:   Add the 'terminalscroll' option.
2018-04-14 18:14:06 +02:00
a42d363bac patch 8.0.1711: term_setsize() is not implemented yet
Problem:    Term_setsize() is not implemented yet.
Solution:   Implement it.
2018-04-14 17:05:38 +02:00
2a43230ce3 patch 8.0.1710: building with Ruby fails
Problem:    Building with Ruby fails.
Solution:   Don't add -ansi when building with Ruby.
2018-04-14 16:12:30 +02:00
2e324950b8 patch 8.0.1709: some non-C89 code may slip through
Problem:    Some non-C89 code may slip through.
Solution:   Enforce C89 in configure. Fix detected problems. (James McCoy,
            closes #2735)
2018-04-14 14:37:07 +02:00
78a16b0f2a patch 8.0.1708: mkdir with 'p' flag fails on existing directory
Problem:    Mkdir with 'p' flag fails on existing directory, which is
            different from the mkdir shell command.
Solution:   Don't fail if the directory already exists. (James McCoy,
            closes #2775)
2018-04-14 13:51:55 +02:00
98da6ecab9 patch 8.0.1707: when 'wfh' is set ":bel 10new" scrolls window
Problem:    When 'wfh' is set ":bel 10new" scrolls window. (Andrew Pyatkov)
Solution:   Set the fraction before changing the window height. (closes #2798)
2018-04-13 22:15:46 +02:00
b59118d501 patch 8.0.1706: cannot sent CTRL-\ to a terminal window
Problem:    Cannot sent CTRL-\ to a terminal window.
Solution:   Make CTRL-W CTRL-\ send CTRL-\ to a terminal window.
2018-04-13 22:11:56 +02:00
5bab555c2f patch 8.0.1705: when making a vertical split the mode message isn't updated
Problem:    When making a vertical split the mode message isn't always
            updated, "VISUAL" remains. (Alexei Averchenko)
Solution:   Only reset clear_cmdline when filling all columns of the last
            screen line. (Tom M. closes #2611)
2018-04-13 20:41:29 +02:00
b8e22a053b patch 8.0.1704: 'backupskip' default doesn't work for Mac
Problem:    'backupskip' default doesn't work for Mac.
Solution:   Use "/private/tmp". (Rainer Müller, closes #2793)
2018-04-12 21:37:34 +02:00
527dec3f94 patch 8.0.1703: in the tutor 'showcmd' is not set
Problem:    In the tutor 'showcmd' is not set.
Solution:   Set 'showcmd' in the vimtutor script. (Ken Takata, closes #2792)
2018-04-12 20:36:43 +02:00
ee5b94a8ec patch 8.0.1702: leaking memory when autocommands make quickfix list invalid
Problem:    Leaking memory when autocommands make a quickfix list invalid.
Solution:   Call FreeWild(). (Yegappan Lakshmanan)
2018-04-12 20:35:05 +02:00
cccd62d435 patch 8.0.1701: can disable COLOR_EMOJI with MSVC but not MinGW
Problem:    Can disable COLOR_EMOJI with MSVC but not MinGW.
Solution:   Add COLOR_EMOJI flag.  Also add some empty lines for readability.
2018-04-12 20:23:48 +02:00
56f9955044 patch 8.0.1700: coverage statistics still don't work on coveralls
Problem:    Coverate statistics still don't work on coveralls.
Solution:   Exclude the xxd directory again.
2018-04-12 20:06:05 +02:00
9ce4213b03 patch 8.0.1699: leftover stuff for Python 1.4
Problem:    Leftover stuff for Python 1.4.
Solution:   Remove outdated Python 1.4 stuff. (Naoki Inada, closes #2794)
2018-04-11 22:19:36 +02:00
1ed00330bc patch 8.0.1698: coverage statistics don't work on coveralls
Problem:    Coverate statistics don't work on coveralls.
Solution:   Use curly braces for $SRCDIR.
2018-04-11 21:03:08 +02:00
769e9d21ac patch 8.0.1697: various tests are still a bit flaky
Problem:    Various tests are still a bit flaky.
Solution:   Increase the default wait time to five seconds.
2018-04-11 20:53:49 +02:00
d60e0a1d20 patch 8.0.1696: coverage statistics don't work
Problem:    Coverate statistics don't work.
Solution:   Include the xxd directory. (Christian Brabandt)
2018-04-11 10:06:04 +02:00
6995c0a7a9 patch 8.0.1695: xxd test not run on MS-Windows
Problem:    Xxd test not run on MS-Windows.
Solution:   Use xxd.exe if it exists.
2018-04-10 21:46:10 +02:00
b377457e69 patch 8.0.1694: terminal API test is a bit flaky
Problem:    Terminal API test is a bit flaky.
Solution:   Wait longer for Vim to stop.
2018-04-10 21:43:26 +02:00
1acdb3f301 patch 8.0.1693: xxd is excluded from coverage statistics
Problem:    Xxd is excluded from coverage statistics.
Solution:   Don't skip the xxd directory. (Christian Brabandt)
2018-04-10 21:16:32 +02:00
34 changed files with 563 additions and 129 deletions

View File

@ -108,7 +108,7 @@ script:
- if [ -n "$err" ]; then exit 1; fi
after_success:
- if [ "$COVERAGE" = "yes" ]; then ~/.local/bin/coveralls -b $SRCDIR -x .xs -e ${SRCDIR}/xxd -e ${SRCDIR}/if_perl.c --encodings utf-8 latin-1 EUC-KR; fi
- if [ "$COVERAGE" = "yes" ]; then cd $SRCDIR && bash <(curl -s https://codecov.io/bash) ; fi
- if [ "$COVERAGE" = "yes" ]; then ~/.local/bin/coveralls -b ${SRCDIR} -x .xs -e ${SRCDIR}/xxd -e ${SRCDIR}/if_perl.c --encodings utf-8 latin-1 EUC-KR; fi
- if [ "$COVERAGE" = "yes" ]; then cd ${SRCDIR} && bash <(curl -s https://codecov.io/bash) ; fi
# vim:set sts=2 sw=2 tw=0 et:

View File

@ -6138,6 +6138,8 @@ mkdir({name} [, {path} [, {prot}]])
Example: >
:call mkdir($HOME . "/tmp/foo/bar", "p", 0700)
< This function is not available in the |sandbox|.
There is no error if the directory already exists and the "p"
flag is passed (since patch 8.0.1708).
Not available on all systems. To check use: >
:if exists("*mkdir")
<
@ -8400,6 +8402,24 @@ term_setansicolors({buf}, {colors}) *term_setansicolors()*
color codes, like those accepted by |highlight-guifg|.
Also see |term_getansicolors()| and |g:terminal_ansi_colors|.
The colors normally are:
0 black
1 dark red
2 dark green
3 brown
4 dark blue
5 dark magenta
6 dark cyan
7 light grey
8 dark grey
9 red
10 green
11 yellow
12 blue
13 magenta
14 cyan
15 white
These colors are used in the GUI and in the terminal when
'termguicolors' is set. When not using GUI colors (GUI mode
or |termguicolors|), the terminal window always uses the 16
@ -8429,8 +8449,15 @@ term_setrestore({buf}, {command}) *term_setrestore()*
Use "NONE" to not restore this window.
{only available when compiled with the |+terminal| feature}
term_setsize({buf}, {expr}) *term_setsize()*
Not implemented yet.
term_setsize({buf}, {rows}, {cols}) *term_setsize()*
Set the size of terminal {buf}. The size of the window
containing the terminal will also be adjusted, if possible.
If {rows} or {cols} is zero or negative, that dimension is not
changed.
{buf} must be the buffer number of a terminal window. Use an
empty string for the current buffer. If the buffer does not
exist or is not a terminal window, an error is given.
{only available when compiled with the |+terminal| feature}
term_start({cmd}, {options}) *term_start()*

View File

@ -1,4 +1,4 @@
*options.txt* For Vim version 8.0. Last change: 2018 Mar 13
*options.txt* For Vim version 8.0. Last change: 2018 Apr 14
VIM REFERENCE MANUAL by Bram Moolenaar
@ -1087,7 +1087,9 @@ A jump table for the options with a short description can be found at |Q_op|.
< Use 'backupdir' to put the backup in a different directory.
*'backupskip'* *'bsk'*
'backupskip' 'bsk' string (default: "/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*")
'backupskip' 'bsk' string (default: "$TMPDIR/*,$TMP/*,$TEMP/*"
Unix: "/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*"
Mac: "/private/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*")
global
{not in Vi}
{not available when compiled without the |+wildignore|
@ -7931,6 +7933,16 @@ A jump table for the options with a short description can be found at |Q_op|.
Note that the "cterm" attributes are still used, not the "gui" ones.
NOTE: This option is reset when 'compatible' is set.
*'terminalscroll'* *'tlsl'*
'terminalscroll' 'tlsl' number (default 10000)
global
{not in Vi}
{not available when compiled without the
|+terminal| feature}
Number of scrollback lines to keep. When going over this limit the
first 10% of the scrollback lines are deleted. This is just to reduce
the memory usage. See |Terminal-Normal|.
*'termkey'* *'tk'*
'termkey' 'tk' string (default "")
local to window

View File

@ -72,6 +72,7 @@ See |CTRL-W| for more commands.
Special in the terminal window: *CTRL-W_.* *CTRL-W_N*
CTRL-W . send a CTRL-W to the job in the terminal
CTRL-W CTRL-\ send a CTRL-\ to the job in the terminal
CTRL-W N go to Terminal-Normal mode, see |Terminal-mode|
CTRL-\ CTRL-N go to Terminal-Normal mode, see |Terminal-mode|
CTRL-W " {reg} paste register {reg} *CTRL-W_quote*
@ -287,7 +288,7 @@ not when 'termsize' is "rowsXcols".
Terminal-Job and Terminal-Normal mode ~
*Terminal-mode*
*Terminal-mode* *Terminal-Job*
When the job is running the contents of the terminal is under control of the
job. That includes the cursor position. Typed keys are sent to the job.
The terminal contents can change at any time. This is called Terminal-Job
@ -300,7 +301,9 @@ suspended. CTRL-\ CTRL-N does the same.
Terminal-Job mode is where |:tmap| mappings are applied. Keys sent by
|term_sendkeys()| are not subject to tmap, but keys from |feedkeys()| are.
*E946*
It is not possible to enter Insert mode from Terminal-Job mode.
*Terminal-Normal* *E946*
In Terminal-Normal mode you can move the cursor around with the usual Vim
commands, Visually mark text, yank text, etc. But you cannot change the
contents of the buffer. The commands that would start insert mode, such as
@ -311,7 +314,10 @@ In Terminal-Normal mode the statusline and window title show "(Terminal)". If
the job ends while in Terminal-Normal mode this changes to
"(Terminal-finished)".
It is not possible to enter Insert mode from Terminal-Job mode.
When the job outputs lines in the terminal, such that the contents scrolls off
the top, those lines are remembered and can be seen in Terminal-Normal mode.
The number of lines is limited by the 'terminalscroll' option. When going over
this limit, the first 10% of the scrolled lins are deleted and are lost.
Cursor style ~
@ -643,6 +649,13 @@ the same as any command running in a terminal window.
When the debugger ends, typically by typing "quit" in the gdb window, the two
opened windows are closed.
Only one debugger can be active at a time.
To attach gdb to an already running executable, or use a core file, pass extra
arguments. E.g.: >
:Termdebug vim core
:Termdebug vim 98343
Example session ~
*termdebug-example*

View File

@ -25,7 +25,7 @@ endif
" The command that starts debugging, e.g. ":Termdebug vim".
" To end type "quit" in the gdb window.
command -nargs=* -complete=file Termdebug call s:StartDebug(<q-args>)
command -nargs=* -complete=file Termdebug call s:StartDebug(<f-args>)
" Name of the gdb command, defaults to "gdb".
if !exists('termdebugger')
@ -43,7 +43,12 @@ else
endif
hi default debugBreakpoint term=reverse ctermbg=red guibg=red
func s:StartDebug(cmd)
func s:StartDebug(...)
if exists('s:gdbwin')
echoerr 'Terminal debugger already running'
return
endif
let s:startwin = win_getid(winnr())
let s:startsigncolumn = &signcolumn
@ -90,7 +95,7 @@ func s:StartDebug(cmd)
" Open a terminal window to run the debugger.
" Add -quiet to avoid the intro message causing a hit-enter prompt.
let cmd = [g:termdebugger, '-quiet', '-tty', pty, a:cmd]
let cmd = [g:termdebugger, '-quiet', '-tty', pty] + a:000
echomsg 'executing "' . join(cmd) . '"'
let s:gdbbuf = term_start(cmd, {
\ 'exit_cb': function('s:EndDebug'),
@ -112,7 +117,7 @@ func s:StartDebug(cmd)
let try_count = 0
while 1
let response = ''
for lnum in range(1,20)
for lnum in range(1,200)
if term_getline(s:gdbbuf, lnum) =~ 'new-ui mi '
let response = term_getline(s:gdbbuf, lnum + 1)
if response =~ 'Undefined command'
@ -182,6 +187,7 @@ endfunc
func s:EndDebug(job, status)
exe 'bwipe! ' . s:ptybuf
exe 'bwipe! ' . s:commbuf
unlet s:gdbwin
let curwinid = win_getid(winnr())
@ -295,6 +301,7 @@ func s:DeleteCommands()
delcommand Evaluate
delcommand Gdb
delcommand Program
delcommand Source
delcommand Winbar
nunmap K

View File

@ -28,52 +28,71 @@
# Updated 2014 Oct 13.
#>>>>> choose options:
# set to yes for a debug build
DEBUG=no
# set to SIZE for size, SPEED for speed, MAXSPEED for maximum optimization
OPTIMIZE=MAXSPEED
# set to yes to make gvim, no for vim
GUI=yes
# set to no if you do not want to use DirectWrite (DirectX)
# MinGW-w64 is needed, and ARCH should be set to i686 or x86-64.
DIRECTX=yes
# FEATURES=[TINY | SMALL | NORMAL | BIG | HUGE]
# Set to TINY to make minimal version (few features).
FEATURES=HUGE
# set to yes for a debug build
DEBUG=no
# set to SIZE for size, SPEED for speed, MAXSPEED for maximum optimization
OPTIMIZE=MAXSPEED
# set to yes to make gvim, no for vim
GUI=yes
# set to no if you do not want to use DirectWrite (DirectX)
# MinGW-w64 is needed, and ARCH should be set to i686 or x86-64.
DIRECTX=yes
# Disable Color emoji support
# (default is yes if DIRECTX=yes, requires WinSDK 8.1 or later.)
#COLOR_EMOJI=no
# Set to one of i386, i486, i586, i686 as the minimum target processor.
# For amd64/x64 architecture set ARCH=x86-64 .
# If not set, it will be automatically detected. (Normally i686 or x86-64.)
#ARCH=i686
# Set to yes to cross-compile from unix; no=native Windows (and Cygwin).
CROSS=no
# Set to path to iconv.h and libiconv.a to enable using 'iconv.dll'.
# Use "yes" when the path does not need to be define.
#ICONV="."
ICONV=yes
GETTEXT=yes
# Set to yes to include multibyte support.
MBYTE=yes
# Set to yes to include IME support.
IME=yes
DYNAMIC_IME=yes
# Set to yes to enable writing a postscript file with :hardcopy.
POSTSCRIPT=no
# Set to yes to enable OLE support.
OLE=no
# Set the default $(WINVER) to make it work with WinXP.
ifndef WINVER
WINVER = 0x0501
endif
# Set to yes to enable Cscope support.
CSCOPE=yes
# Set to yes to enable Netbeans support (requires CHANNEL).
NETBEANS=$(GUI)
# Set to yes to enable inter process communication.
ifeq (HUGE, $(FEATURES))
CHANNEL=yes
else
CHANNEL=$(GUI)
endif
# Set to yes to enable terminal support.
ifeq (HUGE, $(FEATURES))
TERMINAL=yes
@ -588,7 +607,10 @@ endif
ifeq ($(DIRECTX),yes)
# Only allow DirectWrite for a GUI build.
ifeq (yes, $(GUI))
DEFINES += -DFEAT_DIRECTX -DDYNAMIC_DIRECTX -DFEAT_DIRECTX_COLOR_EMOJI
DEFINES += -DFEAT_DIRECTX -DDYNAMIC_DIRECTX
ifneq ($(COLOR_EMOJI),no)
DEFINES += -DFEAT_DIRECTX_COLOR_EMOJI
endif
endif
endif

View File

@ -3170,12 +3170,6 @@ objects/if_perl.o: auto/if_perl.c
objects/if_perlsfio.o: if_perlsfio.c
$(CCC_NF) $(PERL_CFLAGS) $(ALL_CFLAGS) -o $@ if_perlsfio.c
objects/py_getpath.o: $(PYTHON_CONFDIR)/getpath.c
$(CCC_NF) $(PYTHON_CFLAGS) $(ALL_CFLAGS) -o $@ \
$(PYTHON_CONFDIR)/getpath.c \
-I$(PYTHON_CONFDIR) -DHAVE_CONFIG_H -DNO_MAIN \
$(PYTHON_GETPATH_CFLAGS)
objects/if_python.o: if_python.c if_py_both.h
$(CCC_NF) $(PYTHON_CFLAGS) $(PYTHON_CFLAGS_EXTRA) $(ALL_CFLAGS) -o $@ if_python.c

151
src/auto/configure vendored
View File

@ -679,14 +679,11 @@ PYTHON3_OBJ
PYTHON3_SRC
PYTHON3_CFLAGS
PYTHON3_LIBS
PYTHON3_CONFDIR
vi_cv_path_python3
PYTHON_OBJ
PYTHON_SRC
PYTHON_CFLAGS
PYTHON_GETPATH_CFLAGS
PYTHON_LIBS
PYTHON_CONFDIR
vi_cv_path_python
PERL_LIBS
PERL_CFLAGS
@ -805,8 +802,10 @@ enable_mzschemeinterp
with_plthome
enable_perlinterp
enable_pythoninterp
with_python_command
with_python_config_dir
enable_python3interp
with_python3_command
with_python3_config_dir
enable_tclinterp
with_tclsh
@ -1535,8 +1534,10 @@ Optional Packages:
--with-lua-prefix=PFX Prefix where Lua is installed.
--with-luajit Link with LuaJIT instead of Lua.
--with-plthome=PLTHOME Use PLTHOME.
--with-python-config-dir=PATH Python's config directory
--with-python3-config-dir=PATH Python's config directory
--with-python-command=NAME name of the Python 2 command (default: python2 or python)
--with-python-config-dir=PATH Python's config directory (deprecated)
--with-python3-command=NAME name of the Python 3 command (default: python3 or python)
--with-python3-config-dir=PATH Python's config directory (deprecated)
--with-tclsh=PATH which tclsh to use (default: tclsh8.0)
--with-ruby-command=RUBY name of the Ruby command (default: ruby)
--with-x use the X Window System
@ -3452,6 +3453,97 @@ ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
if ${ac_cv_prog_cc_c89+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_cv_prog_cc_c89=no
ac_save_CC=$CC
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdarg.h>
#include <stdio.h>
struct stat;
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
static char *e (p, i)
char **p;
int i;
{
return p[i];
}
static char *f (char * (*g) (char **, int), char **p, ...)
{
char *s;
va_list v;
va_start (v,p);
s = g (p, va_arg (v,int));
va_end (v);
return s;
}
/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
function prototypes and stuff, but not '\xHH' hex character constants.
These don't provoke an error unfortunately, instead are silently treated
as 'x'. The following induces an error, until -std is added to get
proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
array size at least. It's necessary to write '\x00'==0 to get something
that's true only with -std. */
int osf4_cc_array ['\x00' == 0 ? 1 : -1];
/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
inside strings and character constants. */
#define FOO(x) 'x'
int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
int
main ()
{
return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
;
return 0;
}
_ACEOF
for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_c89=$ac_arg
fi
rm -f core conftest.err conftest.$ac_objext
test "x$ac_cv_prog_cc_c89" != "xno" && break
done
rm -f conftest.$ac_ext
CC=$ac_save_CC
fi
# AC_CACHE_VAL
case "x$ac_cv_prog_cc_c89" in
x)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
$as_echo "none needed" >&6; } ;;
xno)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
$as_echo "unsupported" >&6; } ;;
*)
CC="$CC $ac_cv_prog_cc_c89"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
esac
if test "x$ac_cv_prog_cc_c89" != xno; then :
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@ -4190,7 +4282,7 @@ if test "`(uname) 2>/dev/null`" = Darwin; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
MACOS_X=yes
CPPFLAGS="$CPPFLAGS -DMACOS_X"
CPPFLAGS="$CPPFLAGS -D_DARWIN_C_SOURCE -DMACOS_X"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --disable-darwin argument" >&5
$as_echo_n "checking --disable-darwin argument... " >&6; }
@ -5849,6 +5941,21 @@ if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic"; th
as_fn_error $? "cannot use Python with tiny or small features" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-python-command argument" >&5
$as_echo_n "checking --with-python-command argument... " >&6; }
# Check whether --with-python-command was given.
if test "${with_python_command+set}" = set; then :
withval=$with_python_command; vi_cv_path_python="$withval"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python" >&5
$as_echo "$vi_cv_path_python" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "X$vi_cv_path_python" = "X"; then
for ac_prog in python2 python
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
@ -5894,6 +6001,7 @@ fi
test -n "$vi_cv_path_python" && break
done
fi
if test "X$vi_cv_path_python" != "X"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python version" >&5
@ -6018,11 +6126,7 @@ eof
vi_cv_path_python_plibs="-F${python_PYTHONFRAMEWORKPREFIX} -framework Python"
fi
else
if test "${vi_cv_var_python_version}" = "1.4"; then
vi_cv_path_python_plibs="${PYTHON_CONFDIR}/libModules.a ${PYTHON_CONFDIR}/libPython.a ${PYTHON_CONFDIR}/libObjects.a ${PYTHON_CONFDIR}/libParser.a"
else
vi_cv_path_python_plibs="-L${PYTHON_CONFDIR} -lpython${vi_cv_var_python_version}"
fi
vi_cv_path_python_plibs="-L${PYTHON_CONFDIR} -lpython${vi_cv_var_python_version}"
if test -n "${python_LINKFORSHARED}" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then
python_link_symbol=`echo ${python_LINKFORSHARED} | sed 's/\([^ \t][^ \t]*[ \t][ \t]*[^ \t][^ \t]*\)[ \t].*/\1/'`
python_link_path=`echo ${python_LINKFORSHARED} | sed 's/\([^ \t][^ \t]*[ \t][ \t]*[^ \t][^ \t]*\)[ \t][ \t]*\(.*\)/\2/'`
@ -6068,10 +6172,6 @@ $as_echo "$vi_cv_dll_name_python" >&6; }
fi
PYTHON_SRC="if_python.c"
PYTHON_OBJ="objects/if_python.o"
if test "${vi_cv_var_python_version}" = "1.4"; then
PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o"
fi
PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if -pthread should be used" >&5
$as_echo_n "checking if -pthread should be used... " >&6; }
@ -6175,8 +6275,6 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-python3interp argument" >&5
$as_echo_n "checking --enable-python3interp argument... " >&6; }
# Check whether --enable-python3interp was given.
@ -6193,6 +6291,21 @@ if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic";
as_fn_error $? "cannot use Python with tiny or small features" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-python3-command argument" >&5
$as_echo_n "checking --with-python3-command argument... " >&6; }
# Check whether --with-python3-command was given.
if test "${with_python3_command+set}" = set; then :
withval=$with_python3_command; vi_cv_path_python3="$withval"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3" >&5
$as_echo "$vi_cv_path_python3" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "X$vi_cv_path_python3" = "X"; then
for ac_prog in python3 python
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
@ -6238,6 +6351,7 @@ fi
test -n "$vi_cv_path_python3" && break
done
fi
if test "X$vi_cv_path_python3" != "X"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python version" >&5
@ -6504,7 +6618,6 @@ fi
if test "$python_ok" = yes && test "$python3_ok" = yes; then
$as_echo "#define DYNAMIC_PYTHON 1" >>confdefs.h
@ -14323,7 +14436,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need to force -D_FILE_OFFSET_BITS=64" >&5
$as_echo_n "checking whether we need to force -D_FILE_OFFSET_BITS=64... " >&6; }
if echo "$CFLAGS $LUA_CFLAGS $MZSCHEME_CFLAGS $PERL_CFLAGS $PYTHON_GETPATH_CFLAGS $PYTHON_CFLAGS $PYTHON3_CFLAGS $TCL_CFLAGS $RUBY_CFLAGS $GTK_CFLAGS" | grep -q D_FILE_OFFSET_BITS 2>/dev/null; then
if echo "$CFLAGS $LUA_CFLAGS $MZSCHEME_CFLAGS $PERL_CFLAGS $PYTHON_CFLAGS $PYTHON3_CFLAGS $TCL_CFLAGS $RUBY_CFLAGS $GTK_CFLAGS" | grep -q D_FILE_OFFSET_BITS 2>/dev/null; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
$as_echo "#define _FILE_OFFSET_BITS 64" >>confdefs.h

View File

@ -672,9 +672,9 @@ channel_open(
{
char *p;
/* When using host->h_addr directly ubsan warns for it to not be
* aligned. First copy the pointer to aviod that. */
memcpy(&p, &host->h_addr, sizeof(p));
/* When using host->h_addr_list[0] directly ubsan warns for it to not
* be aligned. First copy the pointer to avoid that. */
memcpy(&p, &host->h_addr_list[0], sizeof(p));
memcpy((char *)&server.sin_addr, p, host->h_length);
}

View File

@ -47,8 +47,6 @@ PYTHON_SRC = @PYTHON_SRC@
PYTHON_OBJ = @PYTHON_OBJ@
PYTHON_CFLAGS = @PYTHON_CFLAGS@
PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_CONFDIR = @PYTHON_CONFDIR@
PYTHON_GETPATH_CFLAGS = @PYTHON_GETPATH_CFLAGS@
TCL = @vi_cv_path_tcl@
TCL_SRC = @TCL_SRC@

View File

@ -65,14 +65,11 @@ PYTHON_SRC = @PYTHON_SRC@
PYTHON_OBJ = @PYTHON_OBJ@
PYTHON_CFLAGS = @PYTHON_CFLAGS@
PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_CONFDIR = @PYTHON_CONFDIR@
PYTHON_GETPATH_CFLAGS = @PYTHON_GETPATH_CFLAGS@
PYTHON3_SRC = @PYTHON3_SRC@
PYTHON3_OBJ = @PYTHON3_OBJ@
PYTHON3_CFLAGS = @PYTHON3_CFLAGS@
PYTHON3_LIBS = @PYTHON3_LIBS@
PYTHON3_CONFDIR = @PYTHON3_CONFDIR@
TCL = @vi_cv_path_tcl@
TCL_SRC = @TCL_SRC@

View File

@ -11,7 +11,7 @@ AC_DEFINE(UNIX)
AC_PROG_MAKE_SET
dnl Checks for programs.
AC_PROG_CC dnl required by almost everything
AC_PROG_CC_C89 dnl required by almost everything
AC_PROG_CPP dnl required by header file checks
AC_PROGRAM_EGREP dnl required by AC_EGREP_CPP
AC_PROG_FGREP dnl finds working grep -F
@ -135,7 +135,7 @@ AC_MSG_CHECKING([for Darwin (Mac OS X)])
if test "`(uname) 2>/dev/null`" = Darwin; then
AC_MSG_RESULT(yes)
MACOS_X=yes
CPPFLAGS="$CPPFLAGS -DMACOS_X"
CPPFLAGS="$CPPFLAGS -D_DARWIN_C_SOURCE -DMACOS_X"
AC_MSG_CHECKING(--disable-darwin argument)
AC_ARG_ENABLE(darwin,
@ -1117,7 +1117,15 @@ if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic"; th
fi
dnl -- find the python executable
AC_PATH_PROGS(vi_cv_path_python, python2 python)
AC_MSG_CHECKING(--with-python-command argument)
AC_SUBST(vi_cv_path_python)
AC_ARG_WITH(python-command, [ --with-python-command=NAME name of the Python 2 command (default: python2 or python)],
vi_cv_path_python="$withval"; AC_MSG_RESULT($vi_cv_path_python),
AC_MSG_RESULT(no))
if test "X$vi_cv_path_python" = "X"; then
AC_PATH_PROGS(vi_cv_path_python, python2 python)
fi
if test "X$vi_cv_path_python" != "X"; then
dnl -- get its version number
@ -1156,7 +1164,7 @@ if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic"; th
dnl -- where the Python implementation library archives are
AC_ARG_WITH(python-config-dir,
[ --with-python-config-dir=PATH Python's config directory],
[ --with-python-config-dir=PATH Python's config directory (deprecated)],
[ vi_cv_path_python_conf="${withval}"; have_python_config_dir=1 ] )
AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python_conf,
@ -1211,11 +1219,7 @@ eof
vi_cv_path_python_plibs="-F${python_PYTHONFRAMEWORKPREFIX} -framework Python"
fi
else
if test "${vi_cv_var_python_version}" = "1.4"; then
vi_cv_path_python_plibs="${PYTHON_CONFDIR}/libModules.a ${PYTHON_CONFDIR}/libPython.a ${PYTHON_CONFDIR}/libObjects.a ${PYTHON_CONFDIR}/libParser.a"
else
vi_cv_path_python_plibs="-L${PYTHON_CONFDIR} -lpython${vi_cv_var_python_version}"
fi
vi_cv_path_python_plibs="-L${PYTHON_CONFDIR} -lpython${vi_cv_var_python_version}"
dnl -- Check if the path contained in python_LINKFORSHARED is
dnl usable for vim build. If not, make and try other
dnl candidates.
@ -1262,10 +1266,6 @@ eof
fi
PYTHON_SRC="if_python.c"
PYTHON_OBJ="objects/if_python.o"
if test "${vi_cv_var_python_version}" = "1.4"; then
PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o"
fi
PYTHON_GETPATH_CFLAGS="-DPYTHONPATH='\"${vi_cv_path_pythonpath}\"' -DPREFIX='\"${vi_cv_path_python_pfx}\"' -DEXEC_PREFIX='\"${vi_cv_path_python_epfx}\"'"
dnl On FreeBSD linking with "-pthread" is required to use threads.
dnl _THREAD_SAFE must be used for compiling then.
@ -1334,9 +1334,7 @@ eof
fi
fi
AC_SUBST(PYTHON_CONFDIR)
AC_SUBST(PYTHON_LIBS)
AC_SUBST(PYTHON_GETPATH_CFLAGS)
AC_SUBST(PYTHON_CFLAGS)
AC_SUBST(PYTHON_SRC)
AC_SUBST(PYTHON_OBJ)
@ -1353,7 +1351,15 @@ if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic";
fi
dnl -- find the python3 executable
AC_PATH_PROGS(vi_cv_path_python3, python3 python)
AC_MSG_CHECKING(--with-python3-command argument)
AC_SUBST(vi_cv_path_python3)
AC_ARG_WITH(python3-command, [ --with-python3-command=NAME name of the Python 3 command (default: python3 or python)],
vi_cv_path_python3="$withval"; AC_MSG_RESULT($vi_cv_path_python3),
AC_MSG_RESULT(no))
if test "X$vi_cv_path_python3" = "X"; then
AC_PATH_PROGS(vi_cv_path_python3, python3 python)
fi
if test "X$vi_cv_path_python3" != "X"; then
dnl -- get its version number
@ -1403,7 +1409,7 @@ if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic";
dnl -- where the Python implementation library archives are
AC_ARG_WITH(python3-config-dir,
[ --with-python3-config-dir=PATH Python's config directory],
[ --with-python3-config-dir=PATH Python's config directory (deprecated)],
[ vi_cv_path_python3_conf="${withval}"; have_python3_config_dir=1 ] )
AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python3_conf,
@ -1542,7 +1548,6 @@ eof
fi
fi
AC_SUBST(PYTHON3_CONFDIR)
AC_SUBST(PYTHON3_LIBS)
AC_SUBST(PYTHON3_CFLAGS)
AC_SUBST(PYTHON3_SRC)
@ -4382,7 +4387,7 @@ dnl (e.g. ino_t and off_t), all of Vim's modules must be compiled with a
dnl consistent value. It's therefore safest to force the use of the define
dnl if it's present in any of the *_CFLAGS variables.
AC_MSG_CHECKING(whether we need to force -D_FILE_OFFSET_BITS=64)
if echo "$CFLAGS $LUA_CFLAGS $MZSCHEME_CFLAGS $PERL_CFLAGS $PYTHON_GETPATH_CFLAGS $PYTHON_CFLAGS $PYTHON3_CFLAGS $TCL_CFLAGS $RUBY_CFLAGS $GTK_CFLAGS" | grep -q D_FILE_OFFSET_BITS 2>/dev/null; then
if echo "$CFLAGS $LUA_CFLAGS $MZSCHEME_CFLAGS $PERL_CFLAGS $PYTHON_CFLAGS $PYTHON3_CFLAGS $TCL_CFLAGS $RUBY_CFLAGS $GTK_CFLAGS" | grep -q D_FILE_OFFSET_BITS 2>/dev/null; then
AC_MSG_RESULT(yes)
AC_DEFINE(_FILE_OFFSET_BITS, 64)
else

View File

@ -876,6 +876,7 @@ static struct fst
# endif
{"term_setkill", 2, 2, f_term_setkill},
{"term_setrestore", 2, 2, f_term_setrestore},
{"term_setsize", 3, 3, f_term_setsize},
{"term_start", 1, 2, f_term_start},
{"term_wait", 1, 2, f_term_wait},
#endif
@ -8057,22 +8058,32 @@ f_mkdir(typval_T *argvars, typval_T *rettv)
dir = get_tv_string_buf(&argvars[0], buf);
if (*dir == NUL)
rettv->vval.v_number = FAIL;
else
{
if (*gettail(dir) == NUL)
/* remove trailing slashes */
*gettail_sep(dir) = NUL;
return;
if (argvars[1].v_type != VAR_UNKNOWN)
if (*gettail(dir) == NUL)
/* remove trailing slashes */
*gettail_sep(dir) = NUL;
if (argvars[1].v_type != VAR_UNKNOWN)
{
if (argvars[2].v_type != VAR_UNKNOWN)
{
if (argvars[2].v_type != VAR_UNKNOWN)
prot = (int)get_tv_number_chk(&argvars[2], NULL);
if (prot != -1 && STRCMP(get_tv_string(&argvars[1]), "p") == 0)
mkdir_recurse(dir, prot);
prot = (int)get_tv_number_chk(&argvars[2], NULL);
if (prot == -1)
return;
}
if (STRCMP(get_tv_string(&argvars[1]), "p") == 0)
{
if (mch_isdir(dir))
{
/* With the "p" flag it's OK if the dir already exists. */
rettv->vval.v_number = OK;
return;
}
mkdir_recurse(dir, prot);
}
rettv->vval.v_number = prot == -1 ? FAIL : vim_mkdir_emsg(dir, prot);
}
rettv->vval.v_number = vim_mkdir_emsg(dir, prot);
}
#endif

View File

@ -5607,15 +5607,17 @@ gui_mch_free_font(GuiFont font)
guicolor_T
gui_mch_get_color(char_u *name)
{
guicolor_T color = INVALCOLOR;
if (!gui.in_use) /* can't do this when GUI not running */
return INVALCOLOR;
return color;
if (name != NULL)
color = gui_get_color_cmn(name);
#if GTK_CHECK_VERSION(3,0,0)
return name != NULL ? gui_get_color_cmn(name) : INVALCOLOR;
return color;
#else
guicolor_T color;
color = (name != NULL) ? gui_get_color_cmn(name) : INVALCOLOR;
if (color == INVALCOLOR)
return INVALCOLOR;

View File

@ -815,7 +815,7 @@ python3_end(void)
#endif
if (Py_IsInitialized())
{
// acquire lock before finalizing
/* acquire lock before finalizing */
PyGILState_Ensure();
Py_Finalize();

View File

@ -2748,6 +2748,15 @@ static struct vimoption options[] =
#else
(char_u*)NULL, PV_NONE,
{(char_u *)FALSE, (char_u *)FALSE}
#endif
SCRIPTID_INIT},
{"terminalscroll", "tlsl", P_NUM|P_VI_DEF|P_VIM|P_RBUF,
#ifdef FEAT_TERMINAL
(char_u *)&p_tlsl, PV_NONE,
{(char_u *)10000L, (char_u *)10000L}
#else
(char_u *)NULL, PV_NONE,
{(char_u *)NULL, (char_u *)0L}
#endif
SCRIPTID_INIT},
{"termkey", "tk", P_STRING|P_ALLOCED|P_RWIN|P_VI_DEF,
@ -3367,7 +3376,11 @@ set_init_1(int clean_arg)
mustfree = FALSE;
# ifdef UNIX
if (*names[n] == NUL)
# ifdef MACOS_X
p = (char_u *)"/private/tmp";
# else
p = (char_u *)"/tmp";
# endif
else
# endif
p = vim_getenv((char_u *)names[n], &mustfree);

View File

@ -849,6 +849,9 @@ EXTERN char_u *p_tcldll; /* 'tcldll' */
#ifdef FEAT_ARABIC
EXTERN int p_tbidi; /* 'termbidi' */
#endif
#ifdef FEAT_TERMINAL
EXTERN long p_tlsl; /* 'terminalscroll' */
#endif
#ifdef FEAT_MBYTE
EXTERN char_u *p_tenc; /* 'termencoding' */
#endif

View File

@ -32,19 +32,20 @@ int term_swap_diff(void);
void f_term_dumpdiff(typval_T *argvars, typval_T *rettv);
void f_term_dumpload(typval_T *argvars, typval_T *rettv);
void f_term_getaltscreen(typval_T *argvars, typval_T *rettv);
void f_term_getansicolors(typval_T *argvars, typval_T *rettv);
void f_term_getattr(typval_T *argvars, typval_T *rettv);
void f_term_getcursor(typval_T *argvars, typval_T *rettv);
void f_term_getjob(typval_T *argvars, typval_T *rettv);
void f_term_getline(typval_T *argvars, typval_T *rettv);
void f_term_getscrolled(typval_T *argvars, typval_T *rettv);
void f_term_getsize(typval_T *argvars, typval_T *rettv);
void f_term_setsize(typval_T *argvars, typval_T *rettv);
void f_term_getstatus(typval_T *argvars, typval_T *rettv);
void f_term_gettitle(typval_T *argvars, typval_T *rettv);
void f_term_gettty(typval_T *argvars, typval_T *rettv);
void f_term_list(typval_T *argvars, typval_T *rettv);
void f_term_scrape(typval_T *argvars, typval_T *rettv);
void f_term_sendkeys(typval_T *argvars, typval_T *rettv);
void f_term_getansicolors(typval_T *argvars, typval_T *rettv);
void f_term_setansicolors(typval_T *argvars, typval_T *rettv);
void f_term_setrestore(typval_T *argvars, typval_T *rettv);
void f_term_setkill(typval_T *argvars, typval_T *rettv);

View File

@ -4556,7 +4556,10 @@ ex_vimgrep(exarg_T *eap)
/* Check whether the quickfix list is still valid. When loading a
* buffer above, autocommands might have changed the quickfix list. */
if (!vgr_qflist_valid(wp, qi, save_qfid, *eap->cmdlinep))
{
FreeWild(fcount, fnames);
goto theend;
}
save_qfid = qi->qf_lists[qi->qf_curlist].qf_id;
if (buf == NULL)

View File

@ -8699,7 +8699,8 @@ screen_fill(
if (row == Rows - 1) /* overwritten the command line */
{
redraw_cmdline = TRUE;
if (c1 == ' ' && c2 == ' ')
if (start_col == 0 && end_col == Columns
&& c1 == ' ' && c2 == ' ' && attr == 0)
clear_cmdline = FALSE; /* command line has been cleared */
if (start_col == 0)
mode_displayed = FALSE; /* mode cleared or overwritten */

View File

@ -40,9 +40,6 @@
* TODO:
* - Win32: Make terminal used for :!cmd in the GUI work better. Allow for
* redirection. Probably in call to channel_set_pipes().
* - implement term_setsize()
* - add an optional limit for the scrollback size. When reaching it remove
* 10% at the start.
* - Copy text in the vterm to the Vim buffer once in a while, so that
* completion works.
* - in GUI vertical split causes problems. Cursor is flickering. (Hirohito
@ -2056,6 +2053,11 @@ terminal_loop(int blocking)
/* "CTRL-W .": send CTRL-W to the job */
c = Ctrl_W;
}
else if (termkey == 0 && c == Ctrl_BSL)
{
/* "CTRL-W CTRL-\": send CTRL-\ to the job */
c = Ctrl_BSL;
}
else if (c == 'N')
{
/* CTRL-W N : go to Terminal-Normal mode. */
@ -2173,7 +2175,7 @@ color2index(VTermColor *color, int fg, int *boldp)
case 2: return lookup_color( 4, fg, boldp) + 1; /* dark red */
case 3: return lookup_color( 2, fg, boldp) + 1; /* dark green */
case 4: return lookup_color( 6, fg, boldp) + 1; /* brown */
case 5: return lookup_color( 1, fg, boldp) + 1; /* dark blue*/
case 5: return lookup_color( 1, fg, boldp) + 1; /* dark blue */
case 6: return lookup_color( 5, fg, boldp) + 1; /* dark magenta */
case 7: return lookup_color( 3, fg, boldp) + 1; /* dark cyan */
case 8: return lookup_color( 8, fg, boldp) + 1; /* light grey */
@ -2514,7 +2516,27 @@ handle_pushline(int cols, const VTermScreenCell *cells, void *user)
{
term_T *term = (term_T *)user;
/* TODO: Limit the number of lines that are stored. */
/* If the number of lines that are stored goes over 'termscrollback' then
* delete the first 10%. */
if (term->tl_scrollback.ga_len >= p_tlsl)
{
int todo = p_tlsl / 10;
int i;
curbuf = term->tl_buffer;
for (i = 0; i < todo; ++i)
{
vim_free(((sb_line_T *)term->tl_scrollback.ga_data + i)->sb_cells);
ml_delete(1, FALSE);
}
curbuf = curwin->w_buffer;
term->tl_scrollback.ga_len -= todo;
mch_memmove(term->tl_scrollback.ga_data,
(sb_line_T *)term->tl_scrollback.ga_data + todo,
sizeof(sb_line_T) * term->tl_scrollback.ga_len);
}
if (ga_grow(&term->tl_scrollback, 1) == OK)
{
cellattr_T *p = NULL;
@ -4597,6 +4619,36 @@ f_term_getsize(typval_T *argvars, typval_T *rettv)
list_append_number(l, buf->b_term->tl_cols);
}
/*
* "term_setsize(buf, rows, cols)" function
*/
void
f_term_setsize(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
buf_T *buf = term_get_buf(argvars, "term_setsize()");
term_T *term;
varnumber_T rows, cols;
if (buf == NULL)
{
EMSG(_("E955: Not a terminal buffer"));
return;
}
if (buf->b_term->tl_vterm == NULL)
return;
term = buf->b_term;
rows = get_tv_number(&argvars[1]);
rows = rows <= 0 ? term->tl_rows : rows;
cols = get_tv_number(&argvars[2]);
cols = cols <= 0 ? term->tl_cols : cols;
vterm_set_size(term->tl_vterm, rows, cols);
/* handle_resize() will resize the windows */
/* Get and remember the size we ended up with. Update the pty. */
vterm_get_size(term->tl_vterm, &term->tl_rows, &term->tl_cols);
term_report_winsize(term, term->tl_rows, term->tl_cols);
}
/*
* "term_getstatus(buf)" function
*/
@ -5427,7 +5479,7 @@ term_free_vterm(term_T *term)
}
/*
* Request size to terminal.
* Report the size to the terminal.
*/
static void
term_report_winsize(term_T *term, int rows, int cols)
@ -5509,7 +5561,7 @@ term_free_vterm(term_T *term)
}
/*
* Request size to terminal.
* Report the size to the terminal.
*/
static void
term_report_winsize(term_T *term, int rows, int cols)

View File

@ -60,8 +60,8 @@ func RunVimInTerminal(arguments, options)
call assert_equal([rows, cols], term_getsize(buf))
" Wait for "All" of the ruler in the status line to be shown.
" This can be quite slow (e.g. when using valgrind), wait up to 4 seconds.
call WaitFor({-> len(term_getline(buf, rows)) >= cols - 1}, 4000)
" This can be quite slow (e.g. when using valgrind).
call WaitFor({-> len(term_getline(buf, rows)) >= cols - 1})
return buf
endfunc

View File

@ -113,14 +113,14 @@ func s:kill_server(cmd)
endif
endfunc
" Wait for up to a second for "expr" to become true. "expr" can be a
" Wait for up to five seconds for "expr" to become true. "expr" can be a
" stringified expression to evaluate, or a funcref without arguments.
" A second argument can be used to specify a different timeout in msec.
"
" Return time slept in milliseconds. With the +reltime feature this can be
" more than the actual waiting time. Without +reltime it can also be less.
func WaitFor(expr, ...)
let timeout = get(a:000, 0, 1000)
let timeout = get(a:000, 0, 5000)
" using reltime() is more accurate, but not always available
if has('reltime')
let start = reltime()

View File

@ -1143,7 +1143,7 @@ func Test_pipe_to_buffer_raw()
let job = job_start([s:python, '-c',
\ 'import sys; [sys.stdout.write(".") and sys.stdout.flush() for _ in range(10000)]'], options)
call assert_equal("run", job_status(job))
call WaitFor('len(join(getline(1, "$"), "")) >= 10000', 3000)
call WaitFor('len(join(getline(1, "$"), "")) >= 10000')
try
let totlen = 0
for line in getline(1, '$')
@ -1506,7 +1506,7 @@ func Test_exit_callback_interval()
let g:exit_cb_val = {'start': reltime(), 'end': 0, 'process': 0}
let job = job_start([s:python, '-c', 'import time;time.sleep(0.5)'], {'exit_cb': 'MyExitTimeCb'})
let g:exit_cb_val.process = job_info(job).process
call WaitFor('type(g:exit_cb_val.end) != v:t_number || g:exit_cb_val.end != 0', 2000)
call WaitFor('type(g:exit_cb_val.end) != v:t_number || g:exit_cb_val.end != 0')
let elapsed = reltimefloat(g:exit_cb_val.end)
call assert_true(elapsed > 0.5)
call assert_true(elapsed < 1.0)

View File

@ -32,7 +32,7 @@ func Test_client_server()
" Takes a short while for the server to be active.
" When using valgrind it takes much longer.
call WaitFor('serverlist() =~ "' . name . '"', 5000)
call WaitFor('serverlist() =~ "' . name . '"')
call assert_match(name, serverlist())
call remote_foreground(name)

View File

@ -25,3 +25,20 @@ func Test_nocatch_restore_silent_emsg()
let c5 = nr2char(screenchar(&lines, 5))
call assert_equal('wrong', c1 . c2 . c3 . c4 . c5)
endfunc
func Test_mkdir_p()
call mkdir('Xmkdir/nested', 'p')
call assert_true(isdirectory('Xmkdir/nested'))
try
" Trying to make existing directories doesn't error
call mkdir('Xmkdir', 'p')
call mkdir('Xmkdir/nested', 'p')
catch /E739:/
call assert_report('mkdir(..., "p") failed for an existing directory')
endtry
" 'p' doesn't suppress real errors
call writefile([], 'Xfile')
call assert_fails('call mkdir("Xfile", "p")', 'E739')
call delete('Xfile')
call delete('Xmkdir', 'rf')
endfunc

View File

@ -332,3 +332,19 @@ func Test_set_indentexpr()
call assert_equal('', &indentexpr)
bwipe!
endfunc
func Test_backupskip()
if has("mac")
call assert_match('/private/tmp/\*', &bsk)
elseif has("unix")
call assert_match('/tmp/\*', &bsk)
endif
let bskvalue = substitute(&bsk, '\\', '/', 'g')
for var in ['$TEMPDIR', '$TMP', '$TEMP']
if exists(var)
let varvalue = substitute(expand(var), '\\', '/', 'g')
call assert_match(varvalue . '.\*', bskvalue)
endif
endfor
endfunc

View File

@ -74,20 +74,20 @@ func Do_test_quotestar_for_x11()
" by the server.
let @* = 'no'
call remote_foreground(name)
call WaitFor('remote_expr("' . name . '", "@*", "", 1) == "no"', 3000)
call WaitFor('remote_expr("' . name . '", "@*", "", 1) == "no"')
" Set the * register on the server.
call remote_send(name, ":let @* = 'yes'\<CR>")
call WaitFor('remote_expr("' . name . '", "@*", "", 1) == "yes"', 3000)
call WaitFor('remote_expr("' . name . '", "@*", "", 1) == "yes"')
" Check that the *-register of this vim instance is changed as expected.
call WaitFor('@* == "yes"', 3000)
call WaitFor('@* == "yes"')
" Handle the large selection over 262040 byte.
let length = 262044
let sample = 'a' . repeat('b', length - 2) . 'c'
let @* = sample
call WaitFor('remote_expr("' . name . '", "len(@*) >= ' . length . '", "", 1)', 3000)
call WaitFor('remote_expr("' . name . '", "len(@*) >= ' . length . '", "", 1)')
let res = remote_expr(name, "@*", "", 2)
call assert_equal(length, len(res))
" Check length to prevent a large amount of output at assertion failure.

View File

@ -271,6 +271,27 @@ func Test_terminal_scroll()
call delete('Xtext')
endfunc
func Test_terminal_scrollback()
let buf = Run_shell_in_terminal({})
set terminalscroll=100
call writefile(range(150), 'Xtext')
if has('win32')
call term_sendkeys(buf, "type Xtext\<CR>")
else
call term_sendkeys(buf, "cat Xtext\<CR>")
endif
let rows = term_getsize(buf)[0]
" On MS-Windows there is an empty line, check both last line and above it.
call WaitFor({-> term_getline(buf, rows - 1) . term_getline(buf, rows - 2) =~ '149'})
let lines = line('$')
call assert_inrange(91, 100, lines)
call Stop_shell_in_terminal(buf)
call term_wait(buf)
exe buf . 'bwipe'
set terminalscroll&
endfunc
func Test_terminal_size()
let cmd = Get_cat_123_cmd()
@ -286,9 +307,19 @@ func Test_terminal_size()
vsplit
exe 'terminal ++rows=5 ++cols=33 ' . cmd
let size = term_getsize('')
call assert_equal([5, 33], term_getsize(''))
call term_setsize('', 6, 0)
call assert_equal([6, 33], term_getsize(''))
call term_setsize('', 0, 35)
call assert_equal([6, 35], term_getsize(''))
call term_setsize('', 7, 30)
call assert_equal([7, 30], term_getsize(''))
bwipe!
call assert_equal([5, 33], size)
call assert_fails("call term_setsize('', 7, 30)", "E955:")
call term_start(cmd, {'term_rows': 6, 'term_cols': 36})
let size = term_getsize('')
@ -1061,7 +1092,7 @@ func Api_drop_common(options)
\ "set t_ts=",
\ ], 'Xscript')
let buf = RunVimInTerminal('-S Xscript', {})
call WaitFor({-> bufnr('Xtextfile') > 0}, 5000)
call WaitFor({-> bufnr('Xtextfile') > 0})
call assert_equal('Xtextfile', expand('%:t'))
call assert_true(winnr('$') >= 3)
return buf

View File

@ -483,4 +483,28 @@ func Test_access_freed_mem()
bwipe xxx
endfunc
func Test_visual_cleared_after_window_split()
new | only!
let smd_save = &showmode
set showmode
let ls_save = &laststatus
set laststatus=1
call setline(1, ['a', 'b', 'c', 'd', ''])
norm! G
exe "norm! kkvk"
redraw
exe "norm! \<C-W>v"
redraw
" check if '-- VISUAL --' disappeared from command line
let columns = range(1, &columns)
let cmdlinechars = map(columns, 'nr2char(screenchar(&lines, v:val))')
let cmdline = join(cmdlinechars, '')
let cmdline_ltrim = substitute(cmdline, '^\s*', "", "")
let mode_shown = substitute(cmdline_ltrim, '\s*$', "", "")
call assert_equal('', mode_shown)
let &showmode = smd_save
let &laststatus = ls_save
bwipe!
endfunc
" vim: shiftwidth=2 sts=2 expandtab

View File

@ -1,6 +1,10 @@
" Test for the xxd command
if empty($XXD) || !executable($XXD)
if empty($XXD) && executable('..\xxd\xxd.exe')
let s:xxd_cmd = '..\xxd\xxd.exe'
elseif empty($XXD) || !executable($XXD)
finish
else
let s:xxd_cmd = $XXD
endif
func! PrepareBuffer(lines)
@ -15,11 +19,12 @@ endfunc
func! Test_xxd()
call PrepareBuffer(range(1,30))
set ff=unix
w XXDfile
" Test 1: simple, filter the result through xxd
let s:test = 1
%!$XXD %
exe '%!' . s:xxd_cmd . ' %'
let expected = [
\ '00000000: 310a 320a 330a 340a 350a 360a 370a 380a 1.2.3.4.5.6.7.8.',
\ '00000010: 390a 3130 0a31 310a 3132 0a31 330a 3134 9.10.11.12.13.14',
@ -31,23 +36,23 @@ func! Test_xxd()
" Test 2: reverse the result
let s:test += 1
%!$XXD -r
exe '%!' . s:xxd_cmd . ' -r'
call assert_equal(map(range(1,30), {v,c -> string(c)}), getline(1,'$'), s:Mess(s:test))
" Test 3: Skip the first 30 bytes
let s:test += 1
%!$XXD -s 0x30 %
exe '%!' . s:xxd_cmd . ' -s 0x30 %'
call assert_equal(expected[3:], getline(1,'$'), s:Mess(s:test))
" Test 4: Skip the first 30 bytes
let s:test += 1
%!$XXD -s -0x31 %
exe '%!' . s:xxd_cmd . ' -s -0x31 %'
call assert_equal(expected[2:], getline(1,'$'), s:Mess(s:test))
" Test 5: Print 120 bytes as continuous hexdump with 20 octets per line
let s:test += 1
%d
0r! $XXD -l 120 -ps -c 20 ../../runtime/doc/xxd.1
exe '0r! ' . s:xxd_cmd . ' -l 120 -ps -c 20 ../../runtime/doc/xxd.1'
$d
let expected = [
\ '2e54482058584420312022417567757374203139',
@ -61,7 +66,7 @@ func! Test_xxd()
" Test 6: Print the date from xxd.1
let s:test += 1
%d
0r! $XXD -s 0x36 -l 13 -c 13 ../../runtime/doc/xxd.1
exe '0r! ' . s:xxd_cmd . ' -s 0x36 -l 13 -c 13 ../../runtime/doc/xxd.1'
$d
call assert_equal('00000036: 3231 7374 204d 6179 2031 3939 36 21st May 1996', getline(1), s:Mess(s:test))
@ -69,7 +74,7 @@ func! Test_xxd()
let s:test += 1
call writefile(['TESTabcd09'], 'XXDfile')
%d
0r! $XXD -i XXDfile
exe '0r! ' . s:xxd_cmd . ' -i XXDfile'
$d
let expected = ['unsigned char XXDfile[] = {',
\ ' 0x54, 0x45, 0x53, 0x54, 0x61, 0x62, 0x63, 0x64, 0x30, 0x39, 0x0a', '};',
@ -80,7 +85,7 @@ func! Test_xxd()
let s:test += 1
call writefile(['TESTabcd09'], 'XXDfile')
%d
0r! $XXD -i -C XXDfile
exe '0r! ' . s:xxd_cmd . ' -i -C XXDfile'
$d
let expected = ['unsigned char XXDFILE[] = {',
\ ' 0x54, 0x45, 0x53, 0x54, 0x61, 0x62, 0x63, 0x64, 0x30, 0x39, 0x0a', '};',
@ -91,7 +96,13 @@ func! Test_xxd()
let s:test += 1
call delete('XXDfile')
bwipe! XXDfile
call system('echo "010000: 41"|'.$XXD.' -r -s -0x10000 > XXDfile')
if has('unix')
call system('echo "010000: 41"|' . s:xxd_cmd . ' -r -s -0x10000 > XXDfile')
else
call writefile(['010000: 41'], 'Xinput')
silent exe '!' . s:xxd_cmd . ' -r -s -0x10000 < Xinput > XXDfile'
call delete('Xinput')
endif
call PrepareBuffer(readfile('XXDfile')[0])
call assert_equal('A', getline(1), s:Mess(s:test))
call delete('XXDfile')

View File

@ -762,6 +762,60 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1719,
/**/
1718,
/**/
1717,
/**/
1716,
/**/
1715,
/**/
1714,
/**/
1713,
/**/
1712,
/**/
1711,
/**/
1710,
/**/
1709,
/**/
1708,
/**/
1707,
/**/
1706,
/**/
1705,
/**/
1704,
/**/
1703,
/**/
1702,
/**/
1701,
/**/
1700,
/**/
1699,
/**/
1698,
/**/
1697,
/**/
1696,
/**/
1695,
/**/
1694,
/**/
1693,
/**/
1692,
/**/

View File

@ -70,5 +70,5 @@ fi
# The script tutor.vim tells Vim which file to copy
$VIM -f -u NONE -c 'so $VIMRUNTIME/tutor/tutor.vim'
# Start vim without any .vimrc, set 'nocompatible'
$VIM -f -u NONE -c "set nocp" $TUTORCOPY
# Start vim without any .vimrc, set 'nocompatible' and 'showcmd'
$VIM -f -u NONE -c "set nocp showcmd" $TUTORCOPY

View File

@ -778,6 +778,7 @@ win_split_ins(
int before;
int minheight;
int wmh1;
int did_set_fraction = FALSE;
if (flags & WSP_TOP)
oldwin = firstwin;
@ -959,6 +960,11 @@ win_split_ins(
* instead, if possible. */
if (oldwin->w_p_wfh)
{
/* Set w_fraction now so that the cursor keeps the same relative
* vertical position using the old height. */
set_fraction(oldwin);
did_set_fraction = TRUE;
win_setheight_win(oldwin->w_height + new_size + STATUS_HEIGHT,
oldwin);
oldwin_height = oldwin->w_height;
@ -1088,7 +1094,8 @@ win_split_ins(
/* Set w_fraction now so that the cursor keeps the same relative
* vertical position. */
set_fraction(oldwin);
if (!did_set_fraction)
set_fraction(oldwin);
wp->w_fraction = oldwin->w_fraction;
if (flags & WSP_VERT)