Merge remote-tracking branch 'vim/master'

This commit is contained in:
Yee Cheng Chin
2022-10-06 15:33:20 -07:00
107 changed files with 995 additions and 749 deletions
-1
View File
@@ -7,7 +7,6 @@ environment:
- FEATURE: HUGE
# disabled
# - FEATURE: TINY
# - FEATURE: SMALL
# - FEATURE: NORMAL
# - FEATURE: BIG
+5 -3
View File
@@ -30,15 +30,17 @@ macos_task:
name: macOS m1
macos_instance:
image: ghcr.io/cirruslabs/macos-ventura-xcode:latest
env:
# only run with clang, gcc is not real, it is a link to clang
CC: clang
timeout_in: 20m
install_script:
- uname -a
- brew update
- brew install gettext libtool
build_script:
- NPROC=$(getconf _NPROCESSORS_ONLN)
- ./configure --with-features=${FEATURES}
- make -j${NPROC} CC=clang
- make -j${NPROC}
test_script:
- src/vim --version
- make CC=clang test
- make test
-1
View File
@@ -1124,7 +1124,6 @@ Also see |`=|.
In the command-line window the command line can be edited just like editing
text in any window. It is a special kind of window, because you cannot leave
it in a normal way.
{not available when compiled without the |+cmdwin| feature}
OPEN *c_CTRL-F* *q:* *q/* *q?*
+5
View File
@@ -2971,6 +2971,9 @@ A jump table for the options with a short description can be found at |Q_op|.
When neither "lastline" nor "truncate" is included, a last line that
doesn't fit is replaced with "@" lines.
The "@" character can be changed by setting the "lastline" item in
'fillchars'. The character is highlighted with |hl-NonText|.
*'eadirection'* *'ead'*
'eadirection' 'ead' string (default "both")
global
@@ -3435,6 +3438,7 @@ A jump table for the options with a short description can be found at |Q_op|.
foldsep '|' open fold middle character
diff '-' deleted lines of the 'diff' option
eob '~' empty lines below the end of a buffer
lastline '@' 'display' contains lastline/truncate
Any one that is omitted will fall back to the default. For "stl" and
"stlnc" the space will be used when there is highlighting, '^' or '='
@@ -3457,6 +3461,7 @@ A jump table for the options with a short description can be found at |Q_op|.
fold Folded |hl-Folded|
diff DiffDelete |hl-DiffDelete|
eob EndOfBuffer |hl-EndOfBuffer|
lastline NonText |hl-NonText|
*'fixendofline'* *'fixeol'* *'nofixendofline'* *'nofixeol'*
'fixendofline' 'fixeol' boolean (default on)
+2 -2
View File
@@ -349,14 +349,14 @@ T *++builtin_terms* maximal terminals builtin |builtin-terms| Always
N *+byte_offset* support for 'o' flag in 'statusline' option, "go"
and ":goto" commands.
m *+channel* inter process communication |channel|
6 *+cindent* |'cindent'|, C indenting
T *+cindent* |'cindent'|, C indenting; Always enabled
N *+clientserver* Unix and Win32: Remote invocation |clientserver|
*+clipboard* |clipboard| support compiled-in
*+clipboard_working* |clipboard| support compiled-in and working
T *+cmdline_compl* command line completion |cmdline-completion|
T *+cmdline_hist* command line history |cmdline-history|
N *+cmdline_info* |'showcmd'| and |'ruler'|
S *+cmdwin* |cmdline-window| support
T *+cmdwin* |cmdline-window| support; Always enabled since 9.0.0657
T *+comments* |'comments'| support
B *+conceal* "conceal" support, see |conceal| |:syn-conceal| etc.
N *+cryptv* encryption support |encryption|
+1 -1
View File
@@ -14,7 +14,7 @@ def SetSyn(name: string)
filetype = "fvwm"
endif
if name == "whitespace"
" do not replace the filetype but add whitespace on top
# do not replace the filetype but add whitespace on top
filetype = &ft .. ".whitespace"
endif
if !exists("s:syntax_menu_synonly")
+2 -1
View File
@@ -158,7 +158,8 @@ func! BuildCombiningTable()
let end = -1
let ranges = []
for p in s:dataprops
if p[2] == 'Mn' || p[2] == 'Mc' || p[2] == 'Me'
" The 'Mc' property was removed, it does take up space.
if p[2] == 'Mn' || p[2] == 'Me'
let n = ('0x' . p[0]) + 0
if start >= 0 && end + 1 == n
" continue with same range.
+1 -3
View File
@@ -77,9 +77,7 @@ from CVS mirror ftp://ftp.polarhome.com/pub/cvs/SOURCE/
Parameter name : MODEL
Description : Build model selection
Options: : TINY - Almost no features enabled, not even
multiple windows
SMALL - Few features enabled, as basic as possible
Options: : TINY - No optional features enabled
NORMAL - A default selection of features enabled
BIG - Many features enabled, as rich as possible.
(OpenVMS default)
+2 -2
View File
@@ -45,9 +45,9 @@ CFLAGS +=\
-DFEAT_NORMAL
else
# Vim 'small' build
# Vim 'small' build - now an alias for 'tiny'
ifeq ($(BUILD),small)
CFLAGS += -DFEAT_SMALL
CFLAGS += -DFEAT_TINY
else
# Vim 'tiny' build
+2 -2
View File
@@ -28,8 +28,8 @@
# Updated 2014 Oct 13.
#>>>>> choose options:
# FEATURES=[TINY | SMALL | NORMAL | BIG | HUGE]
# Set to TINY to make minimal version (few features).
# FEATURES=[TINY | NORMAL | BIG | HUGE]
# Set to TINY to make a minimal version (no optional features).
FEATURES=HUGE
# Set to yes for a debug build.
+2 -2
View File
@@ -16,7 +16,7 @@
#
# !!!! After changing any features do "nmake clean" first !!!!
#
# Feature Set: FEATURES=[TINY, SMALL, NORMAL, BIG, HUGE] (default is HUGE)
# Feature Set: FEATURES=[TINY, NORMAL, BIG, HUGE] (default is HUGE)
#
# Name to add to the version: MODIFIED_BY=[name of modifier]
#
@@ -1124,7 +1124,7 @@ CFLAGS = $(CFLAGS) -DMSWINPS
!endif # POSTSCRIPT
#
# FEATURES: TINY, SMALL, NORMAL, BIG or HUGE
# FEATURES: TINY, NORMAL, BIG or HUGE
#
CFLAGS = $(CFLAGS) -DFEAT_$(FEATURES)
+1 -2
View File
@@ -27,8 +27,7 @@
DECC = YES
# Build model selection
# TINY - Almost no features enabled, not even multiple windows
# SMALL - Few features enabled, as basic as possible
# TINY - No optional features enabled
# NORMAL - A default selection of features enabled
# BIG - Many features enabled, as rich as possible. (default)
# HUGE - All possible features enabled.
+5 -5
View File
@@ -386,7 +386,7 @@ CClink = $(CC)
# "liblua5.4-dev".
# Use --with-luajit if you want to use LuaJIT instead of Lua.
# Set PATH environment variable to find lua or luajit executable.
# This requires at least "normal" features, "tiny" and "small" don't work.
# This requires at least "normal" features, "tiny" doesn't work.
#CONF_OPT_LUA = --enable-luainterp
#CONF_OPT_LUA = --enable-luainterp=dynamic
#CONF_OPT_LUA = --enable-luainterp --with-luajit
@@ -415,14 +415,14 @@ CClink = $(CC)
# the next line.
# When you get an error for a missing "perl.exp" file, try creating an empty
# one: "touch perl.exp".
# This requires at least "normal" features, "tiny" and "small" don't work.
# This requires at least "normal" features, "tiny" doesn't work.
#CONF_OPT_PERL = --enable-perlinterp
#CONF_OPT_PERL = --enable-perlinterp=dynamic
# PYTHON
# Uncomment lines here when you want to include the Python interface.
# Debian package is "libpython3-dev".
# This requires at least "normal" features, "tiny" and "small" don't work.
# This requires at least "normal" features, "tiny" doesn't work.
# Python 3 is preferred, Python 2 (often referred to as "Python") has been
# deprecated for a long time.
# NOTE: This may cause threading to be enabled, which has side effects (such
@@ -444,7 +444,7 @@ CClink = $(CC)
# Uncomment this when you want to include the Ruby interface.
# First one for static linking, second one for loading when used.
# Debian package is "ruby-dev".
# This requires at least "normal" features, "tiny" and "small" don't work.
# This requires at least "normal" features, "tiny" doesn't work.
#CONF_OPT_RUBY = --enable-rubyinterp
#CONF_OPT_RUBY = --enable-rubyinterp=dynamic
#CONF_OPT_RUBY = --enable-rubyinterp --with-ruby-command=ruby1.9.1
@@ -453,6 +453,7 @@ CClink = $(CC)
# Uncomment this when you want to include the Tcl interface.
# First one is for static linking, second one for dynamic loading.
# Debian package is "tcl-dev".
# This requires at least "normal" features, "tiny" doesn't work.
#CONF_OPT_TCL = --enable-tclinterp
#CONF_OPT_TCL = --enable-tclinterp=dynamic
#CONF_OPT_TCL = --enable-tclinterp --with-tclsh=tclsh8.4
@@ -530,7 +531,6 @@ CClink = $(CC)
# Uncomment one of these lines when you want to include few to many features.
# The default is "huge" for most systems.
#CONF_OPT_FEAT = --with-features=tiny
#CONF_OPT_FEAT = --with-features=small
#CONF_OPT_FEAT = --with-features=normal
#CONF_OPT_FEAT = --with-features=big
#CONF_OPT_FEAT = --with-features=huge
-2
View File
@@ -1186,13 +1186,11 @@ do_arg_all(
tabpage_T *last_curtab;
int prev_arglist_locked = arglist_locked;
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
{
emsg(_(e_invalid_in_cmdline_window));
return;
}
#endif
if (ARGCOUNT <= 0)
{
// Don't give an error message. We don't want it when the ":all"
+21 -19
View File
@@ -1533,7 +1533,7 @@ Optional Packages:
--with-view-name=NAME what to call the View executable
--with-global-runtime=DIR global runtime directory in 'runtimepath', comma-separated for multiple directories
--with-modified-by=NAME name of who modified a release version
--with-features=TYPE tiny, small, normal, big or huge (default: huge)
--with-features=TYPE tiny, normal, big or huge (default: huge)
--with-compiledby=NAME name to show in :version message
--with-lua-prefix=PFX Prefix where Lua is installed.
--with-luajit Link with LuaJIT instead of Lua.
@@ -5296,12 +5296,14 @@ $as_echo "Defaulting to huge" >&6; }
fi
case "$features" in
small) features="tiny" ;;
esac
dovimdiff=""
dogvimdiff=""
case "$features" in
tiny) $as_echo "#define FEAT_TINY 1" >>confdefs.h
;;
small) $as_echo "#define FEAT_SMALL 1" >>confdefs.h
;;
normal) $as_echo "#define FEAT_NORMAL 1" >>confdefs.h
dovimdiff="installvimdiff";
@@ -5319,7 +5321,7 @@ esac
if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
if test "x$features" = "xtiny"; then
has_eval=no
else
has_eval=yes
@@ -5377,7 +5379,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking diff feature" >&5
$as_echo_n "checking diff feature... " >&6; }
if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
if test "x$features" = "xtiny"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled in $features version" >&5
$as_echo "disabled in $features version" >&6; }
else
@@ -5403,7 +5405,7 @@ $as_echo "$enable_luainterp" >&6; }
if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then
if test "$has_eval" = "no"; then
as_fn_error $? "cannot use Lua with tiny or small features" "$LINENO" 5
as_fn_error $? "cannot use Lua with tiny features" "$LINENO" 5
fi
@@ -6187,7 +6189,7 @@ fi
$as_echo "$enable_perlinterp" >&6; }
if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then
if test "$has_eval" = "no"; then
as_fn_error $? "cannot use Perl with tiny or small features" "$LINENO" 5
as_fn_error $? "cannot use Perl with tiny features" "$LINENO" 5
fi
# Extract the first word of "perl", so it can be a program name with args.
@@ -6405,7 +6407,7 @@ fi
$as_echo "$enable_pythoninterp" >&6; }
if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic"; then
if test "$has_eval" = "no"; then
as_fn_error $? "cannot use Python with tiny or small features" "$LINENO" 5
as_fn_error $? "cannot use Python with tiny features" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-python-command argument" >&5
@@ -6763,7 +6765,7 @@ fi
$as_echo "$enable_python3interp" >&6; }
if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic"; then
if test "$has_eval" = "no"; then
as_fn_error $? "cannot use Python with tiny or small features" "$LINENO" 5
as_fn_error $? "cannot use Python with tiny features" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-python3-command argument" >&5
@@ -7736,7 +7738,7 @@ fi
$as_echo "$enable_rubyinterp" >&6; }
if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
if test "$has_eval" = "no"; then
as_fn_error $? "cannot use Ruby with tiny or small features" "$LINENO" 5
as_fn_error $? "cannot use Ruby with tiny features" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-ruby-command argument" >&5
@@ -7941,8 +7943,8 @@ fi
if test "$enable_netbeans" = "yes"; then
if test "$has_eval" = "no"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot use NetBeans with tiny or small features" >&5
$as_echo "cannot use NetBeans with tiny or small features" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot use NetBeans with tiny features" >&5
$as_echo "cannot use NetBeans with tiny features" >&6; }
enable_netbeans="no"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -7964,8 +7966,8 @@ fi
if test "$enable_channel" = "yes"; then
if test "$has_eval" = "no"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot use channels with tiny or small features" >&5
$as_echo "cannot use channels with tiny or small features" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot use channels with tiny features" >&5
$as_echo "cannot use channels with tiny features" >&6; }
enable_channel="no"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -8268,8 +8270,8 @@ fi
if test "$enable_terminal" = "yes" || test "$enable_terminal" = "auto" -a "x$features" = "xhuge" ; then
if test "$has_eval" = "no"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot use terminal emulator with tiny or small features" >&5
$as_echo "cannot use terminal emulator with tiny or small features" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot use terminal emulator with tiny features" >&5
$as_echo "cannot use terminal emulator with tiny features" >&6; }
enable_terminal="no"
else
if test "$enable_terminal" = "auto"; then
@@ -13132,8 +13134,8 @@ $as_echo "Defaulting to no" >&6; }
fi
else
if test "$enable_canberra" = "yes" -a "$has_eval" = "no"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot use sound with tiny or small features" >&5
$as_echo "cannot use sound with tiny or small features" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot use sound with tiny features" >&5
$as_echo "cannot use sound with tiny features" >&6; }
enable_canberra="no"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_canberra" >&5
@@ -14977,7 +14979,7 @@ rm -f core conftest.err conftest.$ac_objext \
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: msgfmt not found - disabled" >&5
$as_echo "msgfmt not found - disabled" >&6; };
fi
if test $have_gettext = "yes" -a "x$features" != "xtiny" -a "x$features" != "xsmall"; then
if test $have_gettext = "yes" -a "x$features" != "xtiny"; then
$as_echo "#define HAVE_GETTEXT 1" >>confdefs.h
MAKEMO=yes
+4 -1
View File
@@ -713,7 +713,10 @@ changed_bytes(linenr_T lnum, colnr_T col)
// When text has been changed at the end of the line, possibly the start of
// the next line may have SpellCap that should be removed or it needs to be
// displayed. Schedule the next line for redrawing just in case.
if (spell_check_window(curwin) && lnum < curbuf->b_ml.ml_line_count)
// Don't do this when displaying '$' at the end of changed text.
if (spell_check_window(curwin)
&& lnum < curbuf->b_ml.ml_line_count
&& vim_strchr(p_cpo, CPO_DOLLAR) == NULL)
redrawWinline(curwin, lnum + 1);
#endif
#ifdef FEAT_DIFF
-3
View File
@@ -319,9 +319,6 @@
/* Define if you want tiny features. */
#undef FEAT_TINY
/* Define if you want small features. */
#undef FEAT_SMALL
/* Define if you want normal features. */
#undef FEAT_NORMAL
+18 -14
View File
@@ -561,15 +561,19 @@ fi
dnl Check user requested features.
AC_MSG_CHECKING(--with-features argument)
AC_ARG_WITH(features, [ --with-features=TYPE tiny, small, normal, big or huge (default: huge)],
AC_ARG_WITH(features, [ --with-features=TYPE tiny, normal, big or huge (default: huge)],
features="$withval"; AC_MSG_RESULT($features),
features="huge"; AC_MSG_RESULT(Defaulting to huge))
dnl "small" is supported for backwards compatibility, now an alias for "tiny"
case "$features" in
small) features="tiny" ;;
esac
dovimdiff=""
dogvimdiff=""
case "$features" in
tiny) AC_DEFINE(FEAT_TINY) ;;
small) AC_DEFINE(FEAT_SMALL) ;;
normal) AC_DEFINE(FEAT_NORMAL) dovimdiff="installvimdiff";
dogvimdiff="installgvimdiff" ;;
big) AC_DEFINE(FEAT_BIG) dovimdiff="installvimdiff";
@@ -582,7 +586,7 @@ esac
AC_SUBST(dovimdiff)
AC_SUBST(dogvimdiff)
if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
if test "x$features" = "xtiny"; then
has_eval=no
else
has_eval=yes
@@ -616,7 +620,7 @@ else
fi
AC_MSG_CHECKING([diff feature])
if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
if test "x$features" = "xtiny"; then
AC_MSG_RESULT([disabled in $features version])
else
AC_MSG_RESULT(enabled)
@@ -634,7 +638,7 @@ AC_MSG_RESULT($enable_luainterp)
if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then
if test "$has_eval" = "no"; then
AC_MSG_ERROR([cannot use Lua with tiny or small features])
AC_MSG_ERROR([cannot use Lua with tiny features])
fi
dnl -- find the lua executable
@@ -1132,7 +1136,7 @@ AC_ARG_ENABLE(perlinterp,
AC_MSG_RESULT($enable_perlinterp)
if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then
if test "$has_eval" = "no"; then
AC_MSG_ERROR([cannot use Perl with tiny or small features])
AC_MSG_ERROR([cannot use Perl with tiny features])
fi
AC_SUBST(vi_cv_path_perl)
AC_PATH_PROG(vi_cv_path_perl, perl)
@@ -1292,7 +1296,7 @@ AC_ARG_ENABLE(pythoninterp,
AC_MSG_RESULT($enable_pythoninterp)
if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic"; then
if test "$has_eval" = "no"; then
AC_MSG_ERROR([cannot use Python with tiny or small features])
AC_MSG_ERROR([cannot use Python with tiny features])
fi
dnl -- find the python executable
@@ -1537,7 +1541,7 @@ AC_ARG_ENABLE(python3interp,
AC_MSG_RESULT($enable_python3interp)
if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic"; then
if test "$has_eval" = "no"; then
AC_MSG_ERROR([cannot use Python with tiny or small features])
AC_MSG_ERROR([cannot use Python with tiny features])
fi
dnl -- find the python3 executable
@@ -2084,7 +2088,7 @@ AC_ARG_ENABLE(rubyinterp,
AC_MSG_RESULT($enable_rubyinterp)
if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
if test "$has_eval" = "no"; then
AC_MSG_ERROR([cannot use Ruby with tiny or small features])
AC_MSG_ERROR([cannot use Ruby with tiny features])
fi
AC_MSG_CHECKING(--with-ruby-command argument)
@@ -2223,7 +2227,7 @@ AC_ARG_ENABLE(netbeans,
, [enable_netbeans="yes"])
if test "$enable_netbeans" = "yes"; then
if test "$has_eval" = "no"; then
AC_MSG_RESULT([cannot use NetBeans with tiny or small features])
AC_MSG_RESULT([cannot use NetBeans with tiny features])
enable_netbeans="no"
else
AC_MSG_RESULT(no)
@@ -2238,7 +2242,7 @@ AC_ARG_ENABLE(channel,
, [enable_channel="yes"])
if test "$enable_channel" = "yes"; then
if test "$has_eval" = "no"; then
AC_MSG_RESULT([cannot use channels with tiny or small features])
AC_MSG_RESULT([cannot use channels with tiny features])
enable_channel="no"
else
AC_MSG_RESULT(no)
@@ -2346,7 +2350,7 @@ AC_ARG_ENABLE(terminal,
, [enable_terminal="auto"])
if test "$enable_terminal" = "yes" || test "$enable_terminal" = "auto" -a "x$features" = "xhuge" ; then
if test "$has_eval" = "no"; then
AC_MSG_RESULT([cannot use terminal emulator with tiny or small features])
AC_MSG_RESULT([cannot use terminal emulator with tiny features])
enable_terminal="no"
else
if test "$enable_terminal" = "auto"; then
@@ -3906,7 +3910,7 @@ if test "$enable_canberra" = "maybe"; then
fi
else
if test "$enable_canberra" = "yes" -a "$has_eval" = "no"; then
AC_MSG_RESULT([cannot use sound with tiny or small features])
AC_MSG_RESULT([cannot use sound with tiny features])
enable_canberra="no"
else
AC_MSG_RESULT($enable_canberra)
@@ -4629,7 +4633,7 @@ if test "$enable_nls" = "yes"; then
else
AC_MSG_RESULT([msgfmt not found - disabled]);
fi
if test $have_gettext = "yes" -a "x$features" != "xtiny" -a "x$features" != "xsmall"; then
if test $have_gettext = "yes" -a "x$features" != "xtiny"; then
AC_DEFINE(HAVE_GETTEXT)
MAKEMO=yes
AC_SUBST(MAKEMO)
+21 -15
View File
@@ -156,11 +156,7 @@ typedef struct {
// draw_state values for items that are drawn in sequence:
#define WL_START 0 // nothing done yet, must be zero
#ifdef FEAT_CMDWIN
# define WL_CMDLINE (WL_START + 1) // cmdline window column
#else
# define WL_CMDLINE WL_START
#endif
#define WL_CMDLINE (WL_START + 1) // cmdline window column
#ifdef FEAT_FOLDING
# define WL_FOLD (WL_CMDLINE + 1) // 'foldcolumn'
#else
@@ -346,10 +342,17 @@ handle_lnum_col(
int sign_present UNUSED,
int num_attr UNUSED)
{
int has_cpo_n = vim_strchr(p_cpo, CPO_NUMCOL) != NULL;
if ((wp->w_p_nu || wp->w_p_rnu)
&& ((wlv->row == wlv->startrow + wlv->filler_lines
&& (wp->w_skipcol == 0 || wlv->row > wp->w_winrow))
|| vim_strchr(p_cpo, CPO_NUMCOL) == NULL))
&& (wlv->row == wlv->startrow + wlv->filler_lines || !has_cpo_n)
// there is no line number in a wrapped line when "n" is in
// 'cpoptions', but 'breakindent' assumes it anyway.
&& !((has_cpo_n
#ifdef FEAT_LINEBREAK
&& !wp->w_p_bri
#endif
) && wp->w_skipcol > 0 && wlv->lnum == wp->w_topline))
{
#ifdef FEAT_SIGNS
// If 'signcolumn' is set to 'number' and a sign is present
@@ -367,7 +370,7 @@ handle_lnum_col(
#ifdef FEAT_PROP_POPUP
+ wlv->text_prop_above_count
#endif
)
&& (wp->w_skipcol == 0 || wlv->row > wp->w_winrow))
{
long num;
char *fmt = "%*ld ";
@@ -742,12 +745,17 @@ text_prop_position(
/*
* Call screen_line() using values from "wlv".
* Also takes care of putting "<<<" on the first line for 'smoothscroll'.
* Also takes care of putting "<<<" on the first line for 'smoothscroll'
* when 'showbreak' is not set.
*/
static void
wlv_screen_line(win_T *wp, winlinevars_T *wlv, int negative_width)
{
if (wlv->row == 0 && wp->w_skipcol > 0)
if (wlv->row == 0 && wp->w_skipcol > 0
#if defined(FEAT_LINEBREAK)
&& *get_showbreak_value(wp) == NUL
#endif
)
{
int off = (int)(current_ScreenLine - ScreenLines);
@@ -1678,7 +1686,6 @@ win_line(
line_attr = line_attr_save;
}
#endif
#ifdef FEAT_CMDWIN
if (wlv.draw_state == WL_CMDLINE - 1 && wlv.n_extra == 0)
{
wlv.draw_state = WL_CMDLINE;
@@ -1692,7 +1699,6 @@ win_line(
hl_combine_attr(wlv.wcr_attr, HL_ATTR(HLF_AT));
}
}
#endif
#ifdef FEAT_FOLDING
if (wlv.draw_state == WL_FOLD - 1 && wlv.n_extra == 0)
{
@@ -3699,9 +3705,9 @@ win_line(
)
{
#ifdef FEAT_CONCEAL
wlv.col += wlv.boguscols;
wlv_screen_line(wp, &wlv, FALSE);
wlv.col -= wlv.boguscols;
wlv_screen_line(wp, &wlv, FALSE);
wlv.col += wlv.boguscols;
wlv.boguscols = 0;
#else
wlv_screen_line(wp, &wlv, FALSE);
+15 -8
View File
@@ -1102,7 +1102,6 @@ fold_line(
// 1. Add the cmdwin_type for the command-line window
// Ignores 'rightleft', this window is never right-left.
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0 && wp == curwin)
{
ScreenLines[off] = cmdwin_type;
@@ -1111,7 +1110,6 @@ fold_line(
ScreenLinesUC[off] = 0;
++col;
}
#endif
#ifdef FEAT_RIGHTLEFT
# define RL_MEMSET(p, v, l) \
@@ -2643,33 +2641,42 @@ win_update(win_T *wp)
#endif
else if (dy_flags & DY_TRUNCATE) // 'display' has "truncate"
{
int scr_row = W_WINROW(wp) + wp->w_height - 1;
int scr_row = W_WINROW(wp) + wp->w_height - 1;
int symbol = wp->w_fill_chars.lastline;
int charlen;
char_u fillbuf[12]; // 2 characters of 6 bytes
charlen = mb_char2bytes(symbol, &fillbuf[0]);
mb_char2bytes(symbol, &fillbuf[charlen]);
// Last line isn't finished: Display "@@@" in the last screen line.
screen_puts_len((char_u *)"@@", wp->w_width > 2 ? 2 : wp->w_width,
scr_row, wp->w_wincol, HL_ATTR(HLF_AT));
screen_puts_len(fillbuf,
(wp->w_width > 2 ? 2 : wp->w_width) * charlen,
scr_row, wp->w_wincol, HL_ATTR(HLF_AT));
screen_fill(scr_row, scr_row + 1,
(int)wp->w_wincol + 2, (int)W_ENDCOL(wp),
'@', ' ', HL_ATTR(HLF_AT));
symbol, ' ', HL_ATTR(HLF_AT));
set_empty_rows(wp, srow);
wp->w_botline = lnum;
}
else if (dy_flags & DY_LASTLINE) // 'display' has "lastline"
{
int start_col = (int)W_ENDCOL(wp) - 3;
int symbol = wp->w_fill_chars.lastline;
// Last line isn't finished: Display "@@@" at the end.
screen_fill(W_WINROW(wp) + wp->w_height - 1,
W_WINROW(wp) + wp->w_height,
start_col < wp->w_wincol ? wp->w_wincol : start_col,
(int)W_ENDCOL(wp),
'@', '@', HL_ATTR(HLF_AT));
symbol, symbol, HL_ATTR(HLF_AT));
set_empty_rows(wp, srow);
wp->w_botline = lnum;
}
else
{
win_draw_end(wp, '@', ' ', TRUE, srow, wp->w_height, HLF_AT);
win_draw_end(wp, wp->w_fill_chars.lastline, ' ', TRUE,
srow, wp->w_height, HLF_AT);
wp->w_botline = lnum;
}
}
+2 -6
View File
@@ -785,7 +785,6 @@ edit(
// FALLTHROUGH
case Ctrl_C: // End input mode
#ifdef FEAT_CMDWIN
if (c == Ctrl_C && cmdwin_type != 0)
{
// Close the cmdline window.
@@ -794,7 +793,6 @@ edit(
nomove = TRUE;
goto doESCkey;
}
#endif
#ifdef FEAT_JOB_CHANNEL
if (c == Ctrl_C && bt_prompt(curbuf))
{
@@ -1205,14 +1203,12 @@ doESCkey:
break;
}
#endif
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
{
// Execute the command in the cmdline window.
cmdwin_result = CAR;
goto doESCkey;
}
#endif
#ifdef FEAT_JOB_CHANNEL
if (bt_prompt(curbuf))
{
@@ -1751,8 +1747,8 @@ edit_unputchar(void)
}
/*
* Called when p_dollar is set: display a '$' at the end of the changed text
* Only works when cursor is in the line that changes.
* Called when "$" is in 'cpoptions': display a '$' at the end of the changed
* text. Only works when cursor is in the line that changes.
*/
void
display_dollar(colnr_T col_arg)
+1 -7
View File
@@ -15,10 +15,8 @@ EXTERN char e_interrupted[]
EXTERN char e_backslash_should_be_followed_by[]
INIT(= N_("E10: \\ should be followed by /, ? or &"));
#ifdef FEAT_CMDWIN
EXTERN char e_invalid_in_cmdline_window[]
INIT(= N_("E11: Invalid in command-line window; :q<CR> closes the window"));
#endif
EXTERN char e_command_not_allowed_from_vimrc_in_current_dir_or_tag_search[]
INIT(= N_("E12: Command not allowed from exrc/vimrc in current dir or tag search"));
EXTERN char e_file_exists[]
@@ -461,10 +459,8 @@ EXTERN char e_no_digraphs_version[]
EXTERN char e_cannot_set_language_to_str[]
INIT(= N_("E197: Cannot set language to \"%s\""));
// E198 unused
#ifdef FEAT_CMDWIN
EXTERN char e_active_window_or_buffer_deleted[]
INIT(= N_("E199: Active window or buffer deleted"));
#endif
EXTERN char e_readpre_autocommands_made_file_unreadable[]
INIT(= N_("E200: *ReadPre autocommands made the file unreadable"));
EXTERN char e_readpre_autocommands_must_not_change_current_buffer[]
@@ -3017,7 +3013,7 @@ EXTERN char e_expression_does_not_result_in_value_str[]
#endif
EXTERN char e_failed_to_source_defaults[]
INIT(= N_("E1187: Failed to source defaults.vim"));
#if defined(FEAT_TERMINAL) && defined(FEAT_CMDWIN)
#if defined(FEAT_TERMINAL)
EXTERN char e_cannot_open_terminal_from_command_line_window[]
INIT(= N_("E1188: Cannot open a terminal from the command line window"));
#endif
@@ -3296,10 +3292,8 @@ EXTERN char e_substitute_nesting_too_deep[]
EXTERN char e_invalid_argument_nr[]
INIT(= N_("E1291: Invalid argument: %ld"));
#endif
#ifdef FEAT_CMDWIN
EXTERN char e_cmdline_window_already_open[]
INIT(= N_("E1292: Command-line window is already open"));
#endif
#ifdef FEAT_PROP_POPUP
EXTERN char e_cannot_use_negative_id_after_adding_textprop_with_text[]
INIT(= N_("E1293: Cannot use a negative id after adding a textprop with text"));
+1 -7
View File
@@ -5582,13 +5582,7 @@ f_has(typval_T *argvars, typval_T *rettv)
},
{"cmdline_compl", 1},
{"cmdline_hist", 1},
{"cmdwin",
#ifdef FEAT_CMDWIN
1
#else
0
#endif
},
{"cmdwin", 1},
{"comments", 1},
{"conceal",
#ifdef FEAT_CONCEAL
-6
View File
@@ -821,13 +821,11 @@ f_win_gotoid(typval_T *argvars, typval_T *rettv)
return;
id = tv_get_number(&argvars[0]);
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
{
emsg(_(e_invalid_in_cmdline_window));
return;
}
#endif
#if defined(FEAT_PROP_POPUP) && defined(FEAT_TERMINAL)
if (popup_is_popup(curwin) && curbuf->b_term != NULL)
{
@@ -1065,10 +1063,8 @@ f_win_gettype(typval_T *argvars, typval_T *rettv)
else if (WIN_IS_POPUP(wp))
rettv->vval.v_string = vim_strsave((char_u *)"popup");
#endif
#ifdef FEAT_CMDWIN
else if (wp == curwin && cmdwin_type != 0)
rettv->vval.v_string = vim_strsave((char_u *)"command");
#endif
#ifdef FEAT_QUICKFIX
else if (bt_quickfix(wp->w_buffer))
rettv->vval.v_string = vim_strsave((char_u *)
@@ -1085,14 +1081,12 @@ f_getcmdwintype(typval_T *argvars UNUSED, typval_T *rettv)
{
rettv->v_type = VAR_STRING;
rettv->vval.v_string = NULL;
#ifdef FEAT_CMDWIN
rettv->vval.v_string = alloc(2);
if (rettv->vval.v_string != NULL)
{
rettv->vval.v_string[0] = cmdwin_type;
rettv->vval.v_string[1] = NUL;
}
#endif
}
/*
+1 -4
View File
@@ -2739,12 +2739,11 @@ do_ecmd(
if (buf != curbuf)
{
bufref_T save_au_new_curbuf;
#ifdef FEAT_CMDWIN
int save_cmdwin_type = cmdwin_type;
// BufLeave applies to the old buffer.
cmdwin_type = 0;
#endif
/*
* Be careful: The autocommands may delete any buffer and change
* the current buffer.
@@ -2760,9 +2759,7 @@ do_ecmd(
save_au_new_curbuf = au_new_curbuf;
set_bufref(&au_new_curbuf, buf);
apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf);
#ifdef FEAT_CMDWIN
cmdwin_type = save_cmdwin_type;
#endif
if (!bufref_valid(&au_new_curbuf))
{
// new buffer has been deleted
+38 -54
View File
@@ -2089,14 +2089,12 @@ do_one_cmd(
if (!IS_USER_CMDIDX(ea.cmdidx))
{
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0 && !(ea.argt & EX_CMDWIN))
{
// Command not allowed in the command line window
errormsg = _(e_invalid_in_cmdline_window);
goto doend;
}
#endif
if (text_locked() && !(ea.argt & EX_LOCK_OK))
{
// Command not allowed when text is locked
@@ -5855,13 +5853,11 @@ ex_quit(exarg_T *eap)
{
win_T *wp;
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
{
cmdwin_result = Ctrl_C;
return;
}
#endif
// Don't quit while editing the command line.
if (text_locked())
{
@@ -5940,7 +5936,6 @@ ex_cquit(exarg_T *eap UNUSED)
static void
ex_quit_all(exarg_T *eap)
{
# ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
{
if (eap->forceit)
@@ -5949,7 +5944,6 @@ ex_quit_all(exarg_T *eap)
cmdwin_result = K_XF2;
return;
}
# endif
// Don't quit while editing the command line.
if (text_locked())
@@ -5975,11 +5969,9 @@ ex_close(exarg_T *eap)
{
win_T *win;
int winnr = 0;
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
cmdwin_result = Ctrl_C;
else
#endif
if (!text_locked() && !curbuf_locked())
{
if (eap->addr_count == 0)
@@ -6195,33 +6187,30 @@ ex_tabclose(exarg_T *eap)
tabpage_T *tp;
int tab_number;
# ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
cmdwin_result = K_IGNORE;
else if (first_tabpage->tp_next == NULL)
emsg(_(e_cannot_close_last_tab_page));
else
# endif
if (first_tabpage->tp_next == NULL)
emsg(_(e_cannot_close_last_tab_page));
else
{
tab_number = get_tabpage_arg(eap);
if (eap->errmsg == NULL)
{
tab_number = get_tabpage_arg(eap);
if (eap->errmsg == NULL)
tp = find_tabpage(tab_number);
if (tp == NULL)
{
tp = find_tabpage(tab_number);
if (tp == NULL)
{
beep_flush();
return;
}
if (tp != curtab)
{
tabpage_close_other(tp, eap->forceit);
return;
}
else if (!text_locked() && !curbuf_locked())
tabpage_close(eap->forceit);
beep_flush();
return;
}
if (tp != curtab)
{
tabpage_close_other(tp, eap->forceit);
return;
}
else if (!text_locked() && !curbuf_locked())
tabpage_close(eap->forceit);
}
}
}
/*
@@ -6234,38 +6223,35 @@ ex_tabonly(exarg_T *eap)
int done;
int tab_number;
# ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
cmdwin_result = K_IGNORE;
else if (first_tabpage->tp_next == NULL)
msg(_("Already only one tab page"));
else
# endif
if (first_tabpage->tp_next == NULL)
msg(_("Already only one tab page"));
else
{
tab_number = get_tabpage_arg(eap);
if (eap->errmsg == NULL)
{
tab_number = get_tabpage_arg(eap);
if (eap->errmsg == NULL)
goto_tabpage(tab_number);
// Repeat this up to a 1000 times, because autocommands may
// mess up the lists.
for (done = 0; done < 1000; ++done)
{
goto_tabpage(tab_number);
// Repeat this up to a 1000 times, because autocommands may
// mess up the lists.
for (done = 0; done < 1000; ++done)
{
FOR_ALL_TABPAGES(tp)
if (tp->tp_topframe != topframe)
{
tabpage_close_other(tp, eap->forceit);
// if we failed to close it quit
if (valid_tabpage(tp))
done = 1000;
// start over, "tp" is now invalid
break;
}
if (first_tabpage->tp_next == NULL)
FOR_ALL_TABPAGES(tp)
if (tp->tp_topframe != topframe)
{
tabpage_close_other(tp, eap->forceit);
// if we failed to close it quit
if (valid_tabpage(tp))
done = 1000;
// start over, "tp" is now invalid
break;
}
}
if (first_tabpage->tp_next == NULL)
break;
}
}
}
}
/*
@@ -6409,13 +6395,11 @@ ex_exit(exarg_T *eap)
if (not_in_vim9(eap) == FAIL)
return;
#endif
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
{
cmdwin_result = Ctrl_C;
return;
}
#endif
// Don't quit while editing the command line.
if (text_locked())
{
+2 -20
View File
@@ -52,16 +52,12 @@ static void restore_cmdline(cmdline_info_T *ccp);
static int cmdline_paste(int regname, int literally, int remcr);
static void redrawcmdprompt(void);
static int ccheck_abbr(int);
static int open_cmdwin(void);
#ifdef FEAT_SEARCH_EXTRA
static int empty_pattern_magic(char_u *pat, size_t len, magic_T magic_val);
#endif
#ifdef FEAT_CMDWIN
static int open_cmdwin(void);
static int cedit_key = -1; // key value of 'cedit' option
#endif
static void
trigger_cmd_autocmd(int typechar, int evt)
@@ -1922,7 +1918,6 @@ getcmdline_int(
// cmdline_handle_backslash_key()
}
#ifdef FEAT_CMDWIN
if (c == cedit_key || c == K_CMDWIN)
{
// TODO: why is ex_normal_busy checked here?
@@ -1935,11 +1930,8 @@ getcmdline_int(
some_key_typed = TRUE;
}
}
# ifdef FEAT_DIGRAPHS
else
# endif
#endif
#ifdef FEAT_DIGRAPHS
else
c = do_digraph(c);
#endif
@@ -2696,10 +2688,8 @@ check_opt_wim(void)
int
text_locked(void)
{
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
return TRUE;
#endif
return textlock != 0;
}
@@ -2716,10 +2706,8 @@ text_locked_msg(void)
char *
get_text_locked_msg(void)
{
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
return e_invalid_in_cmdline_window;
#endif
return e_not_allowed_to_change_text_or_change_window;
}
@@ -4092,7 +4080,6 @@ get_cmdline_info(void)
return &ccline;
}
#if defined(FEAT_EVAL) || defined(FEAT_CMDWIN) || defined(PROTO)
/*
* Get pointer to the command line info to use. save_cmdline() may clear
* ccline and put the previous value in prev_ccline.
@@ -4108,9 +4095,7 @@ get_ccline_ptr(void)
return &prev_ccline;
return NULL;
}
#endif
#if defined(FEAT_EVAL) || defined(FEAT_CMDWIN)
/*
* Get the current command-line type.
* Returns ':' or '/' or '?' or '@' or '>' or '-'
@@ -4132,7 +4117,6 @@ get_cmdline_type(void)
'-';
return p->cmdfirstc;
}
#endif
#if defined(FEAT_EVAL) || defined(PROTO)
/*
@@ -4377,7 +4361,6 @@ get_list_range(char_u **str, int *num1, int *num2)
return OK;
}
#if defined(FEAT_CMDWIN) || defined(PROTO)
/*
* Check value of 'cedit' and set cedit_key.
* Returns NULL if value is OK, error message otherwise.
@@ -4706,7 +4689,6 @@ is_in_cmdwin(void)
{
return cmdwin_type != 0 && get_cmdline_type() == NUL;
}
#endif // FEAT_CMDWIN
/*
* Used for commands that either take a simple command string argument, or:
+18 -16
View File
@@ -31,23 +31,31 @@
* Basic choices:
* ==============
*
* +tiny almost no features enabled, not even multiple windows
* +small as tiny plus cmdline window
* +normal A default selection of features enabled
* +big many features enabled, as rich as possible.
* +tiny no optional features enabled, not even +eval
* +normal a default selection of features enabled
* +big many features enabled, except "expensive" ones
* +huge all possible features enabled.
*
* When +small is used, +tiny is also included. +normal implies +small, etc.
* When +normal is used, +tiny is also included. +big implies +normal, etc.
*/
/*
* +small is now an alias for +tiny
*/
#if defined(FEAT_SMALL)
# undef FEAT_SMALL
# if !defined(FEAT_TINY)
# define FEAT_TINY
# endif
#endif
/*
* Uncomment one of these to override the default. For unix use a configure
* argument, see Makefile.
*/
#if !defined(FEAT_TINY) && !defined(FEAT_SMALL) && !defined(FEAT_NORMAL) \
#if !defined(FEAT_TINY) && !defined(FEAT_NORMAL) \
&& !defined(FEAT_BIG) && !defined(FEAT_HUGE)
// #define FEAT_TINY
// #define FEAT_SMALL
// #define FEAT_NORMAL
// #define FEAT_BIG
// #define FEAT_HUGE
@@ -59,7 +67,7 @@
* Use +big for older systems: VMS and Amiga.
* Otherwise use +normal
*/
#if !defined(FEAT_TINY) && !defined(FEAT_SMALL) && !defined(FEAT_NORMAL) \
#if !defined(FEAT_TINY) && !defined(FEAT_NORMAL) \
&& !defined(FEAT_BIG) && !defined(FEAT_HUGE)
# if defined(UNIX) || defined(MSWIN) || defined(MACOS_X)
# define FEAT_HUGE
@@ -82,9 +90,6 @@
# define FEAT_NORMAL
#endif
#ifdef FEAT_NORMAL
# define FEAT_SMALL
#endif
#ifdef FEAT_SMALL
# define FEAT_TINY
#endif
@@ -122,6 +127,7 @@
* +wildmenu 'wildmenu' option
* +builtin_terms all builtin termcap entries included
* +float Floating point variables.
* +cmdwin Command line window.
*
* Obsolete:
* +tag_old_static Old style static tags: "file:tag file ..".
@@ -137,10 +143,6 @@
*/
#define MAX_MSG_HIST_LEN 200
#if defined(FEAT_SMALL)
# define FEAT_CMDWIN
#endif
/*
* +folding Fold lines.
*/
@@ -928,7 +930,7 @@
# define FEAT_DND
#endif
#if defined(FEAT_GUI_MSWIN) && defined(FEAT_SMALL)
#if defined(FEAT_GUI_MSWIN)
# define MSWIN_FIND_REPLACE // include code for find/replace dialog
# define MSWIN_FR_BUFSIZE 256
#endif
+1 -8
View File
@@ -3385,9 +3385,7 @@ vgetorpeek(int advance)
if (ex_normal_busy > 0)
{
#ifdef FEAT_CMDWIN
static int tc = 0;
#endif
// No typeahead left and inside ":normal". Must return
// something to avoid getting stuck. When an incomplete
@@ -3411,16 +3409,11 @@ vgetorpeek(int advance)
c = K_CANCEL;
#endif
else if ((State & MODE_CMDLINE)
#ifdef FEAT_CMDWIN
|| (cmdwin_type > 0 && tc == ESC)
#endif
)
|| (cmdwin_type > 0 && tc == ESC))
c = Ctrl_C;
else
c = ESC;
#ifdef FEAT_CMDWIN
tc = c;
#endif
// set a flag to indicate this wasn't a normal char
if (advance)
typebuf_was_empty = TRUE;
-4
View File
@@ -1639,10 +1639,8 @@ EXTERN int disable_fold_update INIT(= 0);
EXTERN int km_stopsel INIT(= FALSE);
EXTERN int km_startsel INIT(= FALSE);
#ifdef FEAT_CMDWIN
EXTERN int cmdwin_type INIT(= 0); // type of cmdline window or 0
EXTERN int cmdwin_result INIT(= 0); // result of cmdline window or 0
#endif
EXTERN char_u no_lines_msg[] INIT(= N_("--No lines in buffer--"));
@@ -1978,10 +1976,8 @@ EXTERN int channel_need_redraw INIT(= FALSE);
// overrules p_magic. Otherwise set to OPTION_MAGIC_NOT_SET.
EXTERN optmagic_T magic_overruled INIT(= OPTION_MAGIC_NOT_SET);
#ifdef FEAT_CMDWIN
// Skip win_fix_cursor() call for 'splitkeep' when cmdwin is closed.
EXTERN int skip_win_fix_cursor INIT(= FALSE);
#endif
// Skip win_fix_scroll() call for 'splitkeep' when closing tab page.
EXTERN int skip_win_fix_scroll INIT(= FALSE);
// Skip update_topline() call while executing win_fix_scroll().
+1 -7
View File
@@ -3889,11 +3889,7 @@ send_tabline_event(int nr)
return FALSE;
// Don't put events in the input queue now.
if (hold_gui_events
# ifdef FEAT_CMDWIN
|| cmdwin_type != 0
# endif
)
if (hold_gui_events || cmdwin_type != 0)
{
// Set it back to the current tab page.
gui_mch_set_curtab(tabpage_index(curtab));
@@ -4043,10 +4039,8 @@ gui_drag_scrollbar(scrollbar_T *sb, long value, int still_dragging)
if (hold_gui_events)
return;
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0 && sb->wp != curwin)
return;
#endif
if (still_dragging)
{
+1 -5
View File
@@ -3311,11 +3311,7 @@ on_tabline_menu(GtkWidget *widget, GdkEvent *event)
// When ignoring events return TRUE so that the selected page doesn't
// change.
if (hold_gui_events
# ifdef FEAT_CMDWIN
|| cmdwin_type != 0
# endif
)
if (hold_gui_events || cmdwin_type != 0)
return TRUE;
tabwin = gui_gtk_window_at_position(gui.mainwin, &x, &y);
+9 -5
View File
@@ -228,15 +228,19 @@ tabline_menu_cb(
return;
}
if (event->button == Button2)
{
// Middle mouse click on tabpage label closes that tab.
XtVaGetValues(tabLine_menu, XmNuserData, &tab_idx, NULL);
send_tabline_menu_event(tab_idx, (int)TABLINE_MENU_CLOSE);
return;
}
if (event->button != Button3)
return;
// When ignoring events don't show the menu.
if (hold_gui_events
# ifdef FEAT_CMDWIN
|| cmdwin_type != 0
# endif
)
if (hold_gui_events || cmdwin_type != 0)
return;
if (event->subwindow != None)
+1 -5
View File
@@ -2609,11 +2609,7 @@ show_tabline_popup_menu(void)
POINT pt;
// When ignoring events don't show the menu.
if (hold_gui_events
# ifdef FEAT_CMDWIN
|| cmdwin_type != 0
# endif
)
if (hold_gui_events || cmdwin_type != 0)
return;
tab_pmenu = CreatePopupMenu();
+1 -1
View File
@@ -17,7 +17,7 @@
* 1. Memory, allocated with scheme_malloc*, need not to be freed explicitly,
* garbage collector will do it self
* 2. Requires at least NORMAL features. I can't imagine why one may want
* to build with SMALL or TINY features but with MzScheme interface.
* to build with TINY features but with MzScheme interface.
* 3. I don't use K&R-style functions. Anyways, MzScheme headers are ANSI.
*/
-2
View File
@@ -2293,12 +2293,10 @@ ins_compl_stop(int c, int prev_mode, int retval)
showmode();
}
#ifdef FEAT_CMDWIN
if (c == Ctrl_C && cmdwin_type != 0)
// Avoid the popup menu remains displayed when leaving the
// command line window.
update_screen(0);
#endif
// Indent now if a key was typed that is in 'cinkeys'.
if (want_cindent && in_cinkeys(KEY_COMPLETE, ' ', inindent(0)))
do_c_expr_indent();
+1 -5
View File
@@ -1280,11 +1280,7 @@ main_loop(
#endif
clear_oparg(&oa);
while (!cmdwin
#ifdef FEAT_CMDWIN
|| cmdwin_result == 0
#endif
)
while (!cmdwin || cmdwin_result == 0)
{
#ifdef FEAT_GUI_MACVIM
// Cocoa needs an NSAutoreleasePool in place or it will leak memory.
+5 -4
View File
@@ -1753,7 +1753,11 @@ vim_strsave_escape_csi(char_u *p)
d = res;
for (s = p; *s != NUL; )
{
if (s[0] == K_SPECIAL && s[1] != NUL && s[2] != NUL)
if ((s[0] == K_SPECIAL
#ifdef FEAT_GUI
|| (gui.in_use && s[0] == CSI)
#endif
) && s[1] != NUL && s[2] != NUL)
{
// Copy special key unmodified.
*d++ = *s++;
@@ -2814,8 +2818,6 @@ init_mappings(void)
#endif
}
#if defined(MSWIN) || defined(FEAT_CMDWIN) || defined(MACOS_X) \
|| defined(PROTO)
/*
* Add a mapping "map" for mode "mode".
* When "nore" is TRUE use MAPTYPE_NOREMAP.
@@ -2836,7 +2838,6 @@ add_map(char_u *map, int mode, int nore)
}
p_cpo = cpo_save;
}
#endif
#if defined(FEAT_LANGMAP) || defined(PROTO)
/*
+160 -127
View File
@@ -2338,74 +2338,67 @@ utf_iscomposing(int c)
{0x0859, 0x085b},
{0x0898, 0x089f},
{0x08ca, 0x08e1},
{0x08e3, 0x0903},
{0x093a, 0x093c},
{0x093e, 0x094f},
{0x08e3, 0x0902},
{0x093a, 0x093a},
{0x093c, 0x093c},
{0x0941, 0x0948},
{0x094d, 0x094d},
{0x0951, 0x0957},
{0x0962, 0x0963},
{0x0981, 0x0983},
{0x0981, 0x0981},
{0x09bc, 0x09bc},
{0x09be, 0x09c4},
{0x09c7, 0x09c8},
{0x09cb, 0x09cd},
{0x09d7, 0x09d7},
{0x09c1, 0x09c4},
{0x09cd, 0x09cd},
{0x09e2, 0x09e3},
{0x09fe, 0x09fe},
{0x0a01, 0x0a03},
{0x0a01, 0x0a02},
{0x0a3c, 0x0a3c},
{0x0a3e, 0x0a42},
{0x0a41, 0x0a42},
{0x0a47, 0x0a48},
{0x0a4b, 0x0a4d},
{0x0a51, 0x0a51},
{0x0a70, 0x0a71},
{0x0a75, 0x0a75},
{0x0a81, 0x0a83},
{0x0a81, 0x0a82},
{0x0abc, 0x0abc},
{0x0abe, 0x0ac5},
{0x0ac7, 0x0ac9},
{0x0acb, 0x0acd},
{0x0ac1, 0x0ac5},
{0x0ac7, 0x0ac8},
{0x0acd, 0x0acd},
{0x0ae2, 0x0ae3},
{0x0afa, 0x0aff},
{0x0b01, 0x0b03},
{0x0b01, 0x0b01},
{0x0b3c, 0x0b3c},
{0x0b3e, 0x0b44},
{0x0b47, 0x0b48},
{0x0b4b, 0x0b4d},
{0x0b55, 0x0b57},
{0x0b3f, 0x0b3f},
{0x0b41, 0x0b44},
{0x0b4d, 0x0b4d},
{0x0b55, 0x0b56},
{0x0b62, 0x0b63},
{0x0b82, 0x0b82},
{0x0bbe, 0x0bc2},
{0x0bc6, 0x0bc8},
{0x0bca, 0x0bcd},
{0x0bd7, 0x0bd7},
{0x0c00, 0x0c04},
{0x0bc0, 0x0bc0},
{0x0bcd, 0x0bcd},
{0x0c00, 0x0c00},
{0x0c04, 0x0c04},
{0x0c3c, 0x0c3c},
{0x0c3e, 0x0c44},
{0x0c3e, 0x0c40},
{0x0c46, 0x0c48},
{0x0c4a, 0x0c4d},
{0x0c55, 0x0c56},
{0x0c62, 0x0c63},
{0x0c81, 0x0c83},
{0x0c81, 0x0c81},
{0x0cbc, 0x0cbc},
{0x0cbe, 0x0cc4},
{0x0cc6, 0x0cc8},
{0x0cca, 0x0ccd},
{0x0cd5, 0x0cd6},
{0x0cbf, 0x0cbf},
{0x0cc6, 0x0cc6},
{0x0ccc, 0x0ccd},
{0x0ce2, 0x0ce3},
{0x0cf3, 0x0cf3},
{0x0d00, 0x0d03},
{0x0d00, 0x0d01},
{0x0d3b, 0x0d3c},
{0x0d3e, 0x0d44},
{0x0d46, 0x0d48},
{0x0d4a, 0x0d4d},
{0x0d57, 0x0d57},
{0x0d41, 0x0d44},
{0x0d4d, 0x0d4d},
{0x0d62, 0x0d63},
{0x0d81, 0x0d83},
{0x0d81, 0x0d81},
{0x0dca, 0x0dca},
{0x0dcf, 0x0dd4},
{0x0dd2, 0x0dd4},
{0x0dd6, 0x0dd6},
{0x0dd8, 0x0ddf},
{0x0df2, 0x0df3},
{0x0e31, 0x0e31},
{0x0e34, 0x0e3a},
{0x0e47, 0x0e4e},
@@ -2416,57 +2409,79 @@ utf_iscomposing(int c)
{0x0f35, 0x0f35},
{0x0f37, 0x0f37},
{0x0f39, 0x0f39},
{0x0f3e, 0x0f3f},
{0x0f71, 0x0f84},
{0x0f71, 0x0f7e},
{0x0f80, 0x0f84},
{0x0f86, 0x0f87},
{0x0f8d, 0x0f97},
{0x0f99, 0x0fbc},
{0x0fc6, 0x0fc6},
{0x102b, 0x103e},
{0x1056, 0x1059},
{0x102d, 0x1030},
{0x1032, 0x1037},
{0x1039, 0x103a},
{0x103d, 0x103e},
{0x1058, 0x1059},
{0x105e, 0x1060},
{0x1062, 0x1064},
{0x1067, 0x106d},
{0x1071, 0x1074},
{0x1082, 0x108d},
{0x108f, 0x108f},
{0x109a, 0x109d},
{0x1082, 0x1082},
{0x1085, 0x1086},
{0x108d, 0x108d},
{0x109d, 0x109d},
{0x135d, 0x135f},
{0x1712, 0x1715},
{0x1732, 0x1734},
{0x1712, 0x1714},
{0x1732, 0x1733},
{0x1752, 0x1753},
{0x1772, 0x1773},
{0x17b4, 0x17d3},
{0x17b4, 0x17b5},
{0x17b7, 0x17bd},
{0x17c6, 0x17c6},
{0x17c9, 0x17d3},
{0x17dd, 0x17dd},
{0x180b, 0x180d},
{0x180f, 0x180f},
{0x1885, 0x1886},
{0x18a9, 0x18a9},
{0x1920, 0x192b},
{0x1930, 0x193b},
{0x1a17, 0x1a1b},
{0x1a55, 0x1a5e},
{0x1a60, 0x1a7c},
{0x1920, 0x1922},
{0x1927, 0x1928},
{0x1932, 0x1932},
{0x1939, 0x193b},
{0x1a17, 0x1a18},
{0x1a1b, 0x1a1b},
{0x1a56, 0x1a56},
{0x1a58, 0x1a5e},
{0x1a60, 0x1a60},
{0x1a62, 0x1a62},
{0x1a65, 0x1a6c},
{0x1a73, 0x1a7c},
{0x1a7f, 0x1a7f},
{0x1ab0, 0x1ace},
{0x1b00, 0x1b04},
{0x1b34, 0x1b44},
{0x1b00, 0x1b03},
{0x1b34, 0x1b34},
{0x1b36, 0x1b3a},
{0x1b3c, 0x1b3c},
{0x1b42, 0x1b42},
{0x1b6b, 0x1b73},
{0x1b80, 0x1b82},
{0x1ba1, 0x1bad},
{0x1be6, 0x1bf3},
{0x1c24, 0x1c37},
{0x1b80, 0x1b81},
{0x1ba2, 0x1ba5},
{0x1ba8, 0x1ba9},
{0x1bab, 0x1bad},
{0x1be6, 0x1be6},
{0x1be8, 0x1be9},
{0x1bed, 0x1bed},
{0x1bef, 0x1bf1},
{0x1c2c, 0x1c33},
{0x1c36, 0x1c37},
{0x1cd0, 0x1cd2},
{0x1cd4, 0x1ce8},
{0x1cd4, 0x1ce0},
{0x1ce2, 0x1ce8},
{0x1ced, 0x1ced},
{0x1cf4, 0x1cf4},
{0x1cf7, 0x1cf9},
{0x1cf8, 0x1cf9},
{0x1dc0, 0x1dff},
{0x20d0, 0x20f0},
{0x2cef, 0x2cf1},
{0x2d7f, 0x2d7f},
{0x2de0, 0x2dff},
{0x302a, 0x302f},
{0x302a, 0x302d},
{0x3099, 0x309a},
{0xa66f, 0xa672},
{0xa674, 0xa67d},
@@ -2475,30 +2490,34 @@ utf_iscomposing(int c)
{0xa802, 0xa802},
{0xa806, 0xa806},
{0xa80b, 0xa80b},
{0xa823, 0xa827},
{0xa825, 0xa826},
{0xa82c, 0xa82c},
{0xa880, 0xa881},
{0xa8b4, 0xa8c5},
{0xa8c4, 0xa8c5},
{0xa8e0, 0xa8f1},
{0xa8ff, 0xa8ff},
{0xa926, 0xa92d},
{0xa947, 0xa953},
{0xa980, 0xa983},
{0xa9b3, 0xa9c0},
{0xa947, 0xa951},
{0xa980, 0xa982},
{0xa9b3, 0xa9b3},
{0xa9b6, 0xa9b9},
{0xa9bc, 0xa9bd},
{0xa9e5, 0xa9e5},
{0xaa29, 0xaa36},
{0xaa29, 0xaa2e},
{0xaa31, 0xaa32},
{0xaa35, 0xaa36},
{0xaa43, 0xaa43},
{0xaa4c, 0xaa4d},
{0xaa7b, 0xaa7d},
{0xaa4c, 0xaa4c},
{0xaa7c, 0xaa7c},
{0xaab0, 0xaab0},
{0xaab2, 0xaab4},
{0xaab7, 0xaab8},
{0xaabe, 0xaabf},
{0xaac1, 0xaac1},
{0xaaeb, 0xaaef},
{0xaaf5, 0xaaf6},
{0xabe3, 0xabea},
{0xabec, 0xabed},
{0xaaec, 0xaaed},
{0xaaf6, 0xaaf6},
{0xabe5, 0xabe5},
{0xabe8, 0xabe8},
{0xabed, 0xabed},
{0xfb1e, 0xfb1e},
{0xfe00, 0xfe0f},
{0xfe20, 0xfe2f},
@@ -2516,89 +2535,103 @@ utf_iscomposing(int c)
{0x10efd, 0x10eff},
{0x10f46, 0x10f50},
{0x10f82, 0x10f85},
{0x11000, 0x11002},
{0x11001, 0x11001},
{0x11038, 0x11046},
{0x11070, 0x11070},
{0x11073, 0x11074},
{0x1107f, 0x11082},
{0x110b0, 0x110ba},
{0x1107f, 0x11081},
{0x110b3, 0x110b6},
{0x110b9, 0x110ba},
{0x110c2, 0x110c2},
{0x11100, 0x11102},
{0x11127, 0x11134},
{0x11145, 0x11146},
{0x11127, 0x1112b},
{0x1112d, 0x11134},
{0x11173, 0x11173},
{0x11180, 0x11182},
{0x111b3, 0x111c0},
{0x11180, 0x11181},
{0x111b6, 0x111be},
{0x111c9, 0x111cc},
{0x111ce, 0x111cf},
{0x1122c, 0x11237},
{0x111cf, 0x111cf},
{0x1122f, 0x11231},
{0x11234, 0x11234},
{0x11236, 0x11237},
{0x1123e, 0x1123e},
{0x11241, 0x11241},
{0x112df, 0x112ea},
{0x11300, 0x11303},
{0x112df, 0x112df},
{0x112e3, 0x112ea},
{0x11300, 0x11301},
{0x1133b, 0x1133c},
{0x1133e, 0x11344},
{0x11347, 0x11348},
{0x1134b, 0x1134d},
{0x11357, 0x11357},
{0x11362, 0x11363},
{0x11340, 0x11340},
{0x11366, 0x1136c},
{0x11370, 0x11374},
{0x11435, 0x11446},
{0x11438, 0x1143f},
{0x11442, 0x11444},
{0x11446, 0x11446},
{0x1145e, 0x1145e},
{0x114b0, 0x114c3},
{0x115af, 0x115b5},
{0x115b8, 0x115c0},
{0x114b3, 0x114b8},
{0x114ba, 0x114ba},
{0x114bf, 0x114c0},
{0x114c2, 0x114c3},
{0x115b2, 0x115b5},
{0x115bc, 0x115bd},
{0x115bf, 0x115c0},
{0x115dc, 0x115dd},
{0x11630, 0x11640},
{0x116ab, 0x116b7},
{0x1171d, 0x1172b},
{0x1182c, 0x1183a},
{0x11930, 0x11935},
{0x11937, 0x11938},
{0x1193b, 0x1193e},
{0x11940, 0x11940},
{0x11942, 0x11943},
{0x119d1, 0x119d7},
{0x119da, 0x119e0},
{0x119e4, 0x119e4},
{0x11633, 0x1163a},
{0x1163d, 0x1163d},
{0x1163f, 0x11640},
{0x116ab, 0x116ab},
{0x116ad, 0x116ad},
{0x116b0, 0x116b5},
{0x116b7, 0x116b7},
{0x1171d, 0x1171f},
{0x11722, 0x11725},
{0x11727, 0x1172b},
{0x1182f, 0x11837},
{0x11839, 0x1183a},
{0x1193b, 0x1193c},
{0x1193e, 0x1193e},
{0x11943, 0x11943},
{0x119d4, 0x119d7},
{0x119da, 0x119db},
{0x119e0, 0x119e0},
{0x11a01, 0x11a0a},
{0x11a33, 0x11a39},
{0x11a33, 0x11a38},
{0x11a3b, 0x11a3e},
{0x11a47, 0x11a47},
{0x11a51, 0x11a5b},
{0x11a8a, 0x11a99},
{0x11c2f, 0x11c36},
{0x11c38, 0x11c3f},
{0x11a51, 0x11a56},
{0x11a59, 0x11a5b},
{0x11a8a, 0x11a96},
{0x11a98, 0x11a99},
{0x11c30, 0x11c36},
{0x11c38, 0x11c3d},
{0x11c3f, 0x11c3f},
{0x11c92, 0x11ca7},
{0x11ca9, 0x11cb6},
{0x11caa, 0x11cb0},
{0x11cb2, 0x11cb3},
{0x11cb5, 0x11cb6},
{0x11d31, 0x11d36},
{0x11d3a, 0x11d3a},
{0x11d3c, 0x11d3d},
{0x11d3f, 0x11d45},
{0x11d47, 0x11d47},
{0x11d8a, 0x11d8e},
{0x11d90, 0x11d91},
{0x11d93, 0x11d97},
{0x11ef3, 0x11ef6},
{0x11d95, 0x11d95},
{0x11d97, 0x11d97},
{0x11ef3, 0x11ef4},
{0x11f00, 0x11f01},
{0x11f03, 0x11f03},
{0x11f34, 0x11f3a},
{0x11f3e, 0x11f42},
{0x11f36, 0x11f3a},
{0x11f40, 0x11f40},
{0x11f42, 0x11f42},
{0x13440, 0x13440},
{0x13447, 0x13455},
{0x16af0, 0x16af4},
{0x16b30, 0x16b36},
{0x16f4f, 0x16f4f},
{0x16f51, 0x16f87},
{0x16f8f, 0x16f92},
{0x16fe4, 0x16fe4},
{0x16ff0, 0x16ff1},
{0x1bc9d, 0x1bc9e},
{0x1cf00, 0x1cf2d},
{0x1cf30, 0x1cf46},
{0x1d165, 0x1d169},
{0x1d16d, 0x1d172},
{0x1d167, 0x1d169},
{0x1d17b, 0x1d182},
{0x1d185, 0x1d18b},
{0x1d1aa, 0x1d1ad},
+7 -19
View File
@@ -483,17 +483,13 @@ do_mouse(
{
c1 = TabPageIdxs[mouse_col];
tabpage_move(c1 <= 0 ? 9999 : c1 < tabpage_index(curtab)
? c1 - 1 : c1);
? c1 - 1 : c1);
}
return FALSE;
}
// click in a tab selects that tab page
if (is_click
# ifdef FEAT_CMDWIN
&& cmdwin_type == 0
# endif
&& mouse_col < Columns)
if (is_click && cmdwin_type == 0 && mouse_col < Columns)
{
in_tab_line = TRUE;
c1 = TabPageIdxs[mouse_col];
@@ -746,7 +742,7 @@ do_mouse(
}
#endif
#if defined(FEAT_CLIPBOARD) && defined(FEAT_CMDWIN)
#if defined(FEAT_CLIPBOARD)
if ((jump_flags & IN_OTHER_WIN) && !VIsual_active && clip_star.available)
{
clip_modeless(which_button, is_click, is_drag);
@@ -1620,7 +1616,7 @@ retnomove:
end_visual_mode_keep_button();
redraw_curbuf_later(UPD_INVERTED); // delete the inversion
}
#if defined(FEAT_CMDWIN) && defined(FEAT_CLIPBOARD)
#if defined(FEAT_CLIPBOARD)
// Continue a modeless selection in another window.
if (cmdwin_type != 0 && row < curwin->w_winrow)
return IN_OTHER_WIN;
@@ -1750,10 +1746,7 @@ retnomove:
# ifdef FEAT_RIGHTLEFT
wp->w_p_rl ? col < wp->w_width - wp->w_p_fdc :
# endif
col >= wp->w_p_fdc
# ifdef FEAT_CMDWIN
+ (cmdwin_type == 0 && wp == curwin ? 0 : 1)
# endif
col >= wp->w_p_fdc + (cmdwin_type == 0 && wp == curwin ? 0 : 1)
)
#endif
&& (flags & MOUSE_MAY_STOP_VIS))))
@@ -1761,7 +1754,6 @@ retnomove:
end_visual_mode_keep_button();
redraw_curbuf_later(UPD_INVERTED); // delete the inversion
}
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0 && wp != curwin)
{
// A click outside the command-line window: Use modeless
@@ -1777,7 +1769,6 @@ retnomove:
wp = curwin;
# endif
}
#endif
#if defined(FEAT_PROP_POPUP) && defined(FEAT_TERMINAL)
if (popup_is_popup(curwin) && curbuf->b_term != NULL)
// terminal in popup window: don't jump to another window
@@ -1866,7 +1857,7 @@ retnomove:
redraw_curbuf_later(UPD_INVERTED); // delete the inversion
}
#if defined(FEAT_CMDWIN) && defined(FEAT_CLIPBOARD)
#if defined(FEAT_CLIPBOARD)
// Continue a modeless selection in another window.
if (cmdwin_type != 0 && row < curwin->w_winrow)
return IN_OTHER_WIN;
@@ -2004,10 +1995,7 @@ retnomove:
# ifdef FEAT_RIGHTLEFT
curwin->w_p_rl ? col < curwin->w_width - curwin->w_p_fdc :
# endif
col >= curwin->w_p_fdc
# ifdef FEAT_CMDWIN
+ (cmdwin_type == 0 ? 0 : 1)
# endif
col >= curwin->w_p_fdc + (cmdwin_type == 0 ? 0 : 1)
)
mouse_char = ' ';
#endif
+40 -14
View File
@@ -266,7 +266,7 @@ update_topline(void)
*/
else
{
if (curwin->w_topline > 1)
if (curwin->w_topline > 1 || curwin->w_skipcol > 0)
{
// If the cursor is above topline, scrolling is always needed.
// If the cursor is far below topline and there is no folding,
@@ -275,6 +275,16 @@ update_topline(void)
check_topline = TRUE;
else if (check_top_offset())
check_topline = TRUE;
else if (curwin->w_cursor.lnum == curwin->w_topline)
{
colnr_T vcol;
// check the cursor position is visible. Add 3 for the ">>>"
// displayed in the top-left.
getvvcol(curwin, &curwin->w_cursor, &vcol, NULL, NULL);
if (curwin->w_skipcol + 3 >= vcol)
check_topline = TRUE;
}
}
#ifdef FEAT_DIFF
// Check if there are more filler lines than allowed.
@@ -968,9 +978,7 @@ validate_cursor_col(void)
win_col_off(win_T *wp)
{
return (((wp->w_p_nu || wp->w_p_rnu) ? number_width(wp) + 1 : 0)
#ifdef FEAT_CMDWIN
+ (cmdwin_type == 0 || wp != curwin ? 0 : 1)
#endif
#ifdef FEAT_FOLDING
+ wp->w_p_fdc
#endif
@@ -1460,10 +1468,11 @@ scrolldown(
long done = 0; // total # of physical lines done
int wrow;
int moved = FALSE;
int do_sms = curwin->w_p_wrap && curwin->w_p_sms;
int width1 = 0;
int width2 = 0;
if (curwin->w_p_wrap && curwin->w_p_sms)
if (do_sms)
{
width1 = curwin->w_width - curwin_col_off();
width2 = width1 + curwin_col_off2();
@@ -1476,7 +1485,7 @@ scrolldown(
(void)hasFolding(curwin->w_topline, &curwin->w_topline, NULL);
#endif
validate_cursor(); // w_wrow needs to be valid
while (line_count-- > 0)
for (int todo = line_count; todo > 0; --todo)
{
#ifdef FEAT_DIFF
if (curwin->w_topfill < diff_check(curwin, curwin->w_topline)
@@ -1490,10 +1499,9 @@ scrolldown(
{
// break when at the very top
if (curwin->w_topline == 1
&& (!curwin->w_p_sms || curwin->w_skipcol < width1))
&& (!do_sms || curwin->w_skipcol < width1))
break;
if (curwin->w_p_wrap && curwin->w_p_sms
&& curwin->w_skipcol >= width1)
if (do_sms && curwin->w_skipcol >= width1)
{
// scroll a screen line down
if (curwin->w_skipcol >= width1 + width2)
@@ -1517,13 +1525,13 @@ scrolldown(
{
++done;
if (!byfold)
line_count -= curwin->w_topline - first - 1;
todo -= curwin->w_topline - first - 1;
curwin->w_botline -= curwin->w_topline - first;
curwin->w_topline = first;
}
else
#endif
if (curwin->w_p_wrap && curwin->w_p_sms)
if (do_sms)
{
int size = win_linetabsize(curwin, curwin->w_topline,
ml_get(curwin->w_topline), (colnr_T)MAXCOL);
@@ -1604,9 +1612,9 @@ scrollup(
long line_count,
int byfold UNUSED) // TRUE: count a closed fold as one line
{
int do_smoothscroll = curwin->w_p_wrap && curwin->w_p_sms;
int do_sms = curwin->w_p_wrap && curwin->w_p_sms;
if (do_smoothscroll
if (do_sms
# ifdef FEAT_FOLDING
|| (byfold && hasAnyFolding(curwin))
# endif
@@ -1620,7 +1628,7 @@ scrollup(
int size = 0;
linenr_T prev_topline = curwin->w_topline;
if (do_smoothscroll)
if (do_sms)
size = win_linetabsize(curwin, curwin->w_topline,
ml_get(curwin->w_topline), (colnr_T)MAXCOL);
@@ -1677,7 +1685,7 @@ scrollup(
curwin->w_topfill = diff_check_fill(curwin, lnum);
# endif
curwin->w_skipcol = 0;
if (todo > 1 && do_smoothscroll)
if (todo > 1 && do_sms)
size = win_linetabsize(curwin, curwin->w_topline,
ml_get(curwin->w_topline), (colnr_T)MAXCOL);
}
@@ -2009,6 +2017,7 @@ scroll_cursor_top(int min_scroll, int always)
linenr_T top; // just above displayed lines
linenr_T bot; // just below displayed lines
linenr_T old_topline = curwin->w_topline;
int old_skipcol = curwin->w_skipcol;
#ifdef FEAT_DIFF
linenr_T old_topfill = curwin->w_topfill;
#endif
@@ -2120,7 +2129,14 @@ scroll_cursor_top(int min_scroll, int always)
}
check_topfill(curwin, FALSE);
#endif
// TODO: if the line doesn't fit may optimize w_skipcol
if (curwin->w_topline == curwin->w_cursor.lnum)
{
curwin->w_skipcol = 0;
redraw_later(UPD_NOT_VALID);
}
if (curwin->w_topline != old_topline
|| curwin->w_skipcol != old_skipcol
#ifdef FEAT_DIFF
|| curwin->w_topfill != old_topfill
#endif
@@ -2173,6 +2189,7 @@ scroll_cursor_bot(int min_scroll, int set_topbot)
{
int used;
int scrolled = 0;
int min_scrolled = 1;
int extra = 0;
int i;
linenr_T line_count;
@@ -2238,6 +2255,10 @@ scroll_cursor_bot(int min_scroll, int set_topbot)
scrolled = used;
if (cln == curwin->w_botline)
scrolled -= curwin->w_empty_rows;
min_scrolled = scrolled;
if (cln > curwin->w_botline && curwin->w_p_sms && curwin->w_p_wrap)
for (linenr_T lnum = curwin->w_botline + 1; lnum <= cln; ++lnum)
min_scrolled += PLINES_NOFILL(lnum);
}
/*
@@ -2363,7 +2384,12 @@ scroll_cursor_bot(int min_scroll, int set_topbot)
if (line_count >= curwin->w_height && line_count > min_scroll)
scroll_cursor_halfway(FALSE);
else
{
// With 'smoothscroll' scroll at least the height of the cursor line.
if (curwin->w_p_wrap && curwin->w_p_sms && line_count < min_scrolled)
line_count = min_scrolled;
scrollup(line_count, TRUE);
}
/*
* If topline didn't change we need to restore w_botline and w_empty_rows
+2 -16
View File
@@ -4040,12 +4040,10 @@ nv_down(cmdarg_T *cap)
#endif
else
{
#ifdef FEAT_CMDWIN
// In the cmdline window a <CR> executes the command.
if (cmdwin_type != 0 && cap->cmdchar == CAR)
cmdwin_result = CAR;
else
#endif
#ifdef FEAT_JOB_CHANNEL
// In a prompt buffer a <CR> in the last line invokes the callback.
if (bt_prompt(curbuf) && cap->cmdchar == CAR
@@ -6766,10 +6764,8 @@ nv_normal(cmdarg_T *cap)
if (restart_edit != 0 && mode_displayed)
clear_cmdline = TRUE; // unshow mode later
restart_edit = 0;
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
cmdwin_result = Ctrl_C;
#endif
if (VIsual_active)
{
end_visual_mode(); // stop Visual
@@ -6800,12 +6796,8 @@ nv_esc(cmdarg_T *cap)
if (cap->arg) // TRUE for CTRL-C
{
if (restart_edit == 0
#ifdef FEAT_CMDWIN
&& cmdwin_type == 0
#endif
&& !VIsual_active
&& no_reason)
if (restart_edit == 0 && cmdwin_type == 0
&& !VIsual_active && no_reason)
{
int out_redir = !stdout_isatty && !is_not_a_term_or_gui();
@@ -6840,16 +6832,13 @@ nv_esc(cmdarg_T *cap)
// set again below when halfway a mapping.
if (!p_im)
restart_edit = 0;
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
{
cmdwin_result = K_IGNORE;
got_int = FALSE; // don't stop executing autocommands et al.
return;
}
#endif
}
#ifdef FEAT_CMDWIN
else if (cmdwin_type != 0 && ex_normal_busy && typebuf_was_empty)
{
// When :normal runs out of characters while in the command line window
@@ -6858,7 +6847,6 @@ nv_esc(cmdarg_T *cap)
cmdwin_result = K_IGNORE;
return;
}
#endif
if (VIsual_active)
{
@@ -7190,7 +7178,6 @@ nv_record(cmdarg_T *cap)
}
else if (!checkclearop(cap->oap))
{
#ifdef FEAT_CMDWIN
if (cap->nchar == ':' || cap->nchar == '/' || cap->nchar == '?')
{
if (cmdwin_type != 0)
@@ -7202,7 +7189,6 @@ nv_record(cmdarg_T *cap)
stuffcharReadbuff(K_CMDWIN);
}
else
#endif
// (stop) recording into a named register, unless executing a
// register
if (reg_executing == 0 && do_record(cap->nchar) == FAIL)
+4 -6
View File
@@ -2426,10 +2426,8 @@ didset_options(void)
(void)compile_cap_prog(curwin->w_s);
(void)did_set_spell_option(TRUE);
#endif
#ifdef FEAT_CMDWIN
// set cedit_key
(void)check_cedit();
#endif
#ifdef FEAT_LINEBREAK
// initialize the table for 'breakat'.
fill_breakat_flags();
@@ -3660,11 +3658,13 @@ set_num_option(
// Only compute the new window layout when startup has been
// completed. Otherwise the frame sizes may be wrong.
if (p_ch != old_value && full_screen
if ((p_ch != old_value
|| tabline_height() + topframe->fr_height != Rows - p_ch)
&& full_screen
#ifdef FEAT_GUI
&& !gui.starting
#endif
)
)
command_height();
}
@@ -3912,13 +3912,11 @@ set_num_option(
errmsg = e_argument_must_be_positive;
p_siso = 0;
}
#ifdef FEAT_CMDWIN
if (p_cwh < 1)
{
errmsg = e_argument_must_be_positive;
p_cwh = 1;
}
#endif
if (p_ut < 0)
{
errmsg = e_argument_must_be_positive;
-2
View File
@@ -486,10 +486,8 @@ EXTERN char_u *p_ccv; // 'charconvert'
#endif
EXTERN int p_cdh; // 'cdhome'
EXTERN char_u *p_cino; // 'cinoptions'
#ifdef FEAT_CMDWIN
EXTERN char_u *p_cedit; // 'cedit'
EXTERN long p_cwh; // 'cmdwinheight'
#endif
#ifdef FEAT_CLIPBOARD
EXTERN char_u *p_cb; // 'clipboard'
#endif
+2 -10
View File
@@ -592,13 +592,8 @@ static struct vimoption options[] =
{(char_u *)",,", (char_u *)0L}
SCTX_INIT},
{"cedit", NULL, P_STRING,
#ifdef FEAT_CMDWIN
(char_u *)&p_cedit, PV_NONE,
{(char_u *)"", (char_u *)CTRL_F_STR}
#else
(char_u *)NULL, PV_NONE,
{(char_u *)0L, (char_u *)0L}
#endif
SCTX_INIT},
{"charconvert", "ccv", P_STRING|P_VI_DEF|P_SECURE,
#if defined(FEAT_EVAL)
@@ -645,11 +640,7 @@ static struct vimoption options[] =
(char_u *)&p_ch, PV_NONE,
{(char_u *)1L, (char_u *)0L} SCTX_INIT},
{"cmdwinheight", "cwh", P_NUM|P_VI_DEF,
#ifdef FEAT_CMDWIN
(char_u *)&p_cwh, PV_NONE,
#else
(char_u *)NULL, PV_NONE,
#endif
{(char_u *)7L, (char_u *)0L} SCTX_INIT},
{"colorcolumn", "cc", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP|P_RWIN,
#ifdef FEAT_SYN_HL
@@ -991,7 +982,8 @@ static struct vimoption options[] =
SCTX_INIT},
{"fillchars", "fcs", P_STRING|P_VI_DEF|P_RALL|P_ONECOMMA|P_NODUP,
(char_u *)&p_fcs, PV_FCS,
{(char_u *)"vert:|,fold:-,eob:~", (char_u *)0L}
{(char_u *)"vert:|,fold:-,eob:~,lastline:@",
(char_u *)0L}
SCTX_INIT},
{"fixendofline", "fixeol", P_BOOL|P_VI_DEF|P_RSTAT,
(char_u *)&p_fixeol, PV_FIXEOL,
-2
View File
@@ -1336,13 +1336,11 @@ did_set_string_option(
errmsg = set_chars_option(curwin, varp, TRUE);
}
#ifdef FEAT_CMDWIN
// 'cedit'
else if (varp == &p_cedit)
{
errmsg = check_cedit();
}
#endif
// 'verbosefile'
else if (varp == &p_vfile)
+2 -1
View File
@@ -5124,7 +5124,8 @@ mch_call_shell_fork(
}
}
len = term_replace_bs_del_keycode(ta_buf, ta_len, len);
// Remove Vim-specific codes from the input.
len = term_replace_keycodes(ta_buf, ta_len, len);
/*
* For pipes: echo the typed characters.
+1 -1
View File
@@ -4531,7 +4531,7 @@ mch_system_piped(char *cmd, int options)
}
}
len = term_replace_bs_del_keycode(ta_buf, ta_len, len);
len = term_replace_keycodes(ta_buf, ta_len, len);
/*
* For pipes: echo the typed characters. For a pty this
+1 -1
View File
@@ -86,5 +86,5 @@ void update_tcap(int attr);
void swap_tcap(void);
void ansi_color2rgb(int nr, char_u *r, char_u *g, char_u *b, char_u *ansi_idx);
void cterm_color2rgb(int nr, char_u *r, char_u *g, char_u *b, char_u *ansi_idx);
int term_replace_bs_del_keycode(char_u *ta_buf, int ta_len, int len_arg);
int term_replace_keycodes(char_u *ta_buf, int ta_len, int len_arg);
/* vim: set ft=c : */
+3 -1
View File
@@ -2552,7 +2552,7 @@ screen_fill(
else
force_next = FALSE;
}
#endif
#endif // FEAT_GUI || defined(UNIX)
ScreenLines[off] = c;
if (enc_utf8)
{
@@ -4984,6 +4984,7 @@ set_chars_option(win_T *wp, char_u **varp, int apply)
{&fill_chars.foldsep, "foldsep"},
{&fill_chars.diff, "diff"},
{&fill_chars.eob, "eob"},
{&fill_chars.lastline, "lastline"},
};
static lcs_chars_T lcs_chars;
@@ -5063,6 +5064,7 @@ set_chars_option(win_T *wp, char_u **varp, int apply)
fill_chars.foldsep = '|';
fill_chars.diff = '-';
fill_chars.eob = '~';
fill_chars.lastline = '@';
}
}
p = value;
+1
View File
@@ -3531,6 +3531,7 @@ typedef struct
int foldsep;
int diff;
int eob;
int lastline;
} fill_chars_T;
/*
+17 -3
View File
@@ -6740,10 +6740,11 @@ cterm_color2rgb(int nr, char_u *r, char_u *g, char_u *b, char_u *ansi_idx)
/*
* Replace K_BS by <BS> and K_DEL by <DEL>.
* Include any modifiers into the key and drop them.
* Returns "len" adjusted for replaced codes.
*/
int
term_replace_bs_del_keycode(char_u *ta_buf, int ta_len, int len_arg)
term_replace_keycodes(char_u *ta_buf, int ta_len, int len_arg)
{
int len = len_arg;
int i;
@@ -6751,13 +6752,26 @@ term_replace_bs_del_keycode(char_u *ta_buf, int ta_len, int len_arg)
for (i = ta_len; i < ta_len + len; ++i)
{
if (ta_buf[i] == CSI && len - i > 2)
if (ta_buf[i] == CSI && len - i > 3 && ta_buf[i + 1] == KS_MODIFIER)
{
int modifiers = ta_buf[i + 2];
int key = ta_buf[i + 3];
// Try to use the modifier to modify the key. In any case drop the
// modifier.
mch_memmove(ta_buf + i + 1, ta_buf + i + 4, (size_t)(len - i - 3));
len -= 3;
if (key < 0x80)
key = merge_modifyOtherKeys(key, &modifiers);
ta_buf[i] = key;
}
else if (ta_buf[i] == CSI && len - i > 2)
{
c = TERMCAP2KEY(ta_buf[i + 1], ta_buf[i + 2]);
if (c == K_DEL || c == K_KDEL || c == K_BS)
{
mch_memmove(ta_buf + i + 1, ta_buf + i + 3,
(size_t)(len - i - 2));
(size_t)(len - i - 2));
if (c == K_DEL || c == K_KDEL)
ta_buf[i] = DEL;
else
-2
View File
@@ -445,13 +445,11 @@ term_start(
if (check_restricted() || check_secure())
return NULL;
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
{
emsg(_(e_cannot_open_terminal_from_command_line_window));
return NULL;
}
#endif
if ((opt->jo_set & (JO_IN_IO + JO_OUT_IO + JO_ERR_IO))
== (JO_IN_IO + JO_OUT_IO + JO_ERR_IO)
+1 -1
View File
@@ -10,7 +10,7 @@ NO_INITS = -U NONE $(NO_PLUGINS)
# File to delete when testing starts
CLEANUP_FILES = test.log messages starttime
# Tests for tiny and small builds.
# Tests for tiny build.
SCRIPTS_TINY = \
test10 \
test20 \
@@ -0,0 +1,8 @@
> +0&#ffffff0@74
|~+0#4040ff13&| @73
|~| @73
|~| @73
|~| @73
|~| @73
|[+3#0000000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1
| +0&&@74
@@ -0,0 +1,6 @@
| +2&#ffffff0|[|N|o| |N|a|m|e|]| | +1&&@63
> +0&&@74
|~+0#4040ff13&| @73
|~| @73
|[+3#0000000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1
| +0&&@74
@@ -0,0 +1,8 @@
>x+0&#ffffff0@74
| @74
|a@63| @10
|++0#4040ff13&| |b+0#0000000&@66| @5
|++0#4040ff13&| |c+0#0000000&@5| @66
|~+0#4040ff13&| @73
|~| @73
| +0#0000000&@56|1|,|1| @10|A|l@1|
@@ -1,10 +1,10 @@
>a+0&#ffffff0||+1&&|a+0&&@2| @69
|a||+1&&|b+0&&@72
|a||+1&&|b+0&&@26| @45
|a||+1&&|b+0&&@72
@1||+1&&|b+0&&@53| @18
|b||+1&&|~+0#4040ff13&| @71
|b+0#0000000&||+1&&|~+0#4040ff13&| @71
|b+0#0000000&||+1&&|~+0#4040ff13&| @71
|b+0#0000000&||+1&&|~+0#4040ff13&| @71
|@||+1#0000000&|~+0#4040ff13&| @71
|<+3#0000000&| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @41|1|,|1| @11|A|l@1
| +0&&@74
@@ -1,10 +1,10 @@
>a+0&#ffffff0||+1&&|a+0&&@2| @69
|a||+1&&|b+0&&@72
|a||+1&&|b+0&&@26| @45
|a||+1&&|b+0&&@72
@1||+1&&|b+0&&@53| @18
|b||+1&&|~+0#4040ff13&| @71
|b+0#0000000&||+1&&|~+0#4040ff13&| @71
|b+0#0000000&||+1&&|~+0#4040ff13&| @71
|b+0#0000000&||+1&&|~+0#4040ff13&| @71
|@||+1#0000000&|~+0#4040ff13&| @71
|<+3#0000000&| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @41|1|,|1| @11|A|l@1
|:+0&&|s|e|t| |d|i|s|p|l|a|y|=|l|a|s|t|l|i|n|e| @53
@@ -1,7 +1,7 @@
>a+0&#ffffff0@2| @69||+1&&|a+0&&
|b@72||+1&&|a+0&&
|b@26| @45||+1&&|a+0&&
|~+0#4040ff13&| @71||+1#0000000&|b+0&&
|b@72||+1&&|a+0&&
|b@53| @18||+1&&|b+0&&
|~+0#4040ff13&| @71||+1#0000000&|b+0&&
|~+0#4040ff13&| @71||+1#0000000&|b+0&&
|~+0#4040ff13&| @71||+1#0000000&|b+0&&
@@ -1,7 +1,7 @@
>a+0&#ffffff0@2| @69||+1&&|a+0&&
|b@72||+1&&|a+0&&
|b@26| @45||+1&&|a+0&&
|~+0#4040ff13&| @71||+1#0000000&|b+0&&
|b@72||+1&&|a+0&&
|b@53| @18||+1&&|b+0&&
|~+0#4040ff13&| @71||+1#0000000&|b+0&&
|~+0#4040ff13&| @71||+1#0000000&|b+0&&
|~+0#4040ff13&| @71||+1#0000000&|b+0&&
@@ -0,0 +1,10 @@
>a+0&#ffffff0@2| @71
|b@74
|@+0#4040ff13&@2| @71
|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @43|1|,|1| @11|T|o|p
|a+0&&@2| @71
|b@74
@75
@50| @24
|[+1&&|N|o| |N|a|m|e|]| |[|+|]| @43|1|,|1| @11|A|l@1
|:+0&&|3|s|p|l|i|t| @67
@@ -0,0 +1,10 @@
>a+0&#ffffff0@1||+1&&|a+0&&@2| @68
|a| ||+1&&|b+0&&@71
@2||+1&&|b+0&&@71
@2||+1&&|b+0&&@55| @15
|b@1||+1&&|~+0#4040ff13&| @70
|b+0#0000000&@1||+1&&|~+0#4040ff13&| @70
|b+0#0000000&@1||+1&&|~+0#4040ff13&| @70
|@@1||+1#0000000&|~+0#4040ff13&| @70
|<+3#0000000&|1| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @40|1|,|1| @11|A|l@1
|:+0&&|2|v|s|p|l|i|t| @66
@@ -0,0 +1,10 @@
>a+0&#ffffff0||+1&&|a+0&&@2| @69
|a||+1&&|b+0&&@72
|a||+1&&|b+0&&@72
@1||+1&&|b+0&&@53| @18
|b||+1&&|~+0#4040ff13&| @71
|b+0#0000000&||+1&&|~+0#4040ff13&| @71
|b+0#0000000&||+1&&|~+0#4040ff13&| @71
|€||+1#0000000&|~+0#4040ff13&| @71
|<+3#0000000&| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @41|1|,|1| @11|A|l@1
| +0&&@74
@@ -0,0 +1,10 @@
>a+0&#ffffff0||+1&&|a+0&&@2| @69
|a||+1&&|b+0&&@72
|a||+1&&|b+0&&@72
@1||+1&&|b+0&&@53| @18
|b||+1&&|~+0#4040ff13&| @71
|b+0#0000000&||+1&&|~+0#4040ff13&| @71
|b+0#0000000&||+1&&|~+0#4040ff13&| @71
|€||+1#0000000&|~+0#4040ff13&| @71
|<+3#0000000&| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @41|1|,|1| @11|A|l@1
|:+0&&|s|e|t| |d|i|s|p|l|a|y|=|l|a|s|t|l|i|n|e| @53
@@ -0,0 +1,10 @@
>a+0&#ffffff0@2| @69||+1&&|a+0&&
|b@72||+1&&|a+0&&
|b@72||+1&&|a+0&&
|b@53| @18||+1&&|b+0&&
|~+0#4040ff13&| @71||+1#0000000&|b+0&&
|~+0#4040ff13&| @71||+1#0000000&|b+0&&
|~+0#4040ff13&| @71||+1#0000000&|b+0&&
|~+0#4040ff13&| @71||+1#0000000&|€+0#4040ff13&
|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @41|1|,|1| @11|A|l@1| |<+1&&
|:+0&&|1|0@1|w|i|n|c|m|d| |>| @62
@@ -0,0 +1,10 @@
>a+0&#ffffff0@2| @69||+1&&|a+0&&
|b@72||+1&&|a+0&&
|b@72||+1&&|a+0&&
|b@53| @18||+1&&|b+0&&
|~+0#4040ff13&| @71||+1#0000000&|b+0&&
|~+0#4040ff13&| @71||+1#0000000&|b+0&&
|~+0#4040ff13&| @71||+1#0000000&|b+0&&
|~+0#4040ff13&| @71||+1#0000000&|€+0#4040ff13&
|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @41|1|,|1| @11|A|l@1| |<+1&&
|:+0&&|s|e|t| |d|i|s|p|l|a|y|=|t|r|u|n|c|a|t|e| @53
@@ -0,0 +1,10 @@
>a+0&#ffffff0@2| @71
|b@74
|€+0#4040ff13&@2| @71
|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @43|1|,|1| @11|T|o|p
|a+0&&@2| @71
|b@74
@75
@50| @24
|[+1&&|N|o| |N|a|m|e|]| |[|+|]| @43|1|,|1| @11|A|l@1
|:+0&&|3|s|p|l|i|t| @67
@@ -0,0 +1,10 @@
>a+0&#ffffff0@1||+1&&|a+0&&@2| @68
|a| ||+1&&|b+0&&@71
@2||+1&&|b+0&&@71
@2||+1&&|b+0&&@55| @15
|b@1||+1&&|~+0#4040ff13&| @70
|b+0#0000000&@1||+1&&|~+0#4040ff13&| @70
|b+0#0000000&@1||+1&&|~+0#4040ff13&| @70
|€@1||+1#0000000&|~+0#4040ff13&| @70
|<+3#0000000&|1| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @40|1|,|1| @11|A|l@1
|:+0&&|2|v|s|p|l|i|t| @66
@@ -1,7 +1,7 @@
|f+0&#ffffff0|o@1| |2| @64
|f|o@1| |3| @64
|f|o@1| |4| @64
|[+3&&|N|o| |N|a|m|e|]| |[|+|]| @38|1|,|1| @11|T|o|p
|[+3&&|N|o| |N|a|m|e|]| |[|+|]| @38|2|,|1| @11|1|2|%
|f+0&&|o@1| |2| @64
|f|o@1| |3| @64
|f|o@1| |4| @64
@@ -0,0 +1,8 @@
|-+0#0000e05#a8a8a8255| >j+0#0000000#ffffff0|u|s|t| |s|o|m|e| |t|e|x|t| |h|e|r|e| @53
|~+0#4040ff13&| @73
|~| @73
|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @43|1|,|1| @11|A|l@1
|-+0#0000e05#a8a8a8255| |j+0#0000000#ffffff0|u|s|t| |s|o|m|e| |t|e|x|t| |h|e|r|e| @53
|~+0#4040ff13&| @73
|[+1#0000000&|N|o| |N|a|m|e|]| |[|+|]| @43|1|,|1| @11|A|l@1
| +0&&@74
@@ -0,0 +1,8 @@
|<+0#4040ff13#ffffff0@2|h+0#0000000&| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| @10
|L|i|n|e| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h|
|s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t|
|w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| @10
>L|i|n|e| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h|
|s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t|
|w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| @10
@22|3|,|1| @10|T|o|p|
@@ -0,0 +1,8 @@
|<+0#4040ff13#ffffff0@2|h+0#0000000&| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| @10
|L|i|n|e| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h|
|s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t|
|w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| @10
>L|i|n|e| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h|
|s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t|
|w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| @10
@22|4|,|1| @10|2|5|%|
@@ -0,0 +1,8 @@
|<+0#4040ff13#ffffff0@2|h+0#0000000&| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| @10
|L|i|n|e| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h|
|s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t|
|w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| @10
>L|i|n|e| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h|
|s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t|
|w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| @10
@22|5|,|1| @10|5|0|%|
@@ -0,0 +1,8 @@
|<+0#4040ff13#ffffff0@2|h+0#0000000&| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| @10
|L|i|n|e| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h|
|s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t|
|w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| @10
>L|i|n|e| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h|
|s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t|
|w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| @10
@22|7|,|1| @10|B|o|t|
@@ -0,0 +1,8 @@
>L+0&#ffffff0|i|n|e| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h|
|s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t|
|w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| @10
|L|i|n|e| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h|
|s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t|
|w|i|t|h| |s|o|m|e| |t|e|x|t| |w|i|t|h| |s|o|m|e| |t|e|x|t| @10
|@+0#4040ff13&@2| @36
| +0#0000000&@21|5|,|1| @10|8|0|%|
@@ -0,0 +1,8 @@
|t+0&#5fd7ff255|e|s|t| +0&#ffffff0|t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| >t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t|
|t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t|$| @49
@75
|e+0&#5fd7ff255|n|d| +0&#ffffff0@71
|~+0#4040ff13&| @73
|~| @73
|~| @73
|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|1|,|5|1| @9|A|l@1|
@@ -0,0 +1,8 @@
|t+0&#5fd7ff255|e|s|t| +0&#ffffff0|t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |x>e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t|
|t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t| |t|e|s|t|$| @49
@75
|e+0&#5fd7ff255|n|d| +0&#ffffff0@71
|~+0#4040ff13&| @73
|~| @73
|~| @73
|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|1|,|5|2| @9|A|l@1|
+3 -3
View File
@@ -48,7 +48,7 @@ endfunc
" delete it afterwards. However, if an exception is thrown the file may remain,
" the caller should call DeleteTheScript() afterwards.
let s:script_name = ''
function! ExecAsScript(funcname)
func ExecAsScript(funcname)
" Make a script from the function passed as argument.
let s:script_name = MakeScript(a:funcname)
@@ -56,9 +56,9 @@ function! ExecAsScript(funcname)
exec "source" s:script_name
call delete(s:script_name)
let s:script_name = ''
endfunction
endfunc
function! DeleteTheScript()
func DeleteTheScript()
if s:script_name
call delete(s:script_name)
let s:script_name = ''
-2
View File
@@ -587,8 +587,6 @@ endfunc
" Test for ":all" not working when in the cmdline window
func Test_all_not_allowed_from_cmdwin()
CheckFeature cmdwin
au BufEnter * all
next x
" Use try/catch here, somehow assert_fails() doesn't work on MS-Windows
+11 -14
View File
@@ -2778,7 +2778,6 @@ endfunc
func Test_autocmd_CmdWinEnter()
CheckRunVimInTerminal
CheckFeature cmdwin
let lines =<< trim END
augroup vimHints | au! | augroup END
@@ -3418,19 +3417,17 @@ func Test_mode_changes()
call assert_equal(5, g:nori_to_any)
endif
if has('cmdwin')
let g:n_to_c = 0
au ModeChanged n:c let g:n_to_c += 1
let g:c_to_n = 0
au ModeChanged c:n let g:c_to_n += 1
let g:mode_seq += ['c', 'n', 'c', 'n']
call feedkeys("q:\<C-C>\<Esc>", 'tnix')
call assert_equal(len(g:mode_seq) - 1, g:index)
call assert_equal(2, g:n_to_c)
call assert_equal(2, g:c_to_n)
unlet g:n_to_c
unlet g:c_to_n
endif
let g:n_to_c = 0
au ModeChanged n:c let g:n_to_c += 1
let g:c_to_n = 0
au ModeChanged c:n let g:c_to_n += 1
let g:mode_seq += ['c', 'n', 'c', 'n']
call feedkeys("q:\<C-C>\<Esc>", 'tnix')
call assert_equal(len(g:mode_seq) - 1, g:index)
call assert_equal(2, g:n_to_c)
call assert_equal(2, g:c_to_n)
unlet g:n_to_c
unlet g:c_to_n
au! ModeChanged
delfunc TestMode
+14 -16
View File
@@ -660,7 +660,7 @@ func Test_breakindent19_sbr_nextpage()
norm! 5gj
let lines = s:screen_lines(1, 20)
let expect = [
\ "<<<aaaaaaaaaaaaaaaaa",
\ ">aaaaaaaaaaaaaaaaaaa",
\ ">aaaaaaaaaaaaaaaaaaa",
\ ">aaaaaaaaaaaaaaaaaaa",
\ ]
@@ -671,14 +671,14 @@ endfunc
func Test_breakindent20_cpo_n_nextpage()
let s:input = ""
call s:test_windows('setl breakindent briopt=min:14 cpo+=n number')
call setline(1, repeat('a', 200))
call setline(1, repeat('abcdefghijklmnopqrst', 10))
norm! 1gg
redraw!
let lines = s:screen_lines(1, 20)
let expect = [
\ " 1 aaaaaaaaaaaaaaaa",
\ " aaaaaaaaaaaaaaaa",
\ " aaaaaaaaaaaaaaaa",
\ " 1 abcdefghijklmnop",
\ " qrstabcdefghijkl",
\ " mnopqrstabcdefgh",
\ ]
call s:compare_lines(expect, lines)
" Scroll down one screen line
@@ -686,11 +686,10 @@ func Test_breakindent20_cpo_n_nextpage()
norm! 5gj
redraw!
let lines = s:screen_lines(1, 20)
" FIXME: this is not the right result
let expect = [
\ "<<<aaaaaaaaaaaaaaaaa",
\ " aaaaaaaaaaaaaaaa",
\ " aaaaaaaaaaaaaaaa",
\ "<<< qrstabcdefghijkl",
\ " mnopqrstabcdefgh",
\ " ijklmnopqrstabcd",
\ ]
call s:compare_lines(expect, lines)
@@ -698,19 +697,18 @@ func Test_breakindent20_cpo_n_nextpage()
norm! 1gg
let lines = s:screen_lines(1, 20)
let expect = [
\ " 1 aaaaaaaaaaaaaaaa",
\ " aaaaaaaaaaaaaa",
\ " aaaaaaaaaaaaaa",
\ " 1 abcdefghijklmnop",
\ " qrstabcdefghij",
\ " klmnopqrstabcd",
\ ]
call s:compare_lines(expect, lines)
" Scroll down one screen line
norm! 5gj
let lines = s:screen_lines(1, 20)
" FIXME: this is not the right result
let expect = [
\ "<<<aaaaaaaaaaaaaaaaa",
\ " aaaaaaaaaaaaaa",
\ " aaaaaaaaaaaaaa",
\ "<<< qrstabcdefghij",
\ " klmnopqrstabcd",
\ " efghijklmnopqr",
\ ]
call s:compare_lines(expect, lines)
+21
View File
@@ -248,6 +248,13 @@ func Test_changing_cmdheight()
let lines =<< trim END
set cmdheight=1 laststatus=2
func EchoTwo()
set laststatus=2
set cmdheight=5
echo 'foo'
echo 'bar'
set cmdheight=1
endfunc
END
call writefile(lines, 'XTest_cmdheight', 'D')
@@ -272,6 +279,20 @@ func Test_changing_cmdheight()
call term_sendkeys(buf, ":set cmdheight=1\<CR>")
call VerifyScreenDump(buf, 'Test_changing_cmdheight_5', {})
" setting 'cmdheight' works after outputting two messages
call term_sendkeys(buf, ":call EchoTwo()\<CR>")
call VerifyScreenDump(buf, 'Test_changing_cmdheight_6', {})
" clean up
call StopVimInTerminal(buf)
endfunc
func Test_cmdheight_tabline()
CheckScreendump
let buf = RunVimInTerminal('-c "set ls=2" -c "set stal=2" -c "set cmdheight=1"', {'rows': 6})
call VerifyScreenDump(buf, 'Test_cmdheight_tabline_1', {})
" clean up
call StopVimInTerminal(buf)
endfunc
-2
View File
@@ -1,8 +1,6 @@
" Tests for editing the command line.
source check.vim
CheckFeature cmdwin
source screendump.vim
func Test_getcmdwintype()
+26
View File
@@ -159,6 +159,32 @@ func Test_conceal_resize_term()
call StopVimInTerminal(buf)
endfunc
func Test_conceal_linebreak()
CheckScreendump
let code =<< trim [CODE]
vim9script
&wrap = true
&conceallevel = 2
&concealcursor = 'nc'
&linebreak = true
&showbreak = '+ '
var line: string = 'a`a`a`a`'
.. 'a'->repeat(&columns - 15)
.. ' b`b`'
.. 'b'->repeat(&columns - 10)
.. ' cccccc'
['x'->repeat(&columns), '', line]->setline(1)
syntax region CodeSpan matchgroup=Delimiter start=/\z(`\+\)/ end=/\z1/ concealends
[CODE]
call writefile(code, 'XTest_conceal_linebreak', 'D')
let buf = RunVimInTerminal('-S XTest_conceal_linebreak', {'rows': 8})
call VerifyScreenDump(buf, 'Test_conceal_linebreak_1', {})
" clean up
call StopVimInTerminal(buf)
endfunc
" Tests for correct display (cursor column position) with +conceal and
" tabulators. Need to run this test in a separate Vim instance. Otherwise the
" screen is not updated (lazy redraw) and the cursor position is wrong.
+8 -8
View File
@@ -3,26 +3,26 @@
source check.vim
source screendump.vim
function! s:screen_attr(lnum) abort
func s:screen_attr(lnum) abort
return map(range(1, 8), 'screenattr(a:lnum, v:val)')
endfunction
endfunc
function! s:test_windows(h, w) abort
func s:test_windows(h, w) abort
call NewWindow(a:h, a:w)
endfunction
endfunc
function! s:close_windows() abort
func s:close_windows() abort
call CloseWindow()
endfunction
endfunc
function! s:new_hi() abort
func s:new_hi() abort
redir => save_hi
silent! hi CursorLineNr
redir END
let save_hi = join(split(substitute(save_hi, '\s*xxx\s*', ' ', ''), "\n"), '')
exe 'hi' save_hi 'ctermbg=0 guibg=Black'
return save_hi
endfunction
endfunc
func Test_cursorline_highlight1()
let save_hi = s:new_hi()
+28 -8
View File
@@ -391,30 +391,50 @@ func Test_display_linebreak_breakat()
let &breakat=_breakat
endfunc
func Test_display_lastline()
CheckScreendump
func Run_Test_display_lastline(euro)
let lines =<< trim END
call setline(1, ['aaa', 'b'->repeat(100)])
call setline(1, ['aaa', 'b'->repeat(200)])
set display=truncate
vsplit
100wincmd <
END
if a:euro != ''
let lines[2] = 'set fillchars=vert:\|,lastline:€'
endif
call writefile(lines, 'XdispLastline', 'D')
let buf = RunVimInTerminal('-S XdispLastline', #{rows: 10})
call VerifyScreenDump(buf, 'Test_display_lastline_1', {})
call VerifyScreenDump(buf, $'Test_display_lastline_{a:euro}1', {})
call term_sendkeys(buf, ":set display=lastline\<CR>")
call VerifyScreenDump(buf, 'Test_display_lastline_2', {})
call VerifyScreenDump(buf, $'Test_display_lastline_{a:euro}2', {})
call term_sendkeys(buf, ":100wincmd >\<CR>")
call VerifyScreenDump(buf, 'Test_display_lastline_3', {})
call VerifyScreenDump(buf, $'Test_display_lastline_{a:euro}3', {})
call term_sendkeys(buf, ":set display=truncate\<CR>")
call VerifyScreenDump(buf, 'Test_display_lastline_4', {})
call VerifyScreenDump(buf, $'Test_display_lastline_{a:euro}4', {})
call term_sendkeys(buf, ":close\<CR>")
call term_sendkeys(buf, ":3split\<CR>")
call VerifyScreenDump(buf, $'Test_display_lastline_{a:euro}5', {})
call term_sendkeys(buf, ":close\<CR>")
call term_sendkeys(buf, ":2vsplit\<CR>")
call VerifyScreenDump(buf, $'Test_display_lastline_{a:euro}6', {})
call StopVimInTerminal(buf)
endfunc
func Test_display_lastline()
CheckScreendump
call Run_Test_display_lastline('')
call Run_Test_display_lastline('euro_')
call assert_fails(':set fillchars=lastline:', 'E474:')
call assert_fails(':set fillchars=lastline:', 'E474:')
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+19
View File
@@ -1744,4 +1744,23 @@ func Test_gui_lowlevel_keyevent()
bw!
endfunc
func Test_gui_macro_csi()
" Test for issue #11270
nnoremap <C-L> <Cmd>let g:triggered = 1<CR>
let @q = "\x9b\xfc\x04L"
norm @q
call assert_equal(1, g:triggered)
unlet g:triggered
nunmap <C-L>
" Test for issue #11057
inoremap <C-D>t bbb
call setline(1, "\t")
let @q = "i\x9b\xfc\x04D"
" The end of :normal is like a mapping timing out
norm @q
call assert_equal('', getline(1))
iunmap <C-D>t
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+1 -1
View File
@@ -167,7 +167,7 @@ func Test_visual_block_and_selection_exclusive()
exe "norm! $3B\<C-v>eAx\<Esc>"
let lines = s:screen_lines([1, 10], winwidth(0))
let expect = [
\ "<<<obar foobar ",
\ "+foobar foobar ",
\ "+foobar foobar ",
\ "+foobar foobar ",
\ "+foobar foobar ",
+2 -2
View File
@@ -1152,11 +1152,11 @@ func Test_CompleteChanged()
bw!
endfunc
function! GetPumPosition()
func GetPumPosition()
call assert_true( pumvisible() )
let g:pum_pos = pum_getpos()
return ''
endfunction
endfunc
func Test_pum_getpos()
new
+1 -1
View File
@@ -220,7 +220,7 @@ func Test_prompt_buffer_getbufinfo()
%bwipe!
endfunc
function! Test_prompt_while_writing_to_hidden_buffer()
func Test_prompt_while_writing_to_hidden_buffer()
call CanTestPromptBuffer()
CheckUnix
+60 -123
View File
@@ -396,7 +396,7 @@ func XfileTests(cchar)
Xtestfile1:700:10:Line 700
Xtestfile2:800:15:Line 800
END
call writefile(lines, 'Xqftestfile1')
call writefile(lines, 'Xqftestfile1', 'D')
enew!
Xfile Xqftestfile1
@@ -439,8 +439,6 @@ func XfileTests(cchar)
call writefile([t], 'Xqftestfile1', 'b')
silent! Xfile Xqftestfile1
call assert_equal(text, g:Xgetlist()[0].text)
call delete('Xqftestfile1')
endfunc
func Test_cfile()
@@ -795,10 +793,9 @@ func Xnomem_tests(cchar)
call assert_fails('Xbuffer', 'E342:')
%bw!
call writefile([repeat('a', 8192)], 'Xtest')
call writefile([repeat('a', 8192)], 'Xtest', 'D')
call test_alloc_fail(GetAllocId('qf_linebuf'), 0, 0)
call assert_fails('Xfile Xtest', 'E342:')
call delete('Xtest')
endfunc
func Test_nomem()
@@ -899,7 +896,7 @@ def Test_helpgrep_vim9_restore_cpo()
var rtp_save = &rtp
var dir = 'Xruntime/after'
&rtp ..= ',' .. dir
mkdir(dir .. '/ftplugin', 'p')
mkdir(dir .. '/ftplugin', 'pR')
writefile(['vim9script'], dir .. '/ftplugin/qf.vim')
filetype plugin on
silent helpgrep grail
@@ -907,7 +904,6 @@ def Test_helpgrep_vim9_restore_cpo()
silent helpgrep grail
assert_equal('aABceFs', &cpo)
delete('Xruntime', 'rf')
&rtp = rtp_save
cclose
helpclose
@@ -1180,8 +1176,8 @@ func Test_locationlist_curwin_was_closed()
endfunc
func Test_locationlist_cross_tab_jump()
call writefile(['loclistfoo'], 'loclistfoo')
call writefile(['loclistbar'], 'loclistbar')
call writefile(['loclistfoo'], 'loclistfoo', 'D')
call writefile(['loclistbar'], 'loclistbar', 'D')
set switchbuf=usetab
edit loclistfoo
@@ -1191,8 +1187,6 @@ func Test_locationlist_cross_tab_jump()
enew | only | tabonly
set switchbuf&vim
call delete('loclistfoo')
call delete('loclistbar')
endfunc
" More tests for 'errorformat'
@@ -1237,8 +1231,9 @@ func Test_efm1()
"Xtestfile", line 22 col 9: What is the title of the quickfix window?
[DATA]
call writefile(l, 'Xerrorfile1')
call writefile(l[:-2], 'Xerrorfile2')
call writefile(l, 'Xerrorfile1', 'D')
call delete('loclistbar')
call writefile(l[:-2], 'Xerrorfile2', 'D')
let m =<< [DATA]
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 2
@@ -1263,7 +1258,7 @@ func Test_efm1()
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 21
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 22
[DATA]
call writefile(m, 'Xtestfile')
call writefile(m, 'Xtestfile', 'D')
let save_efm = &efm
set efm+==%f=\\,\ line\ %l%*\\D%v%*[^\ ]\ %m
@@ -1309,9 +1304,6 @@ func Test_efm1()
wincmd p
let &efm = save_efm
call delete('Xerrorfile1')
call delete('Xerrorfile2')
call delete('Xtestfile')
endfunc
" Test for quickfix directory stack support
@@ -1363,11 +1355,11 @@ endfunc
" Tests for %D and %X errorformat options
func Test_efm_dirstack()
" Create the directory stack and files
call mkdir('dir1')
call mkdir('dir1', 'R')
call mkdir('dir1/a')
call mkdir('dir1/a/b')
call mkdir('dir1/c')
call mkdir('dir2')
call mkdir('dir2', 'R')
let lines =<< trim END
Nine Healthy Habits
@@ -1382,7 +1374,7 @@ func Test_efm_dirstack()
8 Hours of sleep (at least)
9 PM end of the day and off to bed
END
call writefile(lines, 'habits1.txt')
call writefile(lines, 'habits1.txt', 'D')
call writefile(lines, 'dir1/a/habits2.txt')
call writefile(lines, 'dir1/a/b/habits3.txt')
call writefile(lines, 'dir1/c/habits4.txt')
@@ -1390,10 +1382,6 @@ func Test_efm_dirstack()
call s:dir_stack_tests('c')
call s:dir_stack_tests('l')
call delete('dir1', 'rf')
call delete('dir2', 'rf')
call delete('habits1.txt')
endfunc
" Test for resync after continuing an ignored message
@@ -1518,9 +1506,9 @@ func Test_efm2()
set efm=%+P[%f]%r,(%l\\,%c)%*[\ ]%t%*[^:]:\ %m,%+Q--%r
" To exercise the push/pop file functionality in quickfix, the test files
" need to be created.
call writefile(['Line1'], 'Xtestfile1')
call writefile(['Line2'], 'Xtestfile2')
call writefile(['Line3'], 'Xtestfile3')
call writefile(['Line1'], 'Xtestfile1', 'D')
call writefile(['Line2'], 'Xtestfile2', 'D')
call writefile(['Line3'], 'Xtestfile3', 'D')
cexpr ""
for l in lines
caddexpr l
@@ -1531,9 +1519,6 @@ func Test_efm2()
call assert_equal(2, l[2].col)
call assert_equal('w', l[2].type)
call assert_equal('e', l[3].type)
call delete('Xtestfile1')
call delete('Xtestfile2')
call delete('Xtestfile3')
" Test for %P, %Q with non-existing files
cexpr lines
@@ -1602,7 +1587,7 @@ func Test_efm2()
" Test for %o
set efm=%f(%o):%l\ %m
cgetexpr ['Xotestfile(Language.PureScript.Types):20 Error']
call writefile(['Line1'], 'Xotestfile')
call writefile(['Line1'], 'Xotestfile', 'D')
let l = getqflist()
call assert_equal(1, len(l), string(l))
call assert_equal('Language.PureScript.Types', l[0].module)
@@ -1612,7 +1597,6 @@ func Test_efm2()
call assert_equal('Xotestfile', expand('%:t'))
cclose
bd
call delete("Xotestfile")
" Test for a long module name
cexpr 'Xtest(' . repeat('m', 1026) . '):15 message'
@@ -1776,7 +1760,7 @@ func Test_quickfix_was_changed_by_autocmd()
endfunc
func Test_setloclist_in_autocommand()
call writefile(['test1', 'test2'], 'Xfile')
call writefile(['test1', 'test2'], 'Xfile', 'D')
edit Xfile
let s:bufnr = bufnr()
call setloclist(1,
@@ -1796,7 +1780,6 @@ func Test_setloclist_in_autocommand()
augroup Test_LocList
au!
augroup END
call delete('Xfile')
endfunc
func Test_caddbuffer_to_empty()
@@ -2129,11 +2112,10 @@ func Test_cgetfile_on_long_lines()
/tmp/file4:1:1:ccc
END
let lines[1] = substitute(lines[1], '%s', repeat('x', len), '')
call writefile(lines, 'Xcqetfile.txt')
call writefile(lines, 'Xcqetfile.txt', 'D')
cgetfile Xcqetfile.txt
call assert_equal(4, getqflist(#{size: v:true}).size, 'with length ' .. len)
endfor
call delete('Xcqetfile.txt')
endfunc
func s:create_test_file(filename)
@@ -2274,7 +2256,7 @@ func Test_switchbuf()
" If opening a file changes 'switchbuf', then the new value should be
" retained.
set modeline&vim
call writefile(["vim: switchbuf=split"], 'Xqftestfile1')
call writefile(["vim: switchbuf=split"], 'Xqftestfile1', 'D')
enew | only
set switchbuf&vim
cexpr "Xqftestfile1:1:10"
@@ -2290,7 +2272,6 @@ func Test_switchbuf()
cexpr "Xqftestfile1:1:10"
call assert_equal('', &switchbuf)
call delete('Xqftestfile1')
call delete('Xqftestfile2')
call delete('Xqftestfile3')
set switchbuf&vim
@@ -2385,8 +2366,8 @@ func Test_two_windows()
" Use one 'errorformat' for two windows. Add an expression to each of them,
" make sure they each keep their own state.
set efm=%DEntering\ dir\ '%f',%f:%l:%m,%XLeaving\ dir\ '%f'
call mkdir('Xone/a', 'p')
call mkdir('Xtwo/a', 'p')
call mkdir('Xone/a', 'pR')
call mkdir('Xtwo/a', 'pR')
let lines = ['1', '2', 'one one one', '4', 'two two two', '6', '7']
call writefile(lines, 'Xone/a/one.txt')
call writefile(lines, 'Xtwo/a/two.txt')
@@ -2418,8 +2399,6 @@ func Test_two_windows()
bwipe!
call win_gotoid(two_id)
bwipe!
call delete('Xone', 'rf')
call delete('Xtwo', 'rf')
endfunc
func XbottomTests(cchar)
@@ -2503,12 +2482,10 @@ func Test_duplicate_buf()
let last_buffer = bufnr("$")
" make sure only one buffer is created
call writefile(['this one', 'that one'], 'Xgrepthis')
call writefile(['this one', 'that one'], 'Xgrepthis', 'D')
vimgrep one Xgrepthis
vimgrep one Xgrepthis
call assert_equal(last_buffer + 1, bufnr("$"))
call delete('Xgrepthis')
endfunc
" Quickfix/Location list set/get properties tests
@@ -2876,8 +2853,8 @@ func Test_Autocmd()
END
call assert_equal(l, g:acmds)
call writefile(['Xtest:1:Line1'], 'Xtest')
call writefile([], 'Xempty')
call writefile(['Xtest:1:Line1'], 'Xtest', 'D')
call writefile([], 'Xempty', 'D')
let g:acmds = []
cfile Xtest
caddfile Xtest
@@ -2976,8 +2953,6 @@ func Test_Autocmd()
call assert_equal(l, g:acmds)
endif
call delete('Xtest')
call delete('Xempty')
au! QuickFixCmdPre
au! QuickFixCmdPost
endfunc
@@ -3137,7 +3112,7 @@ func Test_cwindow_highlight()
redraw
cwindow 4
END
call writefile(lines, 'XtestCwindow')
call writefile(lines, 'XtestCwindow', 'D')
let buf = RunVimInTerminal('-S XtestCwindow', #{rows: 12})
call VerifyScreenDump(buf, 'Test_quickfix_cwindow_1', {})
@@ -3152,7 +3127,6 @@ func Test_cwindow_highlight()
" clean up
call StopVimInTerminal(buf)
call delete('XtestCwindow')
call delete('XCwindow')
endfunc
@@ -3164,8 +3138,8 @@ func XvimgrepTests(cchar)
Editor:Emacs EmAcS
Editor:Notepad NOTEPAD
END
call writefile(lines, 'Xtestfile1')
call writefile(['Linux', 'macOS', 'MS-Windows'], 'Xtestfile2')
call writefile(lines, 'Xtestfile1', 'D')
call writefile(['Linux', 'macOS', 'MS-Windows'], 'Xtestfile2', 'D')
" Error cases
call assert_fails('Xvimgrep /abc *', 'E682:')
@@ -3221,9 +3195,6 @@ func XvimgrepTests(cchar)
augroup QF_Test
au!
augroup END
call delete('Xtestfile1')
call delete('Xtestfile2')
endfunc
" Tests for the :vimgrep command
@@ -3261,11 +3232,10 @@ func Test_vimgrep_with_no_last_search_pat()
call writefile(v:errors, 'Xresult')
qall!
[SCRIPT]
call writefile(lines, 'Xscript')
call writefile(lines, 'Xscript', 'D')
if RunVim([], [], '--clean -S Xscript')
call assert_equal([], readfile('Xresult'))
endif
call delete('Xscript')
call delete('Xresult')
endfunc
@@ -3276,17 +3246,16 @@ func Test_vimgrep_without_swap_file()
call writefile(['done'], 'Xresult')
qall!
[SCRIPT]
call writefile(lines, 'Xscript')
call writefile(lines, 'Xscript', 'D')
if RunVim([], [], '--clean -n -S Xscript Xscript')
call assert_equal(['done'], readfile('Xresult'))
endif
call delete('Xscript')
call delete('Xresult')
endfunc
func Test_vimgrep_existing_swapfile()
call writefile(['match apple with apple'], 'Xapple')
call writefile(['swapfile'], '.Xapple.swp')
call writefile(['match apple with apple'], 'Xapple', 'D')
call writefile(['swapfile'], '.Xapple.swp', 'D')
let g:foundSwap = 0
let g:ignoreSwapExists = 1
augroup grep
@@ -3296,8 +3265,6 @@ func Test_vimgrep_existing_swapfile()
call assert_equal(1, g:foundSwap)
call assert_match('.Xapple.swo', swapname(''))
call delete('Xapple')
call delete('.Xapple.swp')
augroup grep
au! SwapExists
augroup END
@@ -3638,8 +3605,8 @@ func Xmultidirstack_tests(cchar)
endfunc
func Test_multidirstack()
call mkdir('Xone/a', 'p')
call mkdir('Xtwo/a', 'p')
call mkdir('Xone/a', 'pR')
call mkdir('Xtwo/a', 'pR')
let lines = ['1', '2', 'one one one', '4', 'two two two', '6', '7']
call writefile(lines, 'Xone/a/one.txt')
call writefile(lines, 'Xtwo/a/two.txt')
@@ -3650,8 +3617,6 @@ func Test_multidirstack()
call Xmultidirstack_tests('l')
let &efm = save_efm
call delete('Xone', 'rf')
call delete('Xtwo', 'rf')
endfunc
" Tests for per quickfix/location list file stack
@@ -3700,8 +3665,8 @@ endfunc
func Test_multifilestack()
let lines = ['1', '2', 'one one one', '4', 'two two two', '6', '7']
call writefile(lines, 'one.txt')
call writefile(lines, 'two.txt')
call writefile(lines, 'one.txt', 'D')
call writefile(lines, 'two.txt', 'D')
let save_efm = &efm
set efm=%+P[%f],(%l\\,%c)\ %m,%-Q
@@ -3709,14 +3674,12 @@ func Test_multifilestack()
call Xmultifilestack_tests('l')
let &efm = save_efm
call delete('one.txt')
call delete('two.txt')
endfunc
" Tests for per buffer 'efm' setting
func Test_perbuf_efm()
call writefile(["File1-10-Line10"], 'one.txt')
call writefile(["File2#20#Line20"], 'two.txt')
call writefile(["File1-10-Line10"], 'one.txt', 'D')
call writefile(["File2#20#Line20"], 'two.txt', 'D')
set efm=%f#%l#%m
new | only
new
@@ -3731,8 +3694,6 @@ func Test_perbuf_efm()
set efm&
new | only
call delete('one.txt')
call delete('two.txt')
endfunc
" Open multiple help windows using ":lhelpgrep
@@ -3908,9 +3869,9 @@ endfunc
func Xqfjump_tests(cchar)
call s:setup_commands(a:cchar)
call writefile(["Line1\tFoo", "Line2"], 'F1')
call writefile(["Line1\tBar", "Line2"], 'F2')
call writefile(["Line1\tBaz", "Line2"], 'F3')
call writefile(["Line1\tFoo", "Line2"], 'F1', 'D')
call writefile(["Line1\tBar", "Line2"], 'F2', 'D')
call writefile(["Line1\tBaz", "Line2"], 'F3', 'D')
call g:Xsetlist([], 'f')
@@ -3999,10 +3960,6 @@ func Xqfjump_tests(cchar)
" Cleanup
enew!
new | only
call delete('F1')
call delete('F2')
call delete('F3')
endfunc
func Test_qfjump()
@@ -4118,9 +4075,8 @@ func Test_empty_list_quickfixtextfunc()
let &quickfixtextfunc = 's:Func'
cgetfile [ex
END
call writefile(lines, 'Xquickfixtextfunc')
call writefile(lines, 'Xquickfixtextfunc', 'D')
call RunVim([], [], '-e -s -S Xquickfixtextfunc -c qa')
call delete('Xquickfixtextfunc')
endfunc
func Test_getqflist()
@@ -4173,7 +4129,7 @@ func Xqftick_tests(cchar)
\ {'filename' : 'F7', 'lnum' : 11, 'text' : 'L11'}], 'r')
call assert_equal(2, g:Xgetlist({'changedtick' : 0}).changedtick)
call writefile(["F8:80:L80", "F8:81:L81"], "Xone")
call writefile(["F8:80:L80", "F8:81:L81"], "Xone", 'D')
Xfile Xone
call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
Xaddfile Xone
@@ -4186,8 +4142,6 @@ func Xqftick_tests(cchar)
call g:Xsetlist([], 'a', {'nr' : 1, "lines" : ["F10:10:L10"]})
call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
call assert_equal(2, g:Xgetlist({'nr' : 1, 'changedtick' : 0}).changedtick)
call delete("Xone")
endfunc
func Test_qf_tick()
@@ -4341,8 +4295,8 @@ endfunc
" :vimgrep/:lvimgrep commands are running.
func Test_vimgrep_autocmd()
call setqflist([], 'f')
call writefile(['stars'], 'Xtest1.txt')
call writefile(['stars'], 'Xtest2.txt')
call writefile(['stars'], 'Xtest1.txt', 'D')
call writefile(['stars'], 'Xtest2.txt', 'D')
" Test 1:
" When searching for a pattern using :vimgrep, if the quickfix list is
@@ -4373,8 +4327,6 @@ func Test_vimgrep_autocmd()
call assert_fails('lvimgrep stars Xtest*.txt', 'E926:')
au! BufRead Xtest2.txt
call delete('Xtest1.txt')
call delete('Xtest2.txt')
call setqflist([], 'f')
endfunc
@@ -4403,14 +4355,13 @@ func Xvimgrep_autocmd_cd(cchar)
endfunc
func Test_vimgrep_autocmd_cd()
call mkdir('Xgrepdir/a', 'p')
call mkdir('Xgrepdir/b', 'p')
call mkdir('Xgrepdir/a', 'pR')
call mkdir('Xgrepdir/b', 'pR')
call writefile(['a_L1_vim', 'a_L2_vim'], 'Xgrepdir/a/f1.txt')
call writefile(['b_L1_vim', 'b_L2_vim'], 'Xgrepdir/b/f2.txt')
call Xvimgrep_autocmd_cd('c')
call Xvimgrep_autocmd_cd('l')
%bwipe
call delete('Xgrepdir', 'rf')
endfunc
" The following test used to crash Vim
@@ -4539,7 +4490,7 @@ endfunc
" Otherwise due to indentation, the title is set with spaces at the beginning
" of the command.
func Test_qftitle()
call writefile(["F1:1:Line1"], 'Xerr')
call writefile(["F1:1:Line1"], 'Xerr', 'D')
" :cexpr
exe "cexpr readfile('Xerr')"
@@ -4617,7 +4568,6 @@ func Test_qftitle()
call assert_equal(':setqflist()', getqflist({'title' : 1}).title)
close
call delete('Xerr')
call setqflist([], ' ', {'title' : 'Errors'})
copen
@@ -4700,7 +4650,7 @@ func Xjumpto_first_error_test(cchar)
" Test for cfile/lfile
enew
call writefile(l, 'Xerr')
call writefile(l, 'Xerr', 'D')
Xfile Xerr
call assert_equal('Xtestfile1', @%)
call assert_equal(2, line('.'))
@@ -4711,7 +4661,6 @@ func Xjumpto_first_error_test(cchar)
call assert_equal('Xtestfile1', @%)
call assert_equal(2, line('.'))
call delete('Xerr')
call delete('Xtestfile1')
call delete('Xtestfile2')
endfunc
@@ -4731,7 +4680,7 @@ func Xautocmd_changelist(cchar)
call s:create_test_file('Xtestfile2')
Xexpr 'Xtestfile1:2:Line2'
autocmd QuickFixCmdPost * Xolder
call writefile(['Xtestfile2:4:Line4'], 'Xerr')
call writefile(['Xtestfile2:4:Line4'], 'Xerr', 'D')
Xfile Xerr
call assert_equal('Xtestfile2', @%)
call assert_equal(4, line('.'))
@@ -4802,7 +4751,6 @@ func Xautocmd_changelist(cchar)
call assert_fails('silent Xvimgrep Line5 Xtestfile2', 'E480:')
autocmd! QuickFixCmdPost
call delete('Xerr')
call delete('Xtestfile1')
call delete('Xtestfile2')
endfunc
@@ -4919,7 +4867,7 @@ endfunc
" Test for parsing entries using visual screen column
func Test_viscol()
enew
call writefile(["Col1\tCol2\tCol3"], 'Xfile1')
call writefile(["Col1\tCol2\tCol3"], 'Xfile1', 'D')
edit Xfile1
" Use byte offset for column number
@@ -4984,7 +4932,6 @@ func Test_viscol()
enew | only
set efm&
call delete('Xfile1')
endfunc
" Test for the quickfix window buffer
@@ -5101,14 +5048,13 @@ endfunc
" a normal buffer.
func Test_empty_qfbuf()
enew | only
call writefile(["Test"], 'Xfile1')
call writefile(["Test"], 'Xfile1', 'D')
call setqflist([], 'f')
copen | only
let qfbuf = bufnr('')
edit Xfile1
call assert_notequal(qfbuf, bufnr(''))
enew
call delete('Xfile1')
endfunc
" Test for the :cbelow, :cabove, :lbelow and :labove commands.
@@ -5341,7 +5287,7 @@ func Xtest_qfcmd_abort(cchar)
call assert_equal(0, g:Xgetlist({'nr' : '$'}).nr)
" cfile/lfile
call writefile(["F1:10:Line10", "F2:20:Line20"], 'Xfile1')
call writefile(["F1:10:Line10", "F2:20:Line20"], 'Xfile1', 'D')
let e = ''
try
Xfile Xfile1
@@ -5350,7 +5296,6 @@ func Xtest_qfcmd_abort(cchar)
endtry
call assert_equal('AbortCmd', e)
call assert_equal(0, g:Xgetlist({'nr' : '$'}).nr)
call delete('Xfile1')
" cgetbuffer/lgetbuffer
enew!
@@ -5414,7 +5359,7 @@ endfunc
" Test for using a file in one of the parent directories.
func Test_search_in_dirstack()
call mkdir('Xtestdir/a/b/c', 'p')
call mkdir('Xtestdir/a/b/c', 'pR')
let save_cwd = getcwd()
call writefile(["X1_L1", "X1_L2"], 'Xtestdir/Xfile1')
call writefile(["X2_L1", "X2_L2"], 'Xtestdir/a/Xfile2')
@@ -5451,7 +5396,6 @@ func Test_search_in_dirstack()
set efm&
exe 'cd ' . save_cwd
call delete('Xtestdir', 'rf')
endfunc
" Test for :cquit
@@ -5895,7 +5839,7 @@ endfunc
" Running :lhelpgrep command more than once in a help window, doesn't jump to
" the help topic
func Test_lhelpgrep_from_help_window()
call mkdir('Xtestdir/doc', 'p')
call mkdir('Xtestdir/doc', 'pR')
call writefile(['window'], 'Xtestdir/doc/a.txt')
call writefile(['buffer'], 'Xtestdir/doc/b.txt')
let save_rtp = &rtp
@@ -5906,7 +5850,6 @@ func Test_lhelpgrep_from_help_window()
lhelpgrep window
call assert_equal('a.txt', fnamemodify(@%, ":p:t"))
let &rtp = save_rtp
call delete('Xtestdir', 'rf')
new | only!
endfunc
@@ -5993,7 +5936,7 @@ func Test_quickfix_window_fails_to_open()
anything
endtry
END
call writefile(lines, 'XquickfixFails')
call writefile(lines, 'XquickfixFails', 'D')
let lines =<< trim END
split XquickfixFails
@@ -6004,7 +5947,7 @@ func Test_quickfix_window_fails_to_open()
" is aborted but the window was already split.
silent! cwindow
END
call writefile(lines, 'XtestWinFails')
call writefile(lines, 'XtestWinFails', 'D')
let buf = RunVimInTerminal('-S XtestWinFails', #{rows: 13})
call VerifyScreenDump(buf, 'Test_quickfix_window_fails', {})
@@ -6012,8 +5955,6 @@ func Test_quickfix_window_fails_to_open()
call term_sendkeys(buf, ":bwipe!\<CR>")
call term_wait(buf)
call StopVimInTerminal(buf)
call delete('XtestWinFails')
call delete('XquickfixFails')
endfunc
" Test for updating the quickfix buffer whenever the associated quickfix list
@@ -6076,11 +6017,10 @@ endfunc
func Test_vimgrep_noswapfile()
set noswapfile
call writefile(['one', 'two', 'three'], 'Xgreppie')
call writefile(['one', 'two', 'three'], 'Xgreppie', 'D')
vimgrep two Xgreppie
call assert_equal('two', getline('.'))
call delete('Xgreppie')
set swapfile
endfunc
@@ -6122,12 +6062,10 @@ func Xvimgrep_fuzzy_match(cchar)
endfunc
func Test_vimgrep_fuzzy_match()
call writefile(['one two three', 'aaaaaa'], 'Xfile1')
call writefile(['one', 'three one two', 'two', 'aaathreeaaa'], 'Xfile2')
call writefile(['one two three', 'aaaaaa'], 'Xfile1', 'D')
call writefile(['one', 'three one two', 'two', 'aaathreeaaa'], 'Xfile2', 'D')
call Xvimgrep_fuzzy_match('c')
call Xvimgrep_fuzzy_match('l')
call delete('Xfile1')
call delete('Xfile2')
endfunc
func Test_locationlist_open_in_newtab()
@@ -6265,12 +6203,11 @@ func Test_lopen_bwipe_all()
call writefile(['done'], 'Xresult')
qall!
END
call writefile(lines, 'Xscript')
call writefile(lines, 'Xscript', 'D')
if RunVim([], [], '-u NONE -n -X -Z -e -m -s -S Xscript')
call assert_equal(['done'], readfile('Xresult'))
endif
call delete('Xscript')
call delete('Xresult')
endfunc
+10 -21
View File
@@ -140,9 +140,9 @@ func Test_recover_multiple_swap_files()
call setline(1, ['a', 'b', 'c'])
preserve
let b = readblob(swapname(''))
call writefile(b, '.Xfile1.swm')
call writefile(b, '.Xfile1.swn')
call writefile(b, '.Xfile1.swo')
call writefile(b, '.Xfile1.swm', 'D')
call writefile(b, '.Xfile1.swn', 'D')
call writefile(b, '.Xfile1.swo', 'D')
%bw!
call feedkeys(":recover Xfile1\<CR>3\<CR>q", 'xt')
call assert_equal(['a', 'b', 'c'], getline(1, '$'))
@@ -156,16 +156,12 @@ func Test_recover_multiple_swap_files()
call assert_equal('Xfile1', @%)
call assert_equal([''], getline(1, '$'))
bw!
call delete('.Xfile1.swm')
call delete('.Xfile1.swn')
call delete('.Xfile1.swo')
endfunc
" Test for :recover using an empty swap file
func Test_recover_empty_swap_file()
CheckUnix
call writefile([], '.Xfile1.swp')
call writefile([], '.Xfile1.swp', 'D')
let msg = execute('recover Xfile1')
call assert_match('Unable to read block 0 from .Xfile1.swp', msg)
call assert_equal('Xfile1', @%)
@@ -178,7 +174,6 @@ func Test_recover_empty_swap_file()
" :recover from an empty buffer
call assert_fails('recover', 'E305:')
call delete('.Xfile1.swp')
endfunc
" Test for :recover using a corrupted swap file
@@ -366,11 +361,10 @@ func Test_recover_unreadable_swap_file()
CheckNotRoot
new Xfile1
let b = readblob('.Xfile1.swp')
call writefile(b, '.Xfile1.swm')
call writefile(b, '.Xfile1.swm', 'D')
bw!
call setfperm('.Xfile1.swm', '-w-------')
call assert_fails('recover Xfile1', 'E306:')
call delete('.Xfile1.swm')
endfunc
" Test for using :recover when the original file and the swap file have the
@@ -382,20 +376,19 @@ func Test_recover_unmodified_file()
preserve
let b = readblob('.Xfile1.swp')
%bw!
call writefile(b, '.Xfile1.swz')
call writefile(b, '.Xfile1.swz', 'D')
let msg = execute('recover Xfile1')
call assert_equal(['aaa', 'bbb', 'ccc'], getline(1, '$'))
call assert_false(&modified)
call assert_match('Buffer contents equals file contents', msg)
bw!
call delete('Xfile1')
call delete('.Xfile1.swz')
endfunc
" Test for recovering a file when editing a symbolically linked file
func Test_recover_symbolic_link()
CheckUnix
call writefile(['aaa', 'bbb', 'ccc'], 'Xfile1')
call writefile(['aaa', 'bbb', 'ccc'], 'Xfile1', 'D')
silent !ln -s Xfile1 Xfile2
edit Xfile2
call assert_equal('.Xfile1.swp', fnamemodify(swapname(''), ':t'))
@@ -410,7 +403,6 @@ func Test_recover_symbolic_link()
update
%bw!
call assert_equal(['aaa', 'bbb', 'ccc'], readfile('Xfile1'))
call delete('Xfile1')
call delete('Xfile2')
call delete('.Xfile1.swp')
endfunc
@@ -419,7 +411,7 @@ endfunc
" line. This used to result in an internal error (E315) which is fixed
" by 8.2.2966.
func Test_recover_invalid_cursor_pos()
call writefile([], 'Xfile1')
call writefile([], 'Xfile1', 'D')
edit Xfile1
preserve
let b = readblob('.Xfile1.swp')
@@ -429,7 +421,7 @@ func Test_recover_invalid_cursor_pos()
au BufReadPost Xfile1 normal! 3G
augroup END
call writefile(range(1, 3), 'Xfile1')
call writefile(b, '.Xfile1.swp')
call writefile(b, '.Xfile1.swp', 'D')
try
recover Xfile1
catch /E308:/
@@ -441,8 +433,6 @@ func Test_recover_invalid_cursor_pos()
au!
augroup END
augroup! Test
call delete('Xfile1')
call delete('.Xfile1.swp')
endfunc
" Test for recovering a buffer without a name
@@ -453,10 +443,9 @@ func Test_noname_buffer()
let sn = swapname('')
let b = readblob(sn)
bw!
call writefile(b, sn)
call writefile(b, sn, 'D')
exe "recover " .. sn
call assert_equal(['one', 'two'], getline(1, '$'))
call delete(sn)
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+2 -5
View File
@@ -555,20 +555,17 @@ func Test_match_char_class_upper()
endfunc
func Test_match_invalid_byte()
call writefile(0z630a.765d30aa0a.2e0a.790a.4030, 'Xinvalid')
call writefile(0z630a.765d30aa0a.2e0a.790a.4030, 'Xinvalid', 'D')
new
source Xinvalid
bwipe!
call delete('Xinvalid')
endfunc
func Test_match_illegal_byte()
" Text has illegal bytes which need to be set explicitly
let lines = ["norm :set no\x01\<CR>", "silent n\xff", "silent norm :b\xff\<CR>"]
call writefile(lines, 'Xregexp')
call writefile(lines, 'Xregexp', 'D')
call system(GetVimCommand() .. ' -X -Z -e -s -S Xregexp -c qa!')
call delete('Xregexp')
endfunc
func Test_match_too_complicated()
+5 -14
View File
@@ -12,7 +12,7 @@ func Test_rename_file_to_file()
" When the destination file already exists, it should be overwritten.
call writefile(['foo'], 'Xrename1')
call writefile(['bar'], 'Xrename2')
call writefile(['bar'], 'Xrename2', 'D')
call assert_equal(0, rename('Xrename1', 'Xrename2'))
call assert_equal('', glob('Xrename1'))
@@ -36,7 +36,7 @@ func Test_rename_file_ignore_case()
endfunc
func Test_rename_same_file()
call writefile(['foo'], 'Xrename')
call writefile(['foo'], 'Xrename', 'D')
" When the source and destination are the same file, nothing
" should be done. The source file should not be deleted.
@@ -45,8 +45,6 @@ func Test_rename_same_file()
call assert_equal(0, rename('./Xrename', 'Xrename'))
call assert_equal(['foo'], readfile('Xrename'))
call delete('Xrename')
endfunc
func Test_rename_dir_to_dir()
@@ -63,21 +61,18 @@ func Test_rename_dir_to_dir()
endfunc
func Test_rename_same_dir()
call mkdir('Xrenamedir')
call mkdir('Xrenamedir', 'R')
call writefile(['foo'], 'Xrenamedir/Xrenamefile')
call assert_equal(0, rename('Xrenamedir', 'Xrenamedir'))
call assert_equal(['foo'], readfile('Xrenamedir/Xrenamefile'))
call delete('Xrenamedir/Xrenamefile')
call delete('Xrenamedir', 'd')
endfunc
func Test_rename_copy()
" Check that when original file can't be deleted, rename()
" still succeeds but copies the file.
call mkdir('Xrenamedir')
call mkdir('Xrenamedir', 'R')
call writefile(['foo'], 'Xrenamedir/Xrenamefile')
call setfperm('Xrenamedir', 'r-xr-xr-x')
@@ -91,13 +86,11 @@ func Test_rename_copy()
call assert_equal(['foo'], readfile('Xrenamefile'))
call setfperm('Xrenamedir', 'rwxrwxrwx')
call delete('Xrenamedir/Xrenamefile')
call delete('Xrenamedir', 'd')
call delete('Xrenamefile')
endfunc
func Test_rename_fails()
call writefile(['foo'], 'Xrenamefile')
call writefile(['foo'], 'Xrenamefile', 'D')
" Can't rename into a non-existing directory.
call assert_notequal(0, rename('Xrenamefile', 'Xdoesnotexist/Xrenamefile'))
@@ -115,8 +108,6 @@ func Test_rename_fails()
call assert_fails('call rename("Xrenamefile", [])', 'E730:')
call assert_fails('call rename(0z, "Xrenamefile")', 'E976:')
call delete('Xrenamefile')
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+1 -2
View File
@@ -101,7 +101,7 @@ func Test_restricted_mode()
call writefile(v:errors, 'Xresult')
qa!
END
call writefile(lines, 'Xrestricted')
call writefile(lines, 'Xrestricted', 'D')
if RunVim([], [], '-Z --clean -S Xrestricted')
call assert_equal([], readfile('Xresult'))
endif
@@ -114,7 +114,6 @@ func Test_restricted_mode()
call assert_equal([], readfile('Xresult'))
endif
call delete('Xrestricted')
call delete('Xresult')
endfunc
+56
View File
@@ -141,6 +141,62 @@ func Test_smoothscroll_number()
call StopVimInTerminal(buf)
endfunc
func Test_smoothscroll_diff_mode()
CheckScreendump
let lines =<< trim END
vim9script
var text = 'just some text here'
setline(1, text)
set smoothscroll
diffthis
new
setline(1, text)
set smoothscroll
diffthis
END
call writefile(lines, 'XSmoothDiff', 'D')
let buf = RunVimInTerminal('-S XSmoothDiff', #{rows: 8})
call VerifyScreenDump(buf, 'Test_smooth_diff_1', {})
call term_sendkeys(buf, "\<C-Y>")
call VerifyScreenDump(buf, 'Test_smooth_diff_1', {})
call term_sendkeys(buf, "\<C-E>")
call VerifyScreenDump(buf, 'Test_smooth_diff_1', {})
call StopVimInTerminal(buf)
endfunc
func Test_smoothscroll_wrap_scrolloff_zero()
CheckScreendump
let lines =<< trim END
vim9script
setline(1, ['Line' .. (' with some text'->repeat(7))]->repeat(7))
set smoothscroll scrolloff=0
:3
END
call writefile(lines, 'XSmoothWrap', 'D')
let buf = RunVimInTerminal('-S XSmoothWrap', #{rows: 8, cols: 40})
call VerifyScreenDump(buf, 'Test_smooth_wrap_1', {})
" moving cursor down - whole bottom line shows
call term_sendkeys(buf, "j")
call VerifyScreenDump(buf, 'Test_smooth_wrap_2', {})
call term_sendkeys(buf, "\<C-E>j")
call VerifyScreenDump(buf, 'Test_smooth_wrap_3', {})
call term_sendkeys(buf, "G")
call VerifyScreenDump(buf, 'Test_smooth_wrap_4', {})
" moving cursor up - whole top line shows
call term_sendkeys(buf, "2k")
call VerifyScreenDump(buf, 'Test_smooth_wrap_5', {})
call StopVimInTerminal(buf)
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+26 -4
View File
@@ -956,13 +956,12 @@ func Test_spell_screendump()
\ ])
set spell spelllang=en_nz
END
call writefile(lines, 'XtestSpell')
call writefile(lines, 'XtestSpell', 'D')
let buf = RunVimInTerminal('-S XtestSpell', {'rows': 8})
call VerifyScreenDump(buf, 'Test_spell_1', {})
" clean up
call StopVimInTerminal(buf)
call delete('XtestSpell')
endfunc
func Test_spell_screendump_spellcap()
@@ -979,7 +978,7 @@ func Test_spell_screendump_spellcap()
\ ])
set spell spelllang=en
END
call writefile(lines, 'XtestSpellCap')
call writefile(lines, 'XtestSpellCap', 'D')
let buf = RunVimInTerminal('-S XtestSpellCap', {'rows': 8})
call VerifyScreenDump(buf, 'Test_spell_2', {})
@@ -997,7 +996,30 @@ func Test_spell_screendump_spellcap()
" clean up
call StopVimInTerminal(buf)
call delete('XtestSpellCap')
endfunc
func Test_spell_compatible()
CheckScreendump
let lines =<< trim END
call setline(1, [
\ "test "->repeat(20),
\ "",
\ "end",
\ ])
set spell cpo+=$
END
call writefile(lines, 'XtestSpellComp', 'D')
let buf = RunVimInTerminal('-S XtestSpellComp', {'rows': 8})
call term_sendkeys(buf, "51|C")
call VerifyScreenDump(buf, 'Test_spell_compatible_1', {})
call term_sendkeys(buf, "x")
call VerifyScreenDump(buf, 'Test_spell_compatible_2', {})
" clean up
call StopVimInTerminal(buf)
endfunc
let g:test_data_aff1 = [
-2
View File
@@ -617,8 +617,6 @@ endfunc
" Test for closing the tab page from a command window
func Test_tabpage_close_cmdwin()
CheckFeature cmdwin
tabnew
call feedkeys("q/:tabclose\<CR>\<Esc>", 'xt')
call assert_equal(2, tabpagenr('$'))
-2
View File
@@ -367,8 +367,6 @@ endfunc
" Test for using the mouse to increase the height of the cmdline window
func Test_mouse_cmdwin_resize()
CheckFeature cmdwin
let save_mouse = &mouse
let save_term = &term
let save_ttymouse = &ttymouse

Some files were not shown because too many files have changed in this diff Show More