diff --git a/.appveyor.yml b/.appveyor.yml index c98bd5e7cd..18259abea7 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -7,7 +7,6 @@ environment: - FEATURE: HUGE # disabled # - FEATURE: TINY -# - FEATURE: SMALL # - FEATURE: NORMAL # - FEATURE: BIG diff --git a/.cirrus.yml b/.cirrus.yml index a1f055b800..4cb700c7b6 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -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 diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index a9d3b36422..8b37870102 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -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?* diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index db83f589ac..d17d52abe2 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -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) diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index 4e2caf3d4a..e794c0e1c4 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -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| diff --git a/runtime/synmenu.vim b/runtime/synmenu.vim index dd191d8299..947b16cdca 100644 --- a/runtime/synmenu.vim +++ b/runtime/synmenu.vim @@ -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") diff --git a/runtime/tools/unicode.vim b/runtime/tools/unicode.vim index aa260e6ea5..630a581996 100644 --- a/runtime/tools/unicode.vim +++ b/runtime/tools/unicode.vim @@ -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. diff --git a/src/INSTALLvms.txt b/src/INSTALLvms.txt index e336da4cbe..de1446b2cb 100644 --- a/src/INSTALLvms.txt +++ b/src/INSTALLvms.txt @@ -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) diff --git a/src/Make_ami.mak b/src/Make_ami.mak index 77ec32cfcb..a889ebd46f 100644 --- a/src/Make_ami.mak +++ b/src/Make_ami.mak @@ -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 diff --git a/src/Make_cyg_ming.mak b/src/Make_cyg_ming.mak index 55d13b105c..dfc540375b 100644 --- a/src/Make_cyg_ming.mak +++ b/src/Make_cyg_ming.mak @@ -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. diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak index 9529d0aac8..be08c6fd5e 100644 --- a/src/Make_mvc.mak +++ b/src/Make_mvc.mak @@ -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) diff --git a/src/Make_vms.mms b/src/Make_vms.mms index f1689bef3c..4e945e534a 100644 --- a/src/Make_vms.mms +++ b/src/Make_vms.mms @@ -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. diff --git a/src/Makefile b/src/Makefile index bebc9e2cce..c4a13c926d 100644 --- a/src/Makefile +++ b/src/Makefile @@ -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 diff --git a/src/arglist.c b/src/arglist.c index 06398e2070..4c64d2ab54 100644 --- a/src/arglist.c +++ b/src/arglist.c @@ -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" diff --git a/src/auto/configure b/src/auto/configure index 5b10eb9c4d..885f67018c 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -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 diff --git a/src/change.c b/src/change.c index 1cbb83650b..a00808faad 100644 --- a/src/change.c +++ b/src/change.c @@ -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 diff --git a/src/config.h.in b/src/config.h.in index 875d9afd54..89e6f2380c 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -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 diff --git a/src/configure.ac b/src/configure.ac index 6c3ec0a336..ca1c0f389a 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -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) diff --git a/src/drawline.c b/src/drawline.c index a253349dc1..171cf5fec9 100644 --- a/src/drawline.c +++ b/src/drawline.c @@ -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); diff --git a/src/drawscreen.c b/src/drawscreen.c index 5e15c14811..8b8390c3f5 100644 --- a/src/drawscreen.c +++ b/src/drawscreen.c @@ -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; } } diff --git a/src/edit.c b/src/edit.c index f0c9306687..4f9e388a86 100644 --- a/src/edit.c +++ b/src/edit.c @@ -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) diff --git a/src/errors.h b/src/errors.h index f4880d502a..cce403dd5a 100644 --- a/src/errors.h +++ b/src/errors.h @@ -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 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")); diff --git a/src/evalfunc.c b/src/evalfunc.c index a7afe4d9b6..9ba7d2af67 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -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 diff --git a/src/evalwindow.c b/src/evalwindow.c index 7a019627fb..3d3301f65c 100644 --- a/src/evalwindow.c +++ b/src/evalwindow.c @@ -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 } /* diff --git a/src/ex_cmds.c b/src/ex_cmds.c index a5eae8d166..3c13b8de29 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -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 diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 3293b5c723..99d4c0696b 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -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()) { diff --git a/src/ex_getln.c b/src/ex_getln.c index cd34e9702f..c2177468d8 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -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: diff --git a/src/feature.h b/src/feature.h index b5f7c2ce28..91179dada0 100644 --- a/src/feature.h +++ b/src/feature.h @@ -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 diff --git a/src/getchar.c b/src/getchar.c index 45acdaa1b2..cb69842a3b 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -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; diff --git a/src/globals.h b/src/globals.h index 4ae919e3a1..065d4444f5 100644 --- a/src/globals.h +++ b/src/globals.h @@ -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(). diff --git a/src/gui.c b/src/gui.c index 2331c15ecf..0325ef053d 100644 --- a/src/gui.c +++ b/src/gui.c @@ -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) { diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c index 736d1c7a27..58b793109e 100644 --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -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); diff --git a/src/gui_motif.c b/src/gui_motif.c index 4c5ced5415..55c026eb48 100644 --- a/src/gui_motif.c +++ b/src/gui_motif.c @@ -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) diff --git a/src/gui_w32.c b/src/gui_w32.c index 3ade63113b..5e8fbe2a80 100644 --- a/src/gui_w32.c +++ b/src/gui_w32.c @@ -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(); diff --git a/src/if_mzsch.c b/src/if_mzsch.c index 8788fb3034..0363b8fbf7 100644 --- a/src/if_mzsch.c +++ b/src/if_mzsch.c @@ -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. */ diff --git a/src/insexpand.c b/src/insexpand.c index 1803fbab28..e3c881598d 100644 --- a/src/insexpand.c +++ b/src/insexpand.c @@ -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(); diff --git a/src/main.c b/src/main.c index 9cdb851239..acec9ad589 100644 --- a/src/main.c +++ b/src/main.c @@ -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. diff --git a/src/map.c b/src/map.c index ffb513e966..9a5b32b33b 100644 --- a/src/map.c +++ b/src/map.c @@ -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) /* diff --git a/src/mbyte.c b/src/mbyte.c index 226e21f080..537c47bbe4 100644 --- a/src/mbyte.c +++ b/src/mbyte.c @@ -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}, diff --git a/src/mouse.c b/src/mouse.c index 83ce1d2093..a6fc253ed0 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -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 diff --git a/src/move.c b/src/move.c index 39b7089b27..139ee177ca 100644 --- a/src/move.c +++ b/src/move.c @@ -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 diff --git a/src/normal.c b/src/normal.c index a29b291143..405b4948b3 100644 --- a/src/normal.c +++ b/src/normal.c @@ -4040,12 +4040,10 @@ nv_down(cmdarg_T *cap) #endif else { -#ifdef FEAT_CMDWIN // In the cmdline window a executes the command. if (cmdwin_type != 0 && cap->cmdchar == CAR) cmdwin_result = CAR; else -#endif #ifdef FEAT_JOB_CHANNEL // In a prompt buffer a 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) diff --git a/src/option.c b/src/option.c index 463688784b..ec38c1c9eb 100644 --- a/src/option.c +++ b/src/option.c @@ -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; diff --git a/src/option.h b/src/option.h index 0b3ed6b2fb..76d50821e7 100644 --- a/src/option.h +++ b/src/option.h @@ -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 diff --git a/src/optiondefs.h b/src/optiondefs.h index 467fc64044..d3c9441aa7 100644 --- a/src/optiondefs.h +++ b/src/optiondefs.h @@ -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, diff --git a/src/optionstr.c b/src/optionstr.c index 0d0ce0ed05..636f95cb05 100644 --- a/src/optionstr.c +++ b/src/optionstr.c @@ -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) diff --git a/src/os_unix.c b/src/os_unix.c index dc090cc1c8..928eb2493e 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -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. diff --git a/src/os_win32.c b/src/os_win32.c index 644e647521..2a9d1cf57f 100644 --- a/src/os_win32.c +++ b/src/os_win32.c @@ -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 diff --git a/src/proto/term.pro b/src/proto/term.pro index 13a093c882..7ce14b921a 100644 --- a/src/proto/term.pro +++ b/src/proto/term.pro @@ -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 : */ diff --git a/src/screen.c b/src/screen.c index 1a97ad67ae..688da3082a 100644 --- a/src/screen.c +++ b/src/screen.c @@ -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; diff --git a/src/structs.h b/src/structs.h index 75f3a14900..f5726345dc 100644 --- a/src/structs.h +++ b/src/structs.h @@ -3531,6 +3531,7 @@ typedef struct int foldsep; int diff; int eob; + int lastline; } fill_chars_T; /* diff --git a/src/term.c b/src/term.c index 5d8ee3e954..085e8b26ce 100644 --- a/src/term.c +++ b/src/term.c @@ -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 and K_DEL by . + * 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 diff --git a/src/terminal.c b/src/terminal.c index b4f5e69a26..84007f9a4c 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -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) diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak index b4182de8fa..893a9b564c 100644 --- a/src/testdir/Make_all.mak +++ b/src/testdir/Make_all.mak @@ -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 \ diff --git a/src/testdir/dumps/Test_changing_cmdheight_6.dump b/src/testdir/dumps/Test_changing_cmdheight_6.dump new file mode 100644 index 0000000000..fb2a5215ac --- /dev/null +++ b/src/testdir/dumps/Test_changing_cmdheight_6.dump @@ -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 diff --git a/src/testdir/dumps/Test_cmdheight_tabline_1.dump b/src/testdir/dumps/Test_cmdheight_tabline_1.dump new file mode 100644 index 0000000000..7260309e7f --- /dev/null +++ b/src/testdir/dumps/Test_cmdheight_tabline_1.dump @@ -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 diff --git a/src/testdir/dumps/Test_conceal_linebreak_1.dump b/src/testdir/dumps/Test_conceal_linebreak_1.dump new file mode 100644 index 0000000000..8c93df07d1 --- /dev/null +++ b/src/testdir/dumps/Test_conceal_linebreak_1.dump @@ -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| diff --git a/src/testdir/dumps/Test_display_lastline_1.dump b/src/testdir/dumps/Test_display_lastline_1.dump index b0e34ead43..d074773b8f 100644 --- a/src/testdir/dumps/Test_display_lastline_1.dump +++ b/src/testdir/dumps/Test_display_lastline_1.dump @@ -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 diff --git a/src/testdir/dumps/Test_display_lastline_2.dump b/src/testdir/dumps/Test_display_lastline_2.dump index 2bd3309474..065e5d8588 100644 --- a/src/testdir/dumps/Test_display_lastline_2.dump +++ b/src/testdir/dumps/Test_display_lastline_2.dump @@ -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 diff --git a/src/testdir/dumps/Test_display_lastline_3.dump b/src/testdir/dumps/Test_display_lastline_3.dump index a0b6e09ba7..38673ab564 100644 --- a/src/testdir/dumps/Test_display_lastline_3.dump +++ b/src/testdir/dumps/Test_display_lastline_3.dump @@ -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&& diff --git a/src/testdir/dumps/Test_display_lastline_4.dump b/src/testdir/dumps/Test_display_lastline_4.dump index e34e7c7661..29786319cb 100644 --- a/src/testdir/dumps/Test_display_lastline_4.dump +++ b/src/testdir/dumps/Test_display_lastline_4.dump @@ -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&& diff --git a/src/testdir/dumps/Test_display_lastline_5.dump b/src/testdir/dumps/Test_display_lastline_5.dump new file mode 100644 index 0000000000..7567da1077 --- /dev/null +++ b/src/testdir/dumps/Test_display_lastline_5.dump @@ -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 diff --git a/src/testdir/dumps/Test_display_lastline_6.dump b/src/testdir/dumps/Test_display_lastline_6.dump new file mode 100644 index 0000000000..e5ede7f67c --- /dev/null +++ b/src/testdir/dumps/Test_display_lastline_6.dump @@ -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 diff --git a/src/testdir/dumps/Test_display_lastline_euro_1.dump b/src/testdir/dumps/Test_display_lastline_euro_1.dump new file mode 100644 index 0000000000..2223d876bd --- /dev/null +++ b/src/testdir/dumps/Test_display_lastline_euro_1.dump @@ -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 diff --git a/src/testdir/dumps/Test_display_lastline_euro_2.dump b/src/testdir/dumps/Test_display_lastline_euro_2.dump new file mode 100644 index 0000000000..e8da202705 --- /dev/null +++ b/src/testdir/dumps/Test_display_lastline_euro_2.dump @@ -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 diff --git a/src/testdir/dumps/Test_display_lastline_euro_3.dump b/src/testdir/dumps/Test_display_lastline_euro_3.dump new file mode 100644 index 0000000000..db414e75e4 --- /dev/null +++ b/src/testdir/dumps/Test_display_lastline_euro_3.dump @@ -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 diff --git a/src/testdir/dumps/Test_display_lastline_euro_4.dump b/src/testdir/dumps/Test_display_lastline_euro_4.dump new file mode 100644 index 0000000000..492438cfce --- /dev/null +++ b/src/testdir/dumps/Test_display_lastline_euro_4.dump @@ -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 diff --git a/src/testdir/dumps/Test_display_lastline_euro_5.dump b/src/testdir/dumps/Test_display_lastline_euro_5.dump new file mode 100644 index 0000000000..75fc73250d --- /dev/null +++ b/src/testdir/dumps/Test_display_lastline_euro_5.dump @@ -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 diff --git a/src/testdir/dumps/Test_display_lastline_euro_6.dump b/src/testdir/dumps/Test_display_lastline_euro_6.dump new file mode 100644 index 0000000000..80e2cbb0f4 --- /dev/null +++ b/src/testdir/dumps/Test_display_lastline_euro_6.dump @@ -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 diff --git a/src/testdir/dumps/Test_incsearch_substitute_12.dump b/src/testdir/dumps/Test_incsearch_substitute_12.dump index 80c4e152f1..3170e54df6 100644 --- a/src/testdir/dumps/Test_incsearch_substitute_12.dump +++ b/src/testdir/dumps/Test_incsearch_substitute_12.dump @@ -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 diff --git a/src/testdir/dumps/Test_smooth_diff_1.dump b/src/testdir/dumps/Test_smooth_diff_1.dump new file mode 100644 index 0000000000..4e2696e841 --- /dev/null +++ b/src/testdir/dumps/Test_smooth_diff_1.dump @@ -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 diff --git a/src/testdir/dumps/Test_smooth_wrap_1.dump b/src/testdir/dumps/Test_smooth_wrap_1.dump new file mode 100644 index 0000000000..0b52d40e5a --- /dev/null +++ b/src/testdir/dumps/Test_smooth_wrap_1.dump @@ -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| diff --git a/src/testdir/dumps/Test_smooth_wrap_2.dump b/src/testdir/dumps/Test_smooth_wrap_2.dump new file mode 100644 index 0000000000..65a357dbb1 --- /dev/null +++ b/src/testdir/dumps/Test_smooth_wrap_2.dump @@ -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|%| diff --git a/src/testdir/dumps/Test_smooth_wrap_3.dump b/src/testdir/dumps/Test_smooth_wrap_3.dump new file mode 100644 index 0000000000..4bf5130fca --- /dev/null +++ b/src/testdir/dumps/Test_smooth_wrap_3.dump @@ -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|%| diff --git a/src/testdir/dumps/Test_smooth_wrap_4.dump b/src/testdir/dumps/Test_smooth_wrap_4.dump new file mode 100644 index 0000000000..c23f494dcd --- /dev/null +++ b/src/testdir/dumps/Test_smooth_wrap_4.dump @@ -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| diff --git a/src/testdir/dumps/Test_smooth_wrap_5.dump b/src/testdir/dumps/Test_smooth_wrap_5.dump new file mode 100644 index 0000000000..04a17f9aea --- /dev/null +++ b/src/testdir/dumps/Test_smooth_wrap_5.dump @@ -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|%| diff --git a/src/testdir/dumps/Test_spell_compatible_1.dump b/src/testdir/dumps/Test_spell_compatible_1.dump new file mode 100644 index 0000000000..4f6b26815f --- /dev/null +++ b/src/testdir/dumps/Test_spell_compatible_1.dump @@ -0,0 +1,8 @@ +|t+0fd7ff255|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+0fd7ff255|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| diff --git a/src/testdir/dumps/Test_spell_compatible_2.dump b/src/testdir/dumps/Test_spell_compatible_2.dump new file mode 100644 index 0000000000..e1243a6c6b --- /dev/null +++ b/src/testdir/dumps/Test_spell_compatible_2.dump @@ -0,0 +1,8 @@ +|t+0fd7ff255|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+0fd7ff255|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| diff --git a/src/testdir/script_util.vim b/src/testdir/script_util.vim index 9913b1dfaf..28d6a621d6 100644 --- a/src/testdir/script_util.vim +++ b/src/testdir/script_util.vim @@ -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 = '' diff --git a/src/testdir/test_arglist.vim b/src/testdir/test_arglist.vim index 298514ef09..1bc556fa91 100644 --- a/src/testdir/test_arglist.vim +++ b/src/testdir/test_arglist.vim @@ -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 diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim index caf2b40007..a9f3535d72 100644 --- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -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:\\", '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:\\", '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 diff --git a/src/testdir/test_breakindent.vim b/src/testdir/test_breakindent.vim index 3b606076a6..ad6516fb61 100644 --- a/src/testdir/test_breakindent.vim +++ b/src/testdir/test_breakindent.vim @@ -660,7 +660,7 @@ func Test_breakindent19_sbr_nextpage() norm! 5gj let lines = s:screen_lines(1, 20) let expect = [ - \ "<<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 = [ - \ "<<") call VerifyScreenDump(buf, 'Test_changing_cmdheight_5', {}) + " setting 'cmdheight' works after outputting two messages + call term_sendkeys(buf, ":call EchoTwo()\") + 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 diff --git a/src/testdir/test_cmdwin.vim b/src/testdir/test_cmdwin.vim index dc6889495f..ad05f3e044 100644 --- a/src/testdir/test_cmdwin.vim +++ b/src/testdir/test_cmdwin.vim @@ -1,8 +1,6 @@ " Tests for editing the command line. source check.vim -CheckFeature cmdwin - source screendump.vim func Test_getcmdwintype() diff --git a/src/testdir/test_conceal.vim b/src/testdir/test_conceal.vim index c0a46dc6b7..385d42b544 100644 --- a/src/testdir/test_conceal.vim +++ b/src/testdir/test_conceal.vim @@ -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. diff --git a/src/testdir/test_cursorline.vim b/src/testdir/test_cursorline.vim index 2285ba6717..f4c58dec11 100644 --- a/src/testdir/test_cursorline.vim +++ b/src/testdir/test_cursorline.vim @@ -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() diff --git a/src/testdir/test_display.vim b/src/testdir/test_display.vim index 7237ed8a2f..faed0b58ef 100644 --- a/src/testdir/test_display.vim +++ b/src/testdir/test_display.vim @@ -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\") - call VerifyScreenDump(buf, 'Test_display_lastline_2', {}) + call VerifyScreenDump(buf, $'Test_display_lastline_{a:euro}2', {}) call term_sendkeys(buf, ":100wincmd >\") - call VerifyScreenDump(buf, 'Test_display_lastline_3', {}) + call VerifyScreenDump(buf, $'Test_display_lastline_{a:euro}3', {}) call term_sendkeys(buf, ":set display=truncate\") - call VerifyScreenDump(buf, 'Test_display_lastline_4', {}) + call VerifyScreenDump(buf, $'Test_display_lastline_{a:euro}4', {}) + + call term_sendkeys(buf, ":close\") + call term_sendkeys(buf, ":3split\") + call VerifyScreenDump(buf, $'Test_display_lastline_{a:euro}5', {}) + + call term_sendkeys(buf, ":close\") + call term_sendkeys(buf, ":2vsplit\") + 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 diff --git a/src/testdir/test_gui.vim b/src/testdir/test_gui.vim index 8702e3ef72..72e8f65f35 100644 --- a/src/testdir/test_gui.vim +++ b/src/testdir/test_gui.vim @@ -1744,4 +1744,23 @@ func Test_gui_lowlevel_keyevent() bw! endfunc +func Test_gui_macro_csi() + " Test for issue #11270 + nnoremap let g:triggered = 1 + let @q = "\x9b\xfc\x04L" + norm @q + call assert_equal(1, g:triggered) + unlet g:triggered + nunmap + + " Test for issue #11057 + inoremap 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 t +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/testdir/test_listlbr_utf8.vim b/src/testdir/test_listlbr_utf8.vim index 83d6ed0c7f..ec54209180 100644 --- a/src/testdir/test_listlbr_utf8.vim +++ b/src/testdir/test_listlbr_utf8.vim @@ -167,7 +167,7 @@ func Test_visual_block_and_selection_exclusive() exe "norm! $3B\eAx\" let lines = s:screen_lines([1, 10], winwidth(0)) let expect = [ -\ "<<") 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 diff --git a/src/testdir/test_recover.vim b/src/testdir/test_recover.vim index 362ddb0eea..cb34c64dd2 100644 --- a/src/testdir/test_recover.vim +++ b/src/testdir/test_recover.vim @@ -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\3\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 diff --git a/src/testdir/test_regexp_utf8.vim b/src/testdir/test_regexp_utf8.vim index d665a6f0be..fdee80f0d7 100644 --- a/src/testdir/test_regexp_utf8.vim +++ b/src/testdir/test_regexp_utf8.vim @@ -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\", "silent n\xff", "silent norm :b\xff\"] - 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() diff --git a/src/testdir/test_rename.vim b/src/testdir/test_rename.vim index 53fa3ff232..26efe5c487 100644 --- a/src/testdir/test_rename.vim +++ b/src/testdir/test_rename.vim @@ -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 diff --git a/src/testdir/test_restricted.vim b/src/testdir/test_restricted.vim index f743fbf3e4..d01406eb01 100644 --- a/src/testdir/test_restricted.vim +++ b/src/testdir/test_restricted.vim @@ -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 diff --git a/src/testdir/test_scroll_opt.vim b/src/testdir/test_scroll_opt.vim index 5dfc69762d..0292fa1f80 100644 --- a/src/testdir/test_scroll_opt.vim +++ b/src/testdir/test_scroll_opt.vim @@ -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, "\") + call VerifyScreenDump(buf, 'Test_smooth_diff_1', {}) + call term_sendkeys(buf, "\") + 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, "\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 diff --git a/src/testdir/test_spell.vim b/src/testdir/test_spell.vim index 97c7e3cc28..3f77695c23 100644 --- a/src/testdir/test_spell.vim +++ b/src/testdir/test_spell.vim @@ -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 = [ diff --git a/src/testdir/test_tabpage.vim b/src/testdir/test_tabpage.vim index fe97578b10..ef265edfb9 100644 --- a/src/testdir/test_tabpage.vim +++ b/src/testdir/test_tabpage.vim @@ -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\\", 'xt') call assert_equal(2, tabpagenr('$')) diff --git a/src/testdir/test_termcodes.vim b/src/testdir/test_termcodes.vim index 578c97018a..cb1d01a0b3 100644 --- a/src/testdir/test_termcodes.vim +++ b/src/testdir/test_termcodes.vim @@ -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 diff --git a/src/testdir/test_vimscript.vim b/src/testdir/test_vimscript.vim index 7698ce836d..6292f6d0d8 100644 --- a/src/testdir/test_vimscript.vim +++ b/src/testdir/test_vimscript.vim @@ -719,23 +719,23 @@ endfunc XpathINIT -function! NULL() +func NULL() Xpath 'a' return 0 -endfunction +endfunc -function! ZERO() +func ZERO() Xpath 'b' return 0 -endfunction +endfunc -function! F0() +func! F0() Xpath 'c' -endfunction +endfunc -function! F1(arg) +func! F1(arg) Xpath 'e' -endfunction +endfunc let V0 = 1 @@ -6822,10 +6822,10 @@ endfunc " Test 95: lines of :append, :change, :insert {{{1 "------------------------------------------------------------------------------- -function! DefineFunction(name, body) +func DefineFunction(name, body) let func = join(['function! ' . a:name . '()'] + a:body + ['endfunction'], "\n") exec func -endfunction +endfunc func Test_script_lines() " :append diff --git a/src/testdir/test_window_cmd.vim b/src/testdir/test_window_cmd.vim index 017fa67448..61daa8d5c2 100644 --- a/src/testdir/test_window_cmd.vim +++ b/src/testdir/test_window_cmd.vim @@ -20,8 +20,6 @@ func Test_window_cmd_ls0_with_split() endfunc func Test_window_cmd_cmdwin_with_vsp() - CheckFeature cmdwin - let efmt = 'Expected 0 but got %d (in ls=%d, %s window)' for v in range(0, 2) exec "set ls=" . v @@ -1809,6 +1807,13 @@ function Test_splitkeep_misc() let top = line('w0') help | quit call assert_equal(top, line('w0')) + " No error when resizing window in autocmd and buffer length changed + autocmd FileType qf exe "resize" line('$') + cexpr getline(1, '$') + copen + wincmd p + norm dd + cexpr getline(1, '$') %bwipeout! set splitbelow& diff --git a/src/testdir/view_util.vim b/src/testdir/view_util.vim index 1cdce21602..a4d0e56af9 100644 --- a/src/testdir/view_util.vim +++ b/src/testdir/view_util.vim @@ -19,7 +19,7 @@ endfunc " Get text on the screen, including composing characters. " ScreenLines(lnum, width) or " ScreenLines([start, end], width) -function! ScreenLines(lnum, width) abort +func ScreenLines(lnum, width) abort redraw! if type(a:lnum) == v:t_list let start = a:lnum[0] @@ -33,9 +33,9 @@ function! ScreenLines(lnum, width) abort let lines += [join(map(range(1, a:width), 'screenstring(l, v:val)'), '')] endfor return lines -endfunction +endfunc -function! ScreenAttrs(lnum, width) abort +func ScreenAttrs(lnum, width) abort redraw! if type(a:lnum) == v:t_list let start = a:lnum[0] @@ -49,16 +49,16 @@ function! ScreenAttrs(lnum, width) abort let attrs += [map(range(1, a:width), 'screenattr(l, v:val)')] endfor return attrs -endfunction +endfunc -function! NewWindow(height, width) abort +func NewWindow(height, width) abort exe a:height . 'new' exe a:width . 'vsp' set winfixwidth winfixheight redraw! -endfunction +endfunc -function! CloseWindow() abort +func CloseWindow() abort bw! redraw! -endfunction +endfunc diff --git a/src/textformat.c b/src/textformat.c index dfbeed70de..6a93890bd2 100644 --- a/src/textformat.c +++ b/src/textformat.c @@ -794,10 +794,8 @@ comp_textwidth( // The width is the window width minus 'wrapmargin' minus all the // things that add to the margin. textwidth = curwin->w_width - curbuf->b_p_wm; -#ifdef FEAT_CMDWIN if (cmdwin_type != 0) textwidth -= 1; -#endif #ifdef FEAT_FOLDING textwidth -= curwin->w_p_fdc; #endif diff --git a/src/version.c b/src/version.c index 85188e6dc4..52f7d1be91 100644 --- a/src/version.c +++ b/src/version.c @@ -714,6 +714,60 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 681, +/**/ + 680, +/**/ + 679, +/**/ + 678, +/**/ + 677, +/**/ + 676, +/**/ + 675, +/**/ + 674, +/**/ + 673, +/**/ + 672, +/**/ + 671, +/**/ + 670, +/**/ + 669, +/**/ + 668, +/**/ + 667, +/**/ + 666, +/**/ + 665, +/**/ + 664, +/**/ + 663, +/**/ + 662, +/**/ + 661, +/**/ + 660, +/**/ + 659, +/**/ + 658, +/**/ + 657, +/**/ + 656, +/**/ + 655, /**/ 654, /**/ @@ -2348,8 +2402,6 @@ list_version(void) msg_puts(_("\nBig version ")); #elif defined(FEAT_NORMAL) msg_puts(_("\nNormal version ")); -#elif defined(FEAT_SMALL) - msg_puts(_("\nSmall version ")); #else msg_puts(_("\nTiny version ")); #endif diff --git a/src/vim.h b/src/vim.h index 88ddd2e8a4..8e5e672fe9 100644 --- a/src/vim.h +++ b/src/vim.h @@ -160,14 +160,13 @@ /* * #defines for optionals and features - * Also defines FEAT_TINY, FEAT_SMALL, etc. when FEAT_HUGE is defined. + * Also defines FEAT_TINY, FEAT_NORMAL, etc. when FEAT_HUGE is defined. */ #include "feature.h" -#if defined(MACOS_X_DARWIN) -# if defined(FEAT_SMALL) && !defined(FEAT_CLIPBOARD) -# define FEAT_CLIPBOARD -# endif +#if defined(MACOS_X_DARWIN) && defined(FEAT_NORMAL) \ + && !defined(FEAT_CLIPBOARD) +# define FEAT_CLIPBOARD #endif // +x11 is only enabled when it's both available and wanted. diff --git a/src/window.c b/src/window.c index 75edb6c26c..ebaff9f957 100644 --- a/src/window.c +++ b/src/window.c @@ -119,12 +119,8 @@ log_frame_layout(frame_T *frame) win_T * prevwin_curwin(void) { - return -#ifdef FEAT_CMDWIN - // In cmdwin, the alternative buffer should be used. - is_in_cmdwin() && prevwin != NULL ? prevwin : -#endif - curwin; + // In cmdwin, the alternative buffer should be used. + return is_in_cmdwin() && prevwin != NULL ? prevwin : curwin; } /* @@ -149,8 +145,7 @@ do_window( if (ERROR_IF_ANY_POPUP_WINDOW) return; -#ifdef FEAT_CMDWIN -# define CHECK_CMDWIN \ +#define CHECK_CMDWIN \ do { \ if (cmdwin_type != 0) \ { \ @@ -158,9 +153,6 @@ do_window( return; \ } \ } while (0) -#else -# define CHECK_CMDWIN do { /**/ } while (0) -#endif Prenum1 = Prenum == 0 ? 1 : Prenum; @@ -2969,10 +2961,9 @@ win_free_all(void) { int dummy; -#ifdef FEAT_CMDWIN // avoid an error for switching tabpage with the cmdline window open cmdwin_type = 0; -#endif + while (first_tabpage->tp_next != NULL) tabpage_close(TRUE); @@ -4025,13 +4016,11 @@ win_new_tabpage(int after) tabpage_T *newtp; int n; -#ifdef FEAT_CMDWIN if (cmdwin_type != 0) { emsg(_(e_invalid_in_cmdline_window)); return FAIL; } -#endif newtp = alloc_tabpage(); if (newtp == NULL) @@ -4349,7 +4338,7 @@ enter_tabpage( // When cmdheight is changed in a tab page with '-', cmdline_row is // changed but p_ch and tp_ch_used are not changed. Thus we also need to // check cmdline_row. - if ((row < cmdline_row) && (cmdline_row <= Rows - p_ch)) + if (row < cmdline_row && cmdline_row <= Rows - p_ch) clear_cmdline = TRUE; // The tabpage line may have appeared or disappeared, may need to resize @@ -5519,7 +5508,6 @@ shell_new_columns(void) #endif } -#if defined(FEAT_CMDWIN) || defined(PROTO) /* * Save the size of all windows in "gap". */ @@ -5573,7 +5561,6 @@ win_size_restore(garray_T *gap) (void)win_comp_pos(); } } -#endif // FEAT_CMDWIN /* * Update the position for all windows, using the width and height of the @@ -6375,7 +6362,8 @@ win_fix_scroll(int resize) if (wp->w_height != wp->w_prev_height) { // If window has moved update botline to keep the same screenlines. - if (*p_spk == 's' && wp->w_winrow != wp->w_prev_winrow) + if (*p_spk == 's' && wp->w_winrow != wp->w_prev_winrow + && wp->w_botline - 1 <= wp->w_buffer->b_ml.ml_line_count) { lnum = wp->w_cursor.lnum; diff = (wp->w_winrow - wp->w_prev_winrow) @@ -6425,10 +6413,9 @@ win_fix_cursor(int normal) if (wp->w_buffer->b_ml.ml_line_count < wp->w_height) return; -#ifdef FEAT_CMDWIN if (skip_win_fix_cursor) return; -#endif + // Determine valid cursor range. so = MIN(wp->w_height / 2, so); wp->w_cursor.lnum = wp->w_topline; @@ -6674,7 +6661,7 @@ win_comp_scroll(win_T *wp) } /* - * command_height: called whenever p_ch has been changed + * Command_height: called whenever p_ch has been changed. */ void command_height(void) @@ -6693,6 +6680,9 @@ command_height(void) if (p_ch > old_p_ch && cmdline_row <= Rows - p_ch) return; + // Update cmdline_row to what it should be: just below the last window. + cmdline_row = topframe->fr_height + tabline_height(); + // If cmdline_row is smaller than what it is supposed to be for 'cmdheight' // then set old_p_ch to what it would be, so that the windows get resized // properly for the new value.