mirror of
https://github.com/zoriya/vim.git
synced 2025-12-21 06:35:17 +00:00
Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
06965b838f | ||
|
|
f3a411783c | ||
|
|
498c2562e1 | ||
|
|
a7eef3d87f | ||
|
|
802bfb1463 | ||
|
|
e1a32310d5 | ||
|
|
6c672194cd | ||
|
|
3cba73423e | ||
|
|
ac3e830065 | ||
|
|
8c94a54905 | ||
|
|
6e72cd0d72 | ||
|
|
b3623a382a | ||
|
|
8c041b6b95 | ||
|
|
a42d363bac | ||
|
|
2a43230ce3 | ||
|
|
2e324950b8 | ||
|
|
78a16b0f2a | ||
|
|
98da6ecab9 | ||
|
|
b59118d501 | ||
|
|
5bab555c2f | ||
|
|
b8e22a053b | ||
|
|
527dec3f94 | ||
|
|
ee5b94a8ec | ||
|
|
cccd62d435 | ||
|
|
56f9955044 | ||
|
|
9ce4213b03 | ||
|
|
1ed00330bc |
@@ -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 -i $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:
|
||||
|
||||
@@ -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()*
|
||||
|
||||
@@ -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
|
||||
@@ -7948,15 +7960,23 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'termsize' 'tms' string (default "")
|
||||
local to window
|
||||
{not in Vi}
|
||||
Size of the |terminal| window. Format: {rows}x{columns}.
|
||||
Size of the |terminal| window. Format: {rows}x{columns} or
|
||||
{rows}*{columns}.
|
||||
- When empty the terminal gets the size from the window.
|
||||
- When set (e.g., "24x80") the terminal size is not adjusted to the
|
||||
window size. If the window is smaller only the top-left part is
|
||||
displayed.
|
||||
When rows is zero then use the height of the window.
|
||||
When columns is zero then use the width of the window.
|
||||
For example: "30x0" uses 30 rows with the current window width.
|
||||
Using "0x0" is the same as empty.
|
||||
- When set with a "x" (e.g., "24x80") the terminal size is not
|
||||
adjusted to the window size. If the window is smaller only the
|
||||
top-left part is displayed.
|
||||
- When set with a "*" (e.g., "10*50") the terminal size follows the
|
||||
window size, but will not be smaller than the specified rows and/or
|
||||
columns.
|
||||
- When rows is zero then use the height of the window.
|
||||
- When columns is zero then use the width of the window.
|
||||
- Using "0x0" or "0*0" is the same as empty.
|
||||
|
||||
Examples:
|
||||
"30x0" uses 30 rows and the current window width.
|
||||
"20*0" uses at least 20 rows and the current window width.
|
||||
"0*40" uses the current window height and at least 40 columns.
|
||||
Note that the command running in the terminal window may still change
|
||||
the size of the terminal. In that case the Vim window will be
|
||||
adjusted to that size, if possible.
|
||||
|
||||
@@ -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*
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
151
src/auto/configure
vendored
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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@
|
||||
|
||||
@@ -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@
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -40,9 +40,9 @@
|
||||
|
||||
#define MINIMAL_SIZE 20 /* minimal size for b_str */
|
||||
|
||||
static buffheader_T redobuff = {{NULL, {NUL}}, NULL, 0, 0};
|
||||
static buffheader_T old_redobuff = {{NULL, {NUL}}, NULL, 0, 0};
|
||||
static buffheader_T recordbuff = {{NULL, {NUL}}, NULL, 0, 0};
|
||||
static buffheader_T redobuff = {NULL, NULL, 0, 0};
|
||||
static buffheader_T old_redobuff = {NULL, NULL, 0, 0};
|
||||
static buffheader_T recordbuff = {NULL, NULL, 0, 0};
|
||||
|
||||
static int typeahead_char = 0; /* typeahead char that's not flushed */
|
||||
|
||||
@@ -138,12 +138,13 @@ free_buff(buffheader_T *buf)
|
||||
{
|
||||
buffblock_T *p, *np;
|
||||
|
||||
for (p = buf->bh_first.b_next; p != NULL; p = np)
|
||||
for (p = buf->bh_first; p != NULL; p = np)
|
||||
{
|
||||
np = p->b_next;
|
||||
vim_free(p);
|
||||
}
|
||||
buf->bh_first.b_next = NULL;
|
||||
buf->bh_first = NULL;
|
||||
buf->bh_curr = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -159,16 +160,16 @@ get_buffcont(
|
||||
char_u *p = NULL;
|
||||
char_u *p2;
|
||||
char_u *str;
|
||||
buffblock_T *bp;
|
||||
buffblock_T *bp;
|
||||
|
||||
/* compute the total length of the string */
|
||||
for (bp = buffer->bh_first.b_next; bp != NULL; bp = bp->b_next)
|
||||
for (bp = buffer->bh_first; bp != NULL; bp = bp->b_next)
|
||||
count += (long_u)STRLEN(bp->b_str);
|
||||
|
||||
if ((count || dozero) && (p = lalloc(count + 1, TRUE)) != NULL)
|
||||
{
|
||||
p2 = p;
|
||||
for (bp = buffer->bh_first.b_next; bp != NULL; bp = bp->b_next)
|
||||
for (bp = buffer->bh_first; bp != NULL; bp = bp->b_next)
|
||||
for (str = bp->b_str; *str; )
|
||||
*p2++ = *str++;
|
||||
*p2 = NUL;
|
||||
@@ -232,17 +233,17 @@ add_buff(
|
||||
long slen) /* length of "s" or -1 */
|
||||
{
|
||||
buffblock_T *p;
|
||||
long_u len;
|
||||
long_u len;
|
||||
|
||||
if (slen < 0)
|
||||
slen = (long)STRLEN(s);
|
||||
if (slen == 0) /* don't add empty strings */
|
||||
return;
|
||||
|
||||
if (buf->bh_first.b_next == NULL) /* first add to list */
|
||||
if (buf->bh_first == NULL) /* first add to list */
|
||||
{
|
||||
buf->bh_space = 0;
|
||||
buf->bh_curr = &(buf->bh_first);
|
||||
buf->bh_curr = NULL;
|
||||
}
|
||||
else if (buf->bh_curr == NULL) /* buffer has already been read */
|
||||
{
|
||||
@@ -250,9 +251,9 @@ add_buff(
|
||||
return;
|
||||
}
|
||||
else if (buf->bh_index != 0)
|
||||
mch_memmove(buf->bh_first.b_next->b_str,
|
||||
buf->bh_first.b_next->b_str + buf->bh_index,
|
||||
STRLEN(buf->bh_first.b_next->b_str + buf->bh_index) + 1);
|
||||
mch_memmove(buf->bh_first->b_str,
|
||||
buf->bh_first->b_str + buf->bh_index,
|
||||
STRLEN(buf->bh_first->b_str + buf->bh_index) + 1);
|
||||
buf->bh_index = 0;
|
||||
|
||||
if (buf->bh_space >= (int)slen)
|
||||
@@ -267,16 +268,25 @@ add_buff(
|
||||
len = MINIMAL_SIZE;
|
||||
else
|
||||
len = slen;
|
||||
p = (buffblock_T *)lalloc((long_u)(sizeof(buffblock_T) + len),
|
||||
TRUE);
|
||||
p = (buffblock_T *)lalloc((long_u)(sizeof(buffblock_T) + len + 1),
|
||||
TRUE);
|
||||
if (p == NULL)
|
||||
return; /* no space, just forget it */
|
||||
buf->bh_space = (int)(len - slen);
|
||||
vim_strncpy(p->b_str, s, (size_t)slen);
|
||||
|
||||
p->b_next = buf->bh_curr->b_next;
|
||||
buf->bh_curr->b_next = p;
|
||||
buf->bh_curr = p;
|
||||
if (buf->bh_curr == NULL)
|
||||
{
|
||||
p->b_next = NULL;
|
||||
buf->bh_first = p;
|
||||
buf->bh_curr = p;
|
||||
}
|
||||
else
|
||||
{
|
||||
p->b_next = buf->bh_curr->b_next;
|
||||
buf->bh_curr->b_next = p;
|
||||
buf->bh_curr = p;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -348,10 +358,10 @@ add_char_buff(buffheader_T *buf, int c)
|
||||
}
|
||||
|
||||
/* First read ahead buffer. Used for translated commands. */
|
||||
static buffheader_T readbuf1 = {{NULL, {NUL}}, NULL, 0, 0};
|
||||
static buffheader_T readbuf1 = {NULL, NULL, 0, 0};
|
||||
|
||||
/* Second read ahead buffer. Used for redo. */
|
||||
static buffheader_T readbuf2 = {{NULL, {NUL}}, NULL, 0, 0};
|
||||
static buffheader_T readbuf2 = {NULL, NULL, 0, 0};
|
||||
|
||||
/*
|
||||
* Get one byte from the read buffers. Use readbuf1 one first, use readbuf2
|
||||
@@ -376,17 +386,17 @@ read_readbuf(buffheader_T *buf, int advance)
|
||||
char_u c;
|
||||
buffblock_T *curr;
|
||||
|
||||
if (buf->bh_first.b_next == NULL) /* buffer is empty */
|
||||
if (buf->bh_first == NULL) /* buffer is empty */
|
||||
return NUL;
|
||||
|
||||
curr = buf->bh_first.b_next;
|
||||
curr = buf->bh_first;
|
||||
c = curr->b_str[buf->bh_index];
|
||||
|
||||
if (advance)
|
||||
{
|
||||
if (curr->b_str[++buf->bh_index] == NUL)
|
||||
{
|
||||
buf->bh_first.b_next = curr->b_next;
|
||||
buf->bh_first = curr->b_next;
|
||||
vim_free(curr);
|
||||
buf->bh_index = 0;
|
||||
}
|
||||
@@ -400,14 +410,14 @@ read_readbuf(buffheader_T *buf, int advance)
|
||||
static void
|
||||
start_stuff(void)
|
||||
{
|
||||
if (readbuf1.bh_first.b_next != NULL)
|
||||
if (readbuf1.bh_first != NULL)
|
||||
{
|
||||
readbuf1.bh_curr = &(readbuf1.bh_first);
|
||||
readbuf1.bh_curr = readbuf1.bh_first;
|
||||
readbuf1.bh_space = 0;
|
||||
}
|
||||
if (readbuf2.bh_first.b_next != NULL)
|
||||
if (readbuf2.bh_first != NULL)
|
||||
{
|
||||
readbuf2.bh_curr = &(readbuf2.bh_first);
|
||||
readbuf2.bh_curr = readbuf2.bh_first;
|
||||
readbuf2.bh_space = 0;
|
||||
}
|
||||
}
|
||||
@@ -418,8 +428,8 @@ start_stuff(void)
|
||||
int
|
||||
stuff_empty(void)
|
||||
{
|
||||
return (readbuf1.bh_first.b_next == NULL
|
||||
&& readbuf2.bh_first.b_next == NULL);
|
||||
return (readbuf1.bh_first == NULL
|
||||
&& readbuf2.bh_first == NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -429,7 +439,7 @@ stuff_empty(void)
|
||||
int
|
||||
readbuf1_empty(void)
|
||||
{
|
||||
return (readbuf1.bh_first.b_next == NULL);
|
||||
return (readbuf1.bh_first == NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -494,7 +504,7 @@ ResetRedobuff(void)
|
||||
{
|
||||
free_buff(&old_redobuff);
|
||||
old_redobuff = redobuff;
|
||||
redobuff.bh_first.b_next = NULL;
|
||||
redobuff.bh_first = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -509,7 +519,7 @@ CancelRedo(void)
|
||||
{
|
||||
free_buff(&redobuff);
|
||||
redobuff = old_redobuff;
|
||||
old_redobuff.bh_first.b_next = NULL;
|
||||
old_redobuff.bh_first = NULL;
|
||||
start_stuff();
|
||||
while (read_readbuffers(TRUE) != NUL)
|
||||
;
|
||||
@@ -526,9 +536,9 @@ saveRedobuff(save_redo_T *save_redo)
|
||||
char_u *s;
|
||||
|
||||
save_redo->sr_redobuff = redobuff;
|
||||
redobuff.bh_first.b_next = NULL;
|
||||
redobuff.bh_first = NULL;
|
||||
save_redo->sr_old_redobuff = old_redobuff;
|
||||
old_redobuff.bh_first.b_next = NULL;
|
||||
old_redobuff.bh_first = NULL;
|
||||
|
||||
/* Make a copy, so that ":normal ." in a function works. */
|
||||
s = get_buffcont(&save_redo->sr_redobuff, FALSE);
|
||||
@@ -747,9 +757,9 @@ read_redo(int init, int old_redo)
|
||||
if (init)
|
||||
{
|
||||
if (old_redo)
|
||||
bp = old_redobuff.bh_first.b_next;
|
||||
bp = old_redobuff.bh_first;
|
||||
else
|
||||
bp = redobuff.bh_first.b_next;
|
||||
bp = redobuff.bh_first;
|
||||
if (bp == NULL)
|
||||
return FAIL;
|
||||
p = bp->b_str;
|
||||
@@ -1372,9 +1382,9 @@ save_typeahead(tasave_T *tp)
|
||||
old_char = -1;
|
||||
|
||||
tp->save_readbuf1 = readbuf1;
|
||||
readbuf1.bh_first.b_next = NULL;
|
||||
readbuf1.bh_first = NULL;
|
||||
tp->save_readbuf2 = readbuf2;
|
||||
readbuf2.bh_first.b_next = NULL;
|
||||
readbuf2.bh_first = NULL;
|
||||
# ifdef USE_INPUT_BUF
|
||||
tp->save_inputbuf = get_input_buf();
|
||||
# endif
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -815,7 +815,7 @@ python3_end(void)
|
||||
#endif
|
||||
if (Py_IsInitialized())
|
||||
{
|
||||
// acquire lock before finalizing
|
||||
/* acquire lock before finalizing */
|
||||
PyGILState_Ensure();
|
||||
|
||||
Py_Finalize();
|
||||
|
||||
@@ -1056,7 +1056,6 @@ main_loop(
|
||||
int cmdwin, /* TRUE when working in the command-line window */
|
||||
int noexmode) /* TRUE when return on entering Ex mode */
|
||||
{
|
||||
oparg_T oa; /* operator arguments */
|
||||
volatile int previous_got_int = FALSE; /* "got_int" was TRUE */
|
||||
#ifdef FEAT_CONCEAL
|
||||
/* these are static to avoid a compiler warning */
|
||||
@@ -1096,6 +1095,7 @@ main_loop(
|
||||
}
|
||||
#endif
|
||||
|
||||
oparg_T oa; /* operator arguments */
|
||||
clear_oparg(&oa);
|
||||
while (!cmdwin
|
||||
#ifdef FEAT_CMDWIN
|
||||
|
||||
17
src/option.c
17
src/option.c
@@ -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);
|
||||
@@ -7451,7 +7464,9 @@ did_set_string_option(
|
||||
if (*curwin->w_p_tms != NUL)
|
||||
{
|
||||
p = skipdigits(curwin->w_p_tms);
|
||||
if (p == curwin->w_p_tms || *p != 'x' || *skipdigits(p + 1) != NUL)
|
||||
if (p == curwin->w_p_tms
|
||||
|| (*p != 'x' && *p != '*')
|
||||
|| *skipdigits(p + 1) != NUL)
|
||||
errmsg = e_invarg;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -511,7 +511,7 @@ typedef struct buffheader buffheader_T;
|
||||
struct buffblock
|
||||
{
|
||||
buffblock_T *b_next; /* pointer to next buffblock */
|
||||
char_u b_str[1]; /* contents (actually longer) */
|
||||
char_u b_str[]; /* contents (flexible array) */
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -519,7 +519,7 @@ struct buffblock
|
||||
*/
|
||||
struct buffheader
|
||||
{
|
||||
buffblock_T bh_first; /* first (dummy) block of list */
|
||||
buffblock_T *bh_first; /* first block of the list */
|
||||
buffblock_T *bh_curr; /* buffblock for appending */
|
||||
int bh_index; /* index for reading */
|
||||
int bh_space; /* space in bh_curr for appending */
|
||||
|
||||
260
src/terminal.c
260
src/terminal.c
@@ -40,30 +40,22 @@
|
||||
* 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.
|
||||
* - Win32: Redirecting output does not work, Test_terminal_redir_file()
|
||||
* is disabled.
|
||||
* - When starting terminal window with shell in terminal, then using :gui to
|
||||
* switch to GUI, shell stops working. Scrollback seems wrong, command
|
||||
* running in shell is still running.
|
||||
* - GUI: when using tabs, focus in terminal, click on tab does not work.
|
||||
* - 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
|
||||
* Higashi, 2017 Sep 19)
|
||||
* - after resizing windows overlap. (Boris Staletic, #2164)
|
||||
* - Redirecting output does not work on MS-Windows, Test_terminal_redir_file()
|
||||
* is disabled.
|
||||
* - cursor blinks in terminal on widows with a timer. (xtal8, #2142)
|
||||
* - Termdebug does not work when Vim build with mzscheme. gdb hangs.
|
||||
* - MS-Windows GUI: WinBar has tearoff item
|
||||
* - MS-Windows GUI: still need to type a key after shell exits? #1924
|
||||
* - After executing a shell command the status line isn't redraw.
|
||||
* - add test for giving error for invalid 'termsize' value.
|
||||
* - support minimal size when 'termsize' is "rows*cols".
|
||||
* - support minimal size when 'termsize' is empty?
|
||||
* - GUI: when using tabs, focus in terminal, click on tab does not work.
|
||||
* - Redrawing is slow with Athena and Motif. Also other GUI? (Ramel Eshed)
|
||||
* - For the GUI fill termios with default values, perhaps like pangoterm:
|
||||
* http://bazaar.launchpad.net/~leonerd/pangoterm/trunk/view/head:/main.c#L134
|
||||
* - when 'encoding' is not utf-8, or the job is using another encoding, setup
|
||||
* - When 'encoding' is not utf-8, or the job is using another encoding, setup
|
||||
* conversions.
|
||||
* - Termdebug does not work when Vim build with mzscheme: gdb hangs just after
|
||||
* "run". Everything else works, including communication channel. Not
|
||||
* initializing mzscheme avoid the problem, thus it's not some #ifdef.
|
||||
*/
|
||||
|
||||
#include "vim.h"
|
||||
@@ -135,9 +127,6 @@ struct terminal_S {
|
||||
/* last known vterm size */
|
||||
int tl_rows;
|
||||
int tl_cols;
|
||||
/* vterm size does not follow window size */
|
||||
int tl_rows_fixed;
|
||||
int tl_cols_fixed;
|
||||
|
||||
char_u *tl_title; /* NULL or allocated */
|
||||
char_u *tl_status_text; /* NULL or allocated */
|
||||
@@ -209,9 +198,38 @@ static int desired_cursor_blink = -1;
|
||||
* 1. Generic code for all systems.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Parse 'termsize' and set "rows" and "cols" for the terminal size in the
|
||||
* current window.
|
||||
* Sets "rows" and/or "cols" to zero when it should follow the window size.
|
||||
* Return TRUE if the size is the minimum size: "24*80".
|
||||
*/
|
||||
static int
|
||||
parse_termsize(win_T *wp, int *rows, int *cols)
|
||||
{
|
||||
int minsize = FALSE;
|
||||
|
||||
*rows = 0;
|
||||
*cols = 0;
|
||||
|
||||
if (*wp->w_p_tms != NUL)
|
||||
{
|
||||
char_u *p = vim_strchr(wp->w_p_tms, 'x');
|
||||
|
||||
/* Syntax of value was already checked when it's set. */
|
||||
if (p == NULL)
|
||||
{
|
||||
minsize = TRUE;
|
||||
p = vim_strchr(wp->w_p_tms, '*');
|
||||
}
|
||||
*rows = atoi((char *)wp->w_p_tms);
|
||||
*cols = atoi((char *)p + 1);
|
||||
}
|
||||
return minsize;
|
||||
}
|
||||
|
||||
/*
|
||||
* Determine the terminal size from 'termsize' and the current window.
|
||||
* Assumes term->tl_rows and term->tl_cols are zero.
|
||||
*/
|
||||
static void
|
||||
set_term_and_win_size(term_T *term)
|
||||
@@ -226,27 +244,21 @@ set_term_and_win_size(term_T *term)
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (*curwin->w_p_tms != NUL)
|
||||
if (parse_termsize(curwin, &term->tl_rows, &term->tl_cols))
|
||||
{
|
||||
char_u *p = vim_strchr(curwin->w_p_tms, 'x') + 1;
|
||||
|
||||
term->tl_rows = atoi((char *)curwin->w_p_tms);
|
||||
term->tl_cols = atoi((char *)p);
|
||||
if (term->tl_rows != 0)
|
||||
term->tl_rows = MAX(term->tl_rows, curwin->w_height);
|
||||
if (term->tl_cols != 0)
|
||||
term->tl_cols = MAX(term->tl_cols, curwin->w_width);
|
||||
}
|
||||
if (term->tl_rows == 0)
|
||||
term->tl_rows = curwin->w_height;
|
||||
else
|
||||
{
|
||||
win_setheight_win(term->tl_rows, curwin);
|
||||
term->tl_rows_fixed = TRUE;
|
||||
}
|
||||
if (term->tl_cols == 0)
|
||||
term->tl_cols = curwin->w_width;
|
||||
else
|
||||
{
|
||||
win_setwidth_win(term->tl_cols, curwin);
|
||||
term->tl_cols_fixed = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1224,19 +1236,34 @@ term_convert_key(term_T *term, int c, char *buf)
|
||||
return (int)vterm_output_read(vterm, buf, KEY_BUF_LEN);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if the job for "term" is still running.
|
||||
* If "check_job_status" is TRUE update the job status.
|
||||
*/
|
||||
static int
|
||||
term_job_running_check(term_T *term, int check_job_status)
|
||||
{
|
||||
/* Also consider the job finished when the channel is closed, to avoid a
|
||||
* race condition when updating the title. */
|
||||
if (term != NULL
|
||||
&& term->tl_job != NULL
|
||||
&& channel_is_open(term->tl_job->jv_channel))
|
||||
{
|
||||
if (check_job_status)
|
||||
job_status(term->tl_job);
|
||||
return (term->tl_job->jv_status == JOB_STARTED
|
||||
|| term->tl_job->jv_channel->ch_keep_open);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if the job for "term" is still running.
|
||||
*/
|
||||
int
|
||||
term_job_running(term_T *term)
|
||||
{
|
||||
/* Also consider the job finished when the channel is closed, to avoid a
|
||||
* race condition when updating the title. */
|
||||
return term != NULL
|
||||
&& term->tl_job != NULL
|
||||
&& channel_is_open(term->tl_job->jv_channel)
|
||||
&& (term->tl_job->jv_status == JOB_STARTED
|
||||
|| term->tl_job->jv_channel->ch_keep_open);
|
||||
return term_job_running_check(term, FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1894,6 +1921,32 @@ prepare_restore_cursor_props(void)
|
||||
may_output_cursor_props();
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns TRUE if the current window contains a terminal and we are sending
|
||||
* keys to the job.
|
||||
* If "check_job_status" is TRUE update the job status.
|
||||
*/
|
||||
static int
|
||||
term_use_loop_check(int check_job_status)
|
||||
{
|
||||
term_T *term = curbuf->b_term;
|
||||
|
||||
return term != NULL
|
||||
&& !term->tl_normal_mode
|
||||
&& term->tl_vterm != NULL
|
||||
&& term_job_running_check(term, check_job_status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns TRUE if the current window contains a terminal and we are sending
|
||||
* keys to the job.
|
||||
*/
|
||||
int
|
||||
term_use_loop(void)
|
||||
{
|
||||
return term_use_loop_check(FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Called when entering a window with the mouse. If this is a terminal window
|
||||
* we may want to change state.
|
||||
@@ -1905,7 +1958,7 @@ term_win_entered()
|
||||
|
||||
if (term != NULL)
|
||||
{
|
||||
if (term_use_loop())
|
||||
if (term_use_loop_check(TRUE))
|
||||
{
|
||||
reset_VIsual_and_resel();
|
||||
if (State & INSERT)
|
||||
@@ -1917,21 +1970,6 @@ term_win_entered()
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns TRUE if the current window contains a terminal and we are sending
|
||||
* keys to the job.
|
||||
*/
|
||||
int
|
||||
term_use_loop(void)
|
||||
{
|
||||
term_T *term = curbuf->b_term;
|
||||
|
||||
return term != NULL
|
||||
&& !term->tl_normal_mode
|
||||
&& term->tl_vterm != NULL
|
||||
&& term_job_running(term);
|
||||
}
|
||||
|
||||
/*
|
||||
* Wait for input and send it to the job.
|
||||
* When "blocking" is TRUE wait for a character to be typed. Otherwise return
|
||||
@@ -1979,7 +2017,7 @@ terminal_loop(int blocking)
|
||||
restore_cursor = TRUE;
|
||||
|
||||
c = term_vgetc();
|
||||
if (!term_use_loop())
|
||||
if (!term_use_loop_check(TRUE))
|
||||
{
|
||||
/* Job finished while waiting for a character. Push back the
|
||||
* received character. */
|
||||
@@ -2030,7 +2068,7 @@ terminal_loop(int blocking)
|
||||
#ifdef FEAT_CMDL_INFO
|
||||
clear_showcmd();
|
||||
#endif
|
||||
if (!term_use_loop())
|
||||
if (!term_use_loop_check(TRUE))
|
||||
/* job finished while waiting for a character */
|
||||
break;
|
||||
|
||||
@@ -2056,6 +2094,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 +2216,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 +2557,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;
|
||||
@@ -2804,6 +2867,10 @@ term_update_window(win_T *wp)
|
||||
VTermScreen *screen;
|
||||
VTermState *state;
|
||||
VTermPos pos;
|
||||
int rows, cols;
|
||||
int newrows, newcols;
|
||||
int minsize;
|
||||
win_T *twp;
|
||||
|
||||
if (term == NULL || term->tl_vterm == NULL || term->tl_normal_mode)
|
||||
return FAIL;
|
||||
@@ -2822,31 +2889,32 @@ term_update_window(win_T *wp)
|
||||
* If the window was resized a redraw will be triggered and we get here.
|
||||
* Adjust the size of the vterm unless 'termsize' specifies a fixed size.
|
||||
*/
|
||||
if ((!term->tl_rows_fixed && term->tl_rows != wp->w_height)
|
||||
|| (!term->tl_cols_fixed && term->tl_cols != wp->w_width))
|
||||
{
|
||||
int rows = term->tl_rows_fixed ? term->tl_rows : wp->w_height;
|
||||
int cols = term->tl_cols_fixed ? term->tl_cols : wp->w_width;
|
||||
win_T *twp;
|
||||
minsize = parse_termsize(wp, &rows, &cols);
|
||||
|
||||
FOR_ALL_WINDOWS(twp)
|
||||
newrows = 99999;
|
||||
newcols = 99999;
|
||||
FOR_ALL_WINDOWS(twp)
|
||||
{
|
||||
/* When more than one window shows the same terminal, use the
|
||||
* smallest size. */
|
||||
if (twp->w_buffer == term->tl_buffer)
|
||||
{
|
||||
/* When more than one window shows the same terminal, use the
|
||||
* smallest size. */
|
||||
if (twp->w_buffer == term->tl_buffer)
|
||||
{
|
||||
if (!term->tl_rows_fixed && rows > twp->w_height)
|
||||
rows = twp->w_height;
|
||||
if (!term->tl_cols_fixed && cols > twp->w_width)
|
||||
cols = twp->w_width;
|
||||
}
|
||||
newrows = MIN(newrows, twp->w_height);
|
||||
newcols = MIN(newcols, twp->w_width);
|
||||
}
|
||||
}
|
||||
newrows = rows == 0 ? newrows : minsize ? MAX(rows, newrows) : rows;
|
||||
newcols = cols == 0 ? newcols : minsize ? MAX(cols, newcols) : cols;
|
||||
|
||||
if (term->tl_rows != newrows || term->tl_cols != newcols)
|
||||
{
|
||||
|
||||
|
||||
term->tl_vterm_size_changed = TRUE;
|
||||
vterm_set_size(vterm, rows, cols);
|
||||
vterm_set_size(vterm, newrows, newcols);
|
||||
ch_log(term->tl_job->jv_channel, "Resizing terminal to %d lines",
|
||||
rows);
|
||||
term_report_winsize(term, rows, cols);
|
||||
newrows);
|
||||
term_report_winsize(term, newrows, newcols);
|
||||
}
|
||||
|
||||
/* The cursor may have been moved when resizing. */
|
||||
@@ -4597,6 +4665,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 +5525,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 +5607,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)
|
||||
|
||||
@@ -57,7 +57,12 @@ func RunVimInTerminal(arguments, options)
|
||||
" Add -v to have gvim run in the terminal (if possible)
|
||||
let cmd .= ' -v ' . a:arguments
|
||||
let buf = term_start(cmd, {'curwin': 1, 'term_rows': rows, 'term_cols': cols})
|
||||
call assert_equal([rows, cols], term_getsize(buf))
|
||||
if &termsize == ''
|
||||
call assert_equal([rows, cols], term_getsize(buf))
|
||||
else
|
||||
let rows = term_getsize(buf)[0]
|
||||
let cols = term_getsize(buf)[1]
|
||||
endif
|
||||
|
||||
" Wait for "All" of the ruler in the status line to be shown.
|
||||
" This can be quite slow (e.g. when using valgrind).
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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('')
|
||||
@@ -1325,3 +1356,102 @@ func Test_terminal_ansicolors_func()
|
||||
call term_wait(buf)
|
||||
exe buf . 'bwipe'
|
||||
endfunc
|
||||
|
||||
func Test_terminal_termsize_option_fixed()
|
||||
if !CanRunVimInTerminal()
|
||||
return
|
||||
endif
|
||||
set termsize=6x40
|
||||
let text = []
|
||||
for n in range(10)
|
||||
call add(text, repeat(n, 50))
|
||||
endfor
|
||||
call writefile(text, 'Xwinsize')
|
||||
let buf = RunVimInTerminal('Xwinsize', {})
|
||||
let win = bufwinid(buf)
|
||||
call assert_equal([6, 40], term_getsize(buf))
|
||||
call assert_equal(6, winheight(win))
|
||||
call assert_equal(40, winwidth(win))
|
||||
|
||||
" resizing the window doesn't resize the terminal.
|
||||
resize 10
|
||||
vertical resize 60
|
||||
call assert_equal([6, 40], term_getsize(buf))
|
||||
call assert_equal(10, winheight(win))
|
||||
call assert_equal(60, winwidth(win))
|
||||
|
||||
call StopVimInTerminal(buf)
|
||||
call delete('Xwinsize')
|
||||
|
||||
call assert_fails('set termsize=40', 'E474')
|
||||
call assert_fails('set termsize=10+40', 'E474')
|
||||
call assert_fails('set termsize=abc', 'E474')
|
||||
|
||||
set termsize=
|
||||
endfunc
|
||||
|
||||
func Test_terminal_termsize_option_zero()
|
||||
set termsize=0x0
|
||||
let buf = Run_shell_in_terminal({})
|
||||
let win = bufwinid(buf)
|
||||
call assert_equal([winheight(win), winwidth(win)], term_getsize(buf))
|
||||
call Stop_shell_in_terminal(buf)
|
||||
call term_wait(buf)
|
||||
exe buf . 'bwipe'
|
||||
|
||||
set termsize=7x0
|
||||
let buf = Run_shell_in_terminal({})
|
||||
let win = bufwinid(buf)
|
||||
call assert_equal([7, winwidth(win)], term_getsize(buf))
|
||||
call Stop_shell_in_terminal(buf)
|
||||
call term_wait(buf)
|
||||
exe buf . 'bwipe'
|
||||
|
||||
set termsize=0x33
|
||||
let buf = Run_shell_in_terminal({})
|
||||
let win = bufwinid(buf)
|
||||
call assert_equal([winheight(win), 33], term_getsize(buf))
|
||||
call Stop_shell_in_terminal(buf)
|
||||
call term_wait(buf)
|
||||
exe buf . 'bwipe'
|
||||
|
||||
set termsize=
|
||||
endfunc
|
||||
|
||||
func Test_terminal_termsize_mininmum()
|
||||
set termsize=10*50
|
||||
vsplit
|
||||
let buf = Run_shell_in_terminal({})
|
||||
let win = bufwinid(buf)
|
||||
call assert_inrange(10, 1000, winheight(win))
|
||||
call assert_inrange(50, 1000, winwidth(win))
|
||||
call assert_equal([winheight(win), winwidth(win)], term_getsize(buf))
|
||||
|
||||
resize 15
|
||||
vertical resize 60
|
||||
redraw
|
||||
call assert_equal([15, 60], term_getsize(buf))
|
||||
call assert_equal(15, winheight(win))
|
||||
call assert_equal(60, winwidth(win))
|
||||
|
||||
resize 7
|
||||
vertical resize 30
|
||||
redraw
|
||||
call assert_equal([10, 50], term_getsize(buf))
|
||||
call assert_equal(7, winheight(win))
|
||||
call assert_equal(30, winwidth(win))
|
||||
|
||||
call Stop_shell_in_terminal(buf)
|
||||
call term_wait(buf)
|
||||
exe buf . 'bwipe'
|
||||
|
||||
set termsize=0*0
|
||||
let buf = Run_shell_in_terminal({})
|
||||
let win = bufwinid(buf)
|
||||
call assert_equal([winheight(win), winwidth(win)], term_getsize(buf))
|
||||
call Stop_shell_in_terminal(buf)
|
||||
call term_wait(buf)
|
||||
exe buf . 'bwipe'
|
||||
|
||||
set termsize=
|
||||
endfunc
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -762,6 +762,60 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1724,
|
||||
/**/
|
||||
1723,
|
||||
/**/
|
||||
1722,
|
||||
/**/
|
||||
1721,
|
||||
/**/
|
||||
1720,
|
||||
/**/
|
||||
1719,
|
||||
/**/
|
||||
1718,
|
||||
/**/
|
||||
1717,
|
||||
/**/
|
||||
1716,
|
||||
/**/
|
||||
1715,
|
||||
/**/
|
||||
1714,
|
||||
/**/
|
||||
1713,
|
||||
/**/
|
||||
1712,
|
||||
/**/
|
||||
1711,
|
||||
/**/
|
||||
1710,
|
||||
/**/
|
||||
1709,
|
||||
/**/
|
||||
1708,
|
||||
/**/
|
||||
1707,
|
||||
/**/
|
||||
1706,
|
||||
/**/
|
||||
1705,
|
||||
/**/
|
||||
1704,
|
||||
/**/
|
||||
1703,
|
||||
/**/
|
||||
1702,
|
||||
/**/
|
||||
1701,
|
||||
/**/
|
||||
1700,
|
||||
/**/
|
||||
1699,
|
||||
/**/
|
||||
1698,
|
||||
/**/
|
||||
1697,
|
||||
/**/
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user