aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md4
-rw-r--r--appveyor.yml10
-rw-r--r--ci/build.ps122
-rw-r--r--runtime/doc/api.txt2
-rw-r--r--runtime/doc/autocmd.txt5
-rw-r--r--runtime/doc/change.txt8
-rw-r--r--runtime/doc/cmdline.txt3
-rw-r--r--runtime/doc/develop.txt2
-rw-r--r--runtime/doc/digraph.txt19
-rw-r--r--runtime/doc/editing.txt7
-rw-r--r--runtime/doc/eval.txt210
-rw-r--r--runtime/doc/insert.txt7
-rw-r--r--runtime/doc/message.txt7
-rw-r--r--runtime/doc/provider.txt12
-rw-r--r--runtime/doc/ui.txt10
-rw-r--r--runtime/doc/various.txt130
-rw-r--r--scripts/gen_help_html.py5
-rw-r--r--src/nvim/api/window.c4
-rw-r--r--src/nvim/auevents.lua3
-rw-r--r--src/nvim/buffer.c18
-rw-r--r--src/nvim/ex_cmds2.c10
-rw-r--r--src/nvim/getchar.c27
-rw-r--r--src/nvim/log.c21
-rw-r--r--src/nvim/map.c12
-rw-r--r--src/nvim/normal.c1
-rw-r--r--src/nvim/terminal.c14
-rw-r--r--src/nvim/testdir/test_arglist.vim12
-rw-r--r--src/nvim/testdir/test_command_count.vim1
-rw-r--r--src/nvim/testdir/test_quickfix.vim14
-rw-r--r--test/functional/api/vim_spec.lua9
-rw-r--r--test/functional/terminal/ex_terminal_spec.lua7
-rw-r--r--test/functional/ui/float_spec.lua60
32 files changed, 282 insertions, 394 deletions
diff --git a/README.md b/README.md
index de5b4c25fd..1bdf33d6bb 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-[![Neovim](https://raw.githubusercontent.com/neovim/neovim.github.io/master/logos/neovim-logo-600x173.png)](https://neovim.io)
+[![Neovim](https://raw.githubusercontent.com/neovim/neovim.github.io/master/logos/neovim-logo-300x87.png)](https://neovim.io)
[Wiki](https://github.com/neovim/neovim/wiki) |
[Documentation](https://neovim.io/doc) |
@@ -26,8 +26,6 @@ Neovim is a project that seeks to aggressively refactor Vim in order to:
See the [Introduction](https://github.com/neovim/neovim/wiki/Introduction) wiki page and [Roadmap]
for more information.
-[![Throughput Graph](https://graphs.waffle.io/neovim/neovim/throughput.svg)](https://waffle.io/neovim/neovim/metrics)
-
Features
--------
diff --git a/appveyor.yml b/appveyor.yml
index 23d3a2649a..e27b8e1b88 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,6 +1,8 @@
version: '{build}'
environment:
APPVEYOR_CACHE_ENTRY_ZIP_ARGS: "-t7z -m0=lzma -mx=9"
+ DEPS_BUILD_DIR: "C:/projects/nvim-deps"
+ DEPS_PREFIX: "C:/projects/nvim-deps/usr"
image: Visual Studio 2017
configuration:
- MSVC_64
@@ -15,6 +17,8 @@ init:
$env:APPVEYOR_CACHE_SKIP_SAVE = "true"
Exit-AppVeyorBuild
}
+# RDP
+#- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
matrix:
allow_failures:
- configuration: MINGW_64-gcov
@@ -24,11 +28,7 @@ before_build:
build_script:
- powershell ci\build.ps1
cache:
-- C:\msys64\var\cache\pacman\pkg -> ci\build.ps1
-- deps-MINGW -> ci\build.ps1
-- deps-MSVC -> ci\build.ps1
-- deps-MINGW -> third-party\**
-- deps-MSVC -> third-party\**
+- C:\projects\nvim-deps -> third-party\**
artifacts:
- path: build/Neovim.zip
- path: build/bin/nvim.exe
diff --git a/ci/build.ps1 b/ci/build.ps1
index cd470439f0..cbe300cc28 100644
--- a/ci/build.ps1
+++ b/ci/build.ps1
@@ -6,15 +6,15 @@ $compiler = $Matches.compiler
$compileOption = $Matches.option
$bits = $Matches.bits
$cmakeBuildType = 'RelWithDebInfo'
-$depsDir = [System.IO.Path]::GetFullPath("deps-$($compiler)")
+$buildDir = [System.IO.Path]::GetFullPath("$(pwd)")
$depsCmakeVars = @{
CMAKE_BUILD_TYPE = $cmakeBuildType;
}
$nvimCmakeVars = @{
CMAKE_BUILD_TYPE = $cmakeBuildType;
BUSTED_OUTPUT_TYPE = 'nvim';
- DEPS_BUILD_DIR=$depsDir;
- DEPS_PREFIX="$($depsDir)/usr";
+ DEPS_BUILD_DIR=$(if ($env:DEPS_BUILD_DIR -ne $null) {$env:DEPS_BUILD_DIR} else {".deps"});
+ DEPS_PREFIX=$(if ($env:DEPS_PREFIX -ne $null) {$env:DEPS_PREFIX} else {".deps/usr"});
}
$uploadToCodeCov = $false
@@ -25,6 +25,13 @@ function exitIfFailed() {
}
}
+if (-Not (Test-Path -PathType container $nvimCmakeVars["DEPS_BUILD_DIR"])) {
+ write-host "cache dir not found: $($nvimCmakeVars['DEPS_BUILD_DIR'])"
+ mkdir $nvimCmakeVars["DEPS_BUILD_DIR"]
+} else {
+ write-host "cache dir $($nvimCmakeVars['DEPS_BUILD_DIR']) size: $(Get-ChildItem $nvimCmakeVars['DEPS_BUILD_DIR'] -recurse | Measure-Object -property length -sum | Select -expand sum)"
+}
+
if ($compiler -eq 'MINGW') {
if ($bits -eq 32) {
$arch = 'i686'
@@ -87,13 +94,10 @@ function convertToCmakeArgs($vars) {
return $vars.GetEnumerator() | foreach { "-D$($_.Key)=$($_.Value)" }
}
-if (-Not (Test-Path -PathType container $depsDir)) {
- mkdir "$depsDir"
-}
-cd "$depsDir"
-cmake -G $cmakeGenerator $(convertToCmakeArgs($depsCmakeVars)) ..\third-party\ ; exitIfFailed
+cd $nvimCmakeVars["DEPS_BUILD_DIR"]
+cmake -G $cmakeGenerator $(convertToCmakeArgs($depsCmakeVars)) "$buildDir/third-party/" ; exitIfFailed
cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed
-cd ..
+cd $buildDir
# Build Neovim
mkdir build
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index e52ed5ad2b..c8b9dd5fad 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -251,7 +251,7 @@ of some window, or a position relative to the current window cursor. The
parameters for positioning are described in detail at |nvim_open_win()|.
|nvim_open_win()| assumes an existing buffer to display in the window. To create
-a scratch buffer for the float, |nvim_create_buffer()| can be used. The text in
+a scratch buffer for the float, |nvim_create_buf()| can be used. The text in
the buffer can be highlighted using standard functionality, such as syntax
highlighting, or |api-highlights|.
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index b6db7b263d..4cc1f53cca 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -640,8 +640,9 @@ CursorHoldI Just like CursorHold, but in Insert mode.
*CursorMoved*
CursorMoved After the cursor was moved in Normal or Visual
- mode. Also when the text of the cursor line
- has been changed, e.g., with "x", "rx" or "p".
+ mode or to another window. Also when the text
+ of the cursor line has been changed, e.g. with
+ "x", "rx" or "p".
Not triggered when there is typeahead or when
an operator is pending.
For an example see |match-parens|.
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index 1761616651..912231bfcd 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -939,8 +939,6 @@ This replaces each 'E' character with a euro sign. Read more in |<Char->|.
this (that's a good habit anyway).
`:retab!` may also change a sequence of spaces by
<Tab> characters, which can mess up a printf().
- Not available when |+ex_extra| feature was disabled at
- compile time.
*retab-example*
Example for using autocommands and ":retab" to edit a file which is stored
@@ -1291,21 +1289,15 @@ The next three commands always work on whole lines.
:[range]ce[nter] [width] *:ce* *:center*
Center lines in [range] between [width] columns
(default 'textwidth' or 80 when 'textwidth' is 0).
- Not available when |+ex_extra| feature was disabled at
- compile time.
:[range]ri[ght] [width] *:ri* *:right*
Right-align lines in [range] at [width] columns
(default 'textwidth' or 80 when 'textwidth' is 0).
- Not available when |+ex_extra| feature was disabled at
- compile time.
*:le* *:left*
:[range]le[ft] [indent]
Left-align lines in [range]. Sets the indent in the
lines to [indent] (default 0).
- Not available when |+ex_extra| feature was disabled at
- compile time.
*gq*
gq{motion} Format the lines that {motion} moves over.
diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt
index 47c4677b20..81b0e17322 100644
--- a/runtime/doc/cmdline.txt
+++ b/runtime/doc/cmdline.txt
@@ -789,7 +789,6 @@ function |expand()|.
#<n (where n is a number > 0) is replaced with old *:_#<* *c_#<*
file name n. See |:oldfiles| or |v:oldfiles| to get the
number. *E809*
- {only when compiled with the |+eval| and |+shada| features}
Note that these, except "#<n", give the file name as it was typed. If an
absolute path is needed (when using the file name from a different directory),
@@ -858,8 +857,6 @@ Note: these are typed literally, they are not special keys!
*%:8* *%:p* *%:.* *%:~* *%:h* *%:t* *%:r* *%:e* *%:s* *%:gs* *%:S*
The file name modifiers can be used after "%", "#", "#n", "<cfile>", "<sfile>",
"<afile>" or "<abuf>". They are also used with the |fnamemodify()| function.
-These are not available when Vim has been compiled without the |+modify_fname|
-feature.
These modifiers can be given, in this order:
:p Make file name a full path. Must be the first modifier. Also
changes "~/" (and "~user/" for Unix) to the path for the home
diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt
index 4b1cbe2cce..a6ba7ee9c5 100644
--- a/runtime/doc/develop.txt
+++ b/runtime/doc/develop.txt
@@ -123,7 +123,7 @@ autoload/provider/python.vim script; the provider#python#Call function is only
defined if a valid external Python host is found. That works well with the
`has('python')` expression (normally used by Python plugins) because if the
Python host isn't installed then the plugin will "think" it is running in
-a Vim compiled without the |+python| feature.
+a Vim compiled without the "+python" feature.
DOCUMENTATION *dev-doc*
diff --git a/runtime/doc/digraph.txt b/runtime/doc/digraph.txt
index f05c73d737..95bc3722d0 100644
--- a/runtime/doc/digraph.txt
+++ b/runtime/doc/digraph.txt
@@ -32,9 +32,6 @@ An alternative is using the 'keymap' option.
first character, it has a special meaning in the
future.
-Vim is normally compiled with the |+digraphs| feature. If the feature is
-disabled, the ":digraph" command will display an error message.
-
Example of the output of ":digraphs": >
TH Þ 222 ss ß 223 a! à 224 a' á 225 a> â 226 a? ã 227 a: ä 228
@@ -53,19 +50,6 @@ conversion to be available, it might fail. For the NUL character you will see
"10". That's because NUL characters are internally represented with a NL
character. When you write the file it will become a NUL character.
-When Vim was compiled without the |+multi_byte| feature, you need to specify
-the character in the encoding given with 'encoding'. You might want to use
-something like this: >
-
- if has("multi_byte")
- digraph oe 339
- elseif &encoding == "iso-8859-15"
- digraph oe 189
- endif
-
-This defines the "oe" digraph for a character that is number 339 in Unicode
-and 189 in latin9 (iso-8859-15).
-
==============================================================================
2. Using digraphs *digraphs-use*
@@ -155,8 +139,7 @@ a standard meaning:
Example: a: is ä and o: is ö
These are the RFC1345 digraphs for the one-byte characters. See the output of
-":digraphs" for the others. The characters above 255 are only available when
-Vim was compiled with the |+multi_byte| feature.
+":digraphs" for the others.
EURO
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index 34fb779fe7..f4d3164dbc 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -1170,9 +1170,8 @@ If you want to always use ":confirm", set the 'confirm' option.
and |:qall| if 'confirm' is set.
{only in Win32 GUI}
When ":browse" is not possible you get an error
- message. If the |+browse| feature is missing or the
- {command} doesn't support browsing, the {command} is
- executed without a dialog.
+ message. If {command} doesn't support browsing, the
+ {command} is executed without a dialog.
":browse set" works like |:options|.
See also |:oldfiles| for ":browse oldfiles".
@@ -1460,8 +1459,6 @@ problem goes away the next day.
==============================================================================
11. File Searching *file-searching*
-{not available when compiled without the |+path_extra| feature}
-
The file searching is currently used for the 'path', 'cdpath' and 'tags'
options, for |finddir()| and |findfile()|. Other commands use |wildcards|
which is slightly different.
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index f5817279df..f11ce2de09 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -8,10 +8,6 @@ Expression evaluation *expression* *expr* *E15* *eval*
Using expressions is introduced in chapter 41 of the user manual |usr_41.txt|.
-Note: Expression evaluation can be disabled at compile time. If this has been
-done, the features in this document are not available. See |+eval| and
-|no-eval-feature|.
-
Type |gO| to see the table of contents.
==============================================================================
@@ -22,8 +18,6 @@ done, the features in this document are not available. See |+eval| and
There are six types of variables:
Number A 32 or 64 bit signed number. |expr-number| *Number*
- 64-bit Number is available only when compiled with the
- |+num64| feature.
Examples: -123 0x10 0177 0b1011
Float A floating point number. |floating-point-format| *Float*
@@ -1307,8 +1301,7 @@ is deleted when the window is closed.
*tabpage-variable* *t:var* *t:*
A variable name that is preceded with "t:" is local to the current tab page,
-It is deleted when the tab page is closed. {not available when compiled
-without the |+windows| feature}
+It is deleted when the tab page is closed.
*global-variable* *g:var* *g:*
Inside functions global variables are accessed with "g:". Omitting this will
@@ -1745,7 +1738,6 @@ v:oldfiles List of file names that is loaded from the |shada| file on
The List can be modified, but this has no effect on what is
stored in the |shada| file later. If you use values other
than String this will cause trouble.
- {only when compiled with the |+shada| feature}
*v:option_new*
v:option_new New value of the option. Valid while executing an |OptionSet|
@@ -1896,7 +1888,6 @@ v:termresponse The escape sequence returned by the terminal for the DA
is the terminal type: 0 for vt100 and 1 for vt220. Pv is the
patch level (since this was introduced in patch 95, it's
always 95 or bigger). Pc is always zero.
- {only when compiled with |+termresponse| feature}
*v:testing* *testing-variable*
v:testing Must be set before using `test_garbagecollect_now()`.
@@ -3673,8 +3664,6 @@ finddir({name} [, {path} [, {count}]]) *finddir()*
{name} in {path} instead of the first one.
When {count} is negative return all the matches in a |List|.
This is quite similar to the ex-command |:find|.
- {only available when compiled with the |+file_in_path|
- feature}
findfile({name} [, {path} [, {count}]]) *findfile()*
Just like |finddir()|, but find a file instead of a directory.
@@ -3795,7 +3784,6 @@ foldtext() Returns a String, to be displayed for a closed fold. This is
When used to draw the actual foldtext, the rest of the line
will be filled with the fold char from the 'fillchars'
setting.
- {not available when compiled without the |+folding| feature}
foldtextresult({lnum}) *foldtextresult()*
Returns the text that is displayed for the closed fold at line
@@ -3805,7 +3793,6 @@ foldtextresult({lnum}) *foldtextresult()*
{lnum} is used like with |getline()|. Thus "." is the current
line, "'m" mark m, etc.
Useful when exporting folded text, e.g., to HTML.
- {not available when compiled without the |+folding| feature}
*foreground()*
foreground() Move the Vim window to the foreground. Useful when sent from
@@ -4683,10 +4670,49 @@ globpath({path}, {expr} [, {nosuf} [, {list} [, {allinks}]]])
supported, thus using 'path' will not always work properly.
*has()*
-has({feature}) The result is a Number, which is 1 if the feature {feature} is
- supported, zero otherwise. The {feature} argument is a
- string. See |feature-list| below.
- Also see |exists()|.
+has({feature}) Returns 1 if {feature} is supported, 0 otherwise. The
+ {feature} argument is a feature name like "nvim-0.2.1" or
+ "win32", see below. See also |exists()|.
+
+ Vim's compile-time feature names (prefixed with "+") are not
+ supported because Nvim is always compiled with ALL possible
+ features. |feature-compile|
+
+ Feature names can be:
+ 1. Nvim version. For example the "nvim-0.2.1" feature means
+ that Nvim is version 0.2.1 or later: >
+ :if has("nvim-0.2.1")
+
+< 2. Runtime condition or other pseudo-feature. For example the
+ "win32" feature checks if the current system is Windows: >
+ :if has("win32")
+< *feature-list*
+ List of supported pseudo-feature names:
+ acl |ACL| support
+ iconv Can use |iconv()| for conversion.
+ +shellslash Can use backslashes in filenames (Windows)
+ clipboard |clipboard| provider is available.
+ nvim This is Nvim.
+ python2 Legacy Vim |python2| interface. |has-python|
+ python3 Legacy Vim |python3| interface. |has-python|
+ pythonx Legacy Vim |python_x| interface. |has-pythonx|
+ ttyin input is a terminal (tty)
+ ttyout output is a terminal (tty)
+ unix Unix system.
+ *vim_starting* True during |startup|.
+ win32 Windows system (32 or 64 bit).
+ wsl WSL (Windows Subsystem for Linux) system
+
+ *has-patch*
+ 3. Vim patches. The "patch123" feature means that Vim patch
+ 123 has been included. This does not check the Vim
+ version, you could check |v:version| for that.
+ Example: >
+ :if v:version > 602 || v:version == 602 && has("patch148")
+
+< 5. Vim version. For example the "patch-7.4.237" feature means
+ that the Vim version is 7.4.237 or later. >
+ :if has("patch-7.4.237")
has_key({dict}, {key}) *has_key()*
@@ -8514,154 +8540,6 @@ xor({expr}, {expr}) *xor()*
<
- *feature-list*
-There are four types of features:
-1. Features that are only supported when they have been enabled when Vim
- was compiled |+feature-list|. Example: >
- :if has("cindent")
-2. Features that are only supported when certain conditions have been met.
- Example: >
- :if has("win32")
-< *has-patch*
-3. Nvim version. The "nvim-0.2.1" feature means that the Nvim version is
- 0.2.1 or later. Example: >
- :if has("nvim-0.2.1")
-<
-4. Included patches. The "patch123" feature means that patch 123 has been
- included. Note that this form does not check the version of Vim, you need
- to inspect |v:version| for that.
- Example (checking version 6.2.148 or later): >
- :if v:version > 602 || v:version == 602 && has("patch148")
-< Note that it's possible for patch 147 to be omitted even though 148 is
- included.
-
-5. Beyond a certain version or at a certain version and including a specific
- patch. The "patch-7.4.237" feature means that the Vim version is 7.5 or
- later, or it is version 7.4 and patch 237 was included.
- Note that this only works for patch 7.4.237 and later, before that you
- need to use the example above that checks v:version. Example: >
- :if has("patch-7.4.248")
-< Note that it's possible for patch 147 to be omitted even though 148 is
- included.
-
-Hint: To find out if Vim supports backslashes in a file name (MS-Windows),
-use: `if exists('+shellslash')`
-
-
-acl Compiled with |ACL| support.
-arabic Compiled with Arabic support |Arabic|.
-autocmd Compiled with autocommand support. |autocommand|
-browse Compiled with |:browse| support, and browse() will
- work.
-browsefilter Compiled with support for |browsefilter|.
-byte_offset Compiled with support for 'o' in 'statusline'
-cindent Compiled with 'cindent' support.
-clipboard Compiled with 'clipboard' support.
-cmdline_compl Compiled with |cmdline-completion| support.
-cmdline_hist Compiled with |cmdline-history| support.
-cmdline_info Compiled with 'showcmd' and 'ruler' support.
-comments Compiled with |'comments'| support.
-cscope Compiled with |cscope| support.
-debug Compiled with "DEBUG" defined.
-dialog_con Compiled with console dialog support.
-digraphs Compiled with support for digraphs.
-eval Compiled with expression evaluation support. Always
- true, of course!
-ex_extra |+ex_extra|, always true now
-extra_search Compiled with support for |'incsearch'| and
- |'hlsearch'|
-file_in_path Compiled with support for |gf| and |<cfile>|
-filterpipe When 'shelltemp' is off pipes are used for shell
- read/write/filter commands
-find_in_path Compiled with support for include file searches
- |+find_in_path|.
-float Compiled with support for |Float|.
-fname_case Case in file names matters (for Windows this is not
- present).
-folding Compiled with |folding| support.
-gettext Compiled with message translation |multi-lang|
-iconv Can use iconv() for conversion.
-insert_expand Compiled with support for CTRL-X expansion commands in
- Insert mode.
-jumplist Compiled with |jumplist| support.
-keymap Compiled with 'keymap' support.
-lambda Compiled with |lambda| support.
-langmap Compiled with 'langmap' support.
-libcall Compiled with |libcall()| support.
-linebreak Compiled with 'linebreak', 'breakat', 'showbreak' and
- 'breakindent' support.
-lispindent Compiled with support for lisp indenting.
-listcmds Compiled with commands for the buffer list |:files|
- and the argument list |arglist|.
-localmap Compiled with local mappings and abbr. |:map-local|
-mac macOS version of Nvim.
-menu Compiled with support for |:menu|.
-mksession Compiled with support for |:mksession|.
-modify_fname Compiled with file name modifiers. |filename-modifiers|
-mouse Compiled with support mouse.
-mouseshape Compiled with support for 'mouseshape'.
-multi_byte Compiled with support for 'encoding'
-multi_byte_encoding 'encoding' is set to a multi-byte encoding.
-multi_lang Compiled with support for multiple languages.
-num64 Compiled with 64-bit |Number| support.
-nvim This is Nvim. |has-patch|
-path_extra Compiled with up/downwards search in 'path' and 'tags'
-persistent_undo Compiled with support for persistent undo history.
-postscript Compiled with PostScript file printing.
-printer Compiled with |:hardcopy| support.
-profile Compiled with |:profile| support.
-python Legacy Vim Python 2.x API is available. |has-python|
-python3 Legacy Vim Python 3.x API is available. |has-python|
-pythonx Compiled with |python_x| interface. |has-pythonx|
-quickfix Compiled with |quickfix| support.
-reltime Compiled with |reltime()| support.
-rightleft Compiled with 'rightleft' support.
-scrollbind Compiled with 'scrollbind' support.
-shada Compiled with shada support.
-showcmd Compiled with 'showcmd' support.
-signs Compiled with |:sign| support.
-smartindent Compiled with 'smartindent' support.
-spell Compiled with spell checking support |spell|.
-startuptime Compiled with |--startuptime| support.
-statusline Compiled with support for 'statusline', 'rulerformat'
- and special formats of 'titlestring' and 'iconstring'.
-syntax Compiled with syntax highlighting support |syntax|.
-syntax_items There are active syntax highlighting items for the
- current buffer.
-tablineat 'tabline' option accepts %@Func@ items.
-tag_binary Compiled with binary searching in tags files
- |tag-binary-search|.
-tag_old_static Compiled with support for old static tags
- |tag-old-static|.
-tag_any_white Compiled with support for any white characters in tags
- files |tag-any-white|.
-termresponse Compiled with support for t_RV and |v:termresponse|.
-textobjects Compiled with support for |text-objects|.
-timers Compiled with |timer_start()| support.
-title Compiled with window title support |'title'|.
-ttyin input is a terminal (tty)
-ttyout output is a terminal (tty)
-unix Unix version of Vim.
-unnamedplus Compiled with support for "unnamedplus" in 'clipboard'
-user_commands User-defined commands.
-vertsplit Compiled with vertically split windows |:vsplit|.
-vim_starting True while initial source'ing takes place. |startup|
- *vim_starting*
-virtualedit Compiled with 'virtualedit' option.
-visual Compiled with Visual mode.
-visualextra Compiled with extra Visual mode commands.
- |blockwise-operators|.
-vreplace Compiled with |gR| and |gr| commands.
-vtp Compiled for vcon support |+vtp| (check vcon to find
- out if it works in the current console)).
-wildignore Compiled with 'wildignore' option.
-wildmenu Compiled with 'wildmenu' option.
-win32 Windows version of Vim (32 or 64 bit).
-winaltkeys Compiled with 'winaltkeys' option.
-windows Compiled with support for more than one window.
-writebackup Compiled with 'writebackup' default on.
-wsl WSL (Windows Subsystem for Linux) version of Vim.
-
*string-match*
Matching a pattern in a String
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt
index 9de2becf81..fce4d8628e 100644
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -1844,7 +1844,8 @@ NOTE: These commands cannot be used with |:global| or |:vglobal|.
":endif", ":for" and ":endfor", ":while" and ":endwhile".
*:start* *:startinsert*
-:star[tinsert][!] Start Insert mode just after executing this command.
+:star[tinsert][!] Start Insert mode (or |Terminal-mode| in a |terminal|
+ buffer) just after executing this command.
Works like typing "i" in Normal mode. When the ! is
included it works like "A", append to the line.
Otherwise insertion starts at the cursor position.
@@ -1854,8 +1855,8 @@ NOTE: These commands cannot be used with |:global| or |:vglobal|.
This command does not work from |:normal|.
*:stopi* *:stopinsert*
-:stopi[nsert] Stop Insert mode as soon as possible. Works like
- typing <Esc> in Insert mode.
+:stopi[nsert] Stop Insert mode or |Terminal-mode| as soon as
+ possible. Works like typing <Esc> in Insert mode.
Can be used in an autocommand, example: >
:au BufEnter scratch stopinsert
<
diff --git a/runtime/doc/message.txt b/runtime/doc/message.txt
index a46648119e..205db12f3b 100644
--- a/runtime/doc/message.txt
+++ b/runtime/doc/message.txt
@@ -740,11 +740,10 @@ You tried to set an option after startup that only allows changes during
startup.
*E943* >
- Command table needs to be updated, run 'make cmdidxs'
+ Command table needs to be updated, run 'make'
-This can only happen when changing the source code, when adding a command in
-src/ex_cmds.h. The lookup table then needs to be updated, by running: >
- make cmdidxs
+This can only happen when changing the source code, after adding a command in
+src/ex_cmds.lua. Update the lookup table by re-running the build. >
==============================================================================
3. Messages *messages*
diff --git a/runtime/doc/provider.txt b/runtime/doc/provider.txt
index 070c72a77e..364fbac351 100644
--- a/runtime/doc/provider.txt
+++ b/runtime/doc/provider.txt
@@ -35,13 +35,13 @@ itself).
For Python 3 plugins:
1. Make sure Python 3.4+ is available in your $PATH.
-2. Install the module (try "pip" if "pip3" is missing): >
- pip3 install --user --upgrade pynvim
+2. Install the module (try "python" if "python3" is missing): >
+ python3 -m pip install --user --upgrade pynvim
For Python 2 plugins:
1. Make sure Python 2.7 is available in your $PATH.
-2. Install the module (try "pip" if "pip2" is missing): >
- pip2 install --user --upgrade pynvim
+2. Install the module (try "python" if "python2" is missing): >
+ python2 -m pip install --user --upgrade pynvim
The pip `--upgrade` flag ensures that you get the latest version even if
a previous version was already installed.
@@ -51,8 +51,8 @@ See also |python-virtualenv|.
Note: The old "neovim" module was renamed to "pynvim".
https://github.com/neovim/neovim/wiki/Following-HEAD#20181118
If you run into problems, uninstall _both_ then install "pynvim" again: >
- pip uninstall neovim pynvim
- pip install pynvim
+ python -m pip uninstall neovim pynvim
+ python -m pip install --user --upgrade pynvim
PYTHON PROVIDER CONFIGURATION ~
diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt
index ab077397a4..98476ea8fa 100644
--- a/runtime/doc/ui.txt
+++ b/runtime/doc/ui.txt
@@ -325,9 +325,13 @@ numerical highlight `id`:s to the actual attributes.
indicates the visible cursor position.
["grid_scroll", grid, top, bot, left, right, rows, cols]
- Scroll the text in the a region of `grid`. The diagrams below illustrate
- what will happen, depending on the scroll direction. "=" is used to
- represent the SR(scroll region) boundaries and "-" the moved rectangles.
+ Scroll a region of `grid`. This is semantically unrelated to editor
+ |scrolling|, rather this is an optimized way to say "copy these screen
+ cells".
+
+ The following diagrams show what happens per scroll direction.
+ "===" represents the SR (scroll region) boundaries.
+ "---" represents the moved rectangles.
Note that dst and src share a common region.
If `rows` is bigger than 0, move a rectangle in the SR up, this can
diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt
index 2b8ba56c28..6f809af387 100644
--- a/runtime/doc/various.txt
+++ b/runtime/doc/various.txt
@@ -286,130 +286,12 @@ g8 Print the hex values of the bytes used in the
:!! Repeat last ":!{cmd}".
*:ve* *:version*
-:ve[rsion] Print the version number of the editor. The following
- lines contain information about which features were
- enabled when Vim was compiled. When there is a
- preceding '+', the feature is included, when there is
- a '-' it is excluded. To change this, you have to
- edit feature.h and recompile Vim. To check for this
- in an expression, see |has()|. Here is an overview of
- the features. The first column shows the smallest
- version in which they are included:
- T tiny
- S small
- N normal
- B big
- H huge
- m manually enabled or depends on other features
- (none) system dependent
- Thus if a feature is marked with "N", it is included
- in the normal, big and huge versions of Vim.
-
- *+feature-list*
- *+acl* |ACL| support included
-B *+arabic* |Arabic| language support
-N *+autocmd* |:autocmd|, automatic commands
-N *+browse* |:browse| command
-N *+byte_offset* support for 'o' flag in 'statusline' option, "go"
- and ":goto" commands.
-N *+cindent* |'cindent'|, C indenting
-N *+clientserver* Unix and Win32: Remote invocation |clientserver|
- *+clipboard* |clipboard| support
-N *+cmdline_compl* command line completion |cmdline-completion|
-S *+cmdline_hist* command line history |cmdline-history|
-N *+cmdline_info* |'showcmd'| and |'ruler'|
-N *+comments* |'comments'| support
-B *+conceal* "conceal" support, see |conceal| |:syn-conceal| etc.
-B *+cscope* |cscope| support
-m *+cursorbind* |'cursorbind'| support
-m *+debug* Compiled for debugging.
-N *+dialog_gui* Support for |:confirm| with GUI dialog.
-N *+dialog_con* Support for |:confirm| with console dialog.
-N *+dialog_con_gui* Support for |:confirm| with GUI and console dialog.
-N *+digraphs* |digraphs| *E196*
-N *+eval* expression evaluation |eval.txt|
-N *+ex_extra* always on now, used to be for Vim's extra Ex commands
-N *+extra_search* |'hlsearch'| and |'incsearch'| options.
-N *+file_in_path* |gf|, |CTRL-W_f| and |<cfile>|
-N *+find_in_path* include file searches: |[I|, |:isearch|,
- |CTRL-W_CTRL-I|, |:checkpath|, etc.
-N *+folding* |folding|
-N *+gettext* message translations |multi-lang|
- *+iconv* Compiled with the |iconv()| function
- *+iconv/dyn* Likewise |iconv-dynamic| |/dyn|
-N *+insert_expand* |insert_expand| Insert mode completion
-S *+jumplist* |jumplist|
-B *+keymap* |'keymap'|
-N *+lambda* |lambda| and |closure|
-B *+langmap* |'langmap'|
-N *+libcall* |libcall()|
-N *+linebreak* |'linebreak'|, |'breakat'| and |'showbreak'|
-N *+lispindent* |'lisp'|
-N *+listcmds* Vim commands for the list of buffers |buffer-hidden|
- and argument list |:argdelete|
-N *+localmap* Support for mappings local to a buffer |:map-local|
-N *+menu* |:menu|
-N *+mksession* |:mksession|
-N *+modify_fname* |filename-modifiers|
-N *+mouse* Mouse handling |mouse-using|
-N *+mouseshape* |'mouseshape'|
-N *+multi_byte* 16 and 32 bit characters |multibyte|
- *+multi_byte_ime* Win32 input method for multibyte chars |multibyte-ime|
-N *+multi_lang* non-English language support |multi-lang|
- *+num64* 64-bit Number support |Number|
-N *+path_extra* Up/downwards search in 'path' and 'tags'
-N *+persistent_undo* Persistent undo |undo-persistence|
- *+postscript* |:hardcopy| writes a PostScript file
-N *+printer* |:hardcopy| command
-H *+profile* |:profile| command
-m *+python* Python 2 interface |python|
-m *+python3* Python 3 interface |python|
-N *+quickfix* |:make| and |quickfix| commands
-N *+reltime* |reltime()| function, 'hlsearch'/'incsearch' timeout,
- 'redrawtime' option
-B *+rightleft* Right to left typing |'rightleft'|
-N *+scrollbind* |'scrollbind'|
-N *+shada* |'shada'|
-B *+signs* |:sign|
-N *+smartindent* |'smartindent'|
-N *+startuptime* |--startuptime| argument
-N *+statusline* Options 'statusline', 'rulerformat' and special
- formats of 'titlestring' and 'iconstring'
-N *+syntax* Syntax highlighting |syntax|
-N *+tablineat* 'tabline' option recognizing %@Func@ items.
-T *+tag_binary* binary searching in tags file |tag-binary-search|
-N *+tag_old_static* old method for static tags |tag-old-static|
-m *+tag_any_white* any white space allowed in tags file |tag-any-white|
-B *+termguicolors* 24-bit color in xterm-compatible terminals support
-N *+termresponse* support for t_RV and |v:termresponse|
-N *+textobjects* |text-objects| selection
-N *+timers* the |timer_start()| function
-N *+title* Setting the window 'title' and 'icon'
-N *+toolbar* |gui-toolbar|
-N *+user_commands* User-defined commands. |user-commands|
- *+vertsplit* Vertically split windows |:vsplit|
-N *+virtualedit* |'virtualedit'|
-S *+visual* Visual mode |Visual-mode| Always enabled since 7.4.200.
-N *+visualextra* extra Visual mode commands |blockwise-operators|
-N *+vreplace* |gR| and |gr|
- *+vtp* on MS-Windows console: support for 'termguicolors'
-N *+wildignore* |'wildignore'|
-N *+wildmenu* |'wildmenu'|
- *+windows* more than one window
-m *+writebackup* |'writebackup'| is default on
-m *+xim* X input method |xim|
- *+xfontset* X fontset support |xfontset|
- *+xpm* pixmap support
-
- */dyn* *E370* *E448*
- To some of the features "/dyn" is added when the
- feature is only available when the related library can
- be dynamically loaded.
-
-:ve[rsion] {nr} Is now ignored. This was previously used to check the
- version number of a .vimrc file. It was removed,
- because you can now use the ":if" command for
- version-dependent behavior.
+:ve[rsion] Print editor version and build information.
+ See also |feature-compile|.
+
+:ve[rsion] {nr} Ignored. Previously used to check the version number
+ of a .vimrc file. You can now use the ":if" command
+ for version-dependent behavior.
*:redi* *:redir*
:redi[r][!] > {file} Redirect messages to file {file}. The messages which
diff --git a/scripts/gen_help_html.py b/scripts/gen_help_html.py
index f3dd19abb6..dbdeb3c162 100644
--- a/scripts/gen_help_html.py
+++ b/scripts/gen_help_html.py
@@ -1,5 +1,10 @@
# Converts Vim/Nvim documentation to HTML.
#
+# USAGE:
+# 1. python3 scripts/gen_help_html.py runtime/doc/ ~/neovim.github.io/t/
+# 3. cd ~/neovim.github.io/ && jekyll serve --host 0.0.0.0
+# 2. Visit http://localhost:4000/t/help.txt.html
+#
# Adapted from https://github.com/c4rlo/vimhelp/
# License: MIT
#
diff --git a/src/nvim/api/window.c b/src/nvim/api/window.c
index a68ae805e8..01cb9a6847 100644
--- a/src/nvim/api/window.c
+++ b/src/nvim/api/window.c
@@ -67,6 +67,10 @@ void nvim_win_set_buf(Window window, Buffer buffer, Error *err)
buffer);
}
+ // If window is not current, state logic will not validate its cursor.
+ // So do it now.
+ validate_cursor();
+
restore_win(save_curwin, save_curtab, false);
}
diff --git a/src/nvim/auevents.lua b/src/nvim/auevents.lua
index 32a7920b6e..ef528f72b8 100644
--- a/src/nvim/auevents.lua
+++ b/src/nvim/auevents.lua
@@ -65,7 +65,6 @@ return {
'InsertCharPre', -- before inserting a char
'InsertEnter', -- when entering Insert mode
'InsertLeave', -- when leaving Insert mode
- 'JobActivity', -- when job sent some data
'MenuPopup', -- just before popup menu is displayed
'OptionSet', -- after setting any option
'QuickFixCmdPost', -- after :make, :grep etc.
@@ -89,7 +88,7 @@ return {
'TabNew', -- when creating a new tab
'TabNewEntered', -- after entering a new tab
'TermChanged', -- after changing 'term'
- 'TermClose', -- after the processs exits
+ 'TermClose', -- after the process exits
'TermOpen', -- after opening a terminal buffer
'TermResponse', -- after setting "v:termresponse"
'TextChanged', -- text was modified
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 8d075dfeae..703a89d31f 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -1717,11 +1717,7 @@ buf_T * buflist_new(char_u *ffname, char_u *sfname, linenr_T lnum, int flags)
* buffer.)
*/
buf = NULL;
- if ((flags & BLN_CURBUF)
- && curbuf != NULL
- && curbuf->b_ffname == NULL
- && curbuf->b_nwindows <= 1
- && (curbuf->b_ml.ml_mfp == NULL || BUFEMPTY())) {
+ if ((flags & BLN_CURBUF) && curbuf_reusable()) {
buf = curbuf;
/* It's like this buffer is deleted. Watch out for autocommands that
* change curbuf! If that happens, allocate a new buffer anyway. */
@@ -1864,6 +1860,18 @@ buf_T * buflist_new(char_u *ffname, char_u *sfname, linenr_T lnum, int flags)
return buf;
}
+/// Return true if the current buffer is empty, unnamed, unmodified and used in
+/// only one window. That means it can be reused.
+bool curbuf_reusable(void)
+{
+ return (curbuf != NULL
+ && curbuf->b_ffname == NULL
+ && curbuf->b_nwindows <= 1
+ && (curbuf->b_ml.ml_mfp == NULL || BUFEMPTY())
+ && !bt_quickfix(curbuf)
+ && !curbufIsChanged());
+}
+
/*
* Free the memory for the options of a buffer.
* If "free_p_ff" is true also free 'fileformat', 'buftype' and
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c
index 4684a1b31d..15b735dc9e 100644
--- a/src/nvim/ex_cmds2.c
+++ b/src/nvim/ex_cmds2.c
@@ -1952,14 +1952,17 @@ void ex_next(exarg_T *eap)
void ex_argedit(exarg_T *eap)
{
int i = eap->addr_count ? (int)eap->line2 : curwin->w_arg_idx + 1;
+ // Whether curbuf will be reused, curbuf->b_ffname will be set.
+ bool curbuf_is_reusable = curbuf_reusable();
if (do_arglist(eap->arg, AL_ADD, i) == FAIL) {
return;
}
maketitle();
- if (curwin->w_arg_idx == 0 && (curbuf->b_ml.ml_flags & ML_EMPTY)
- && curbuf->b_ffname == NULL) {
+ if (curwin->w_arg_idx == 0
+ && (curbuf->b_ml.ml_flags & ML_EMPTY)
+ && (curbuf->b_ffname == NULL || curbuf_is_reusable)) {
i = 0;
}
// Edit the argument.
@@ -2257,7 +2260,8 @@ static int alist_add_list(int count, char_u **files, int after)
}
for (int i = 0; i < count; i++) {
ARGLIST[after + i].ae_fname = files[i];
- ARGLIST[after + i].ae_fnum = buflist_add(files[i], BLN_LISTED);
+ ARGLIST[after + i].ae_fnum = buflist_add(files[i],
+ BLN_LISTED | BLN_CURBUF);
}
ALIST(curwin)->al_ga.ga_len += count;
if (old_argcount > 0 && curwin->w_arg_idx >= after) {
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index c29ef9f822..0020b57482 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -2270,18 +2270,25 @@ static int vgetorpeek(int advance)
// that has a <Nop> RHS.
timedout = false;
}
+
+ long wait_time = 0;
+
+ if (advance) {
+ if (typebuf.tb_len == 0
+ || !(p_timeout || (p_ttimeout && keylen == KEYLEN_PART_KEY))) {
+ // blocking wait
+ wait_time = -1L;
+ } else if (keylen == KEYLEN_PART_KEY && p_ttm >= 0) {
+ wait_time = p_ttm;
+ } else {
+ wait_time = p_tm;
+ }
+ }
+
wait_tb_len = typebuf.tb_len;
c = inchar(typebuf.tb_buf + typebuf.tb_off + typebuf.tb_len,
- typebuf.tb_buflen - typebuf.tb_off - typebuf.tb_len - 1,
- !advance
- ? 0
- : ((typebuf.tb_len == 0
- || !(p_timeout || (p_ttimeout
- && keylen == KEYLEN_PART_KEY)))
- ? -1L
- : ((keylen == KEYLEN_PART_KEY && p_ttm >= 0)
- ? p_ttm
- : p_tm)));
+ typebuf.tb_buflen - typebuf.tb_off - typebuf.tb_len - 1,
+ wait_time);
if (i != 0)
pop_showcmd();
diff --git a/src/nvim/log.c b/src/nvim/log.c
index 8066b6e828..a2f83d4d09 100644
--- a/src/nvim/log.c
+++ b/src/nvim/log.c
@@ -1,6 +1,13 @@
// This is an open source non-commercial project. Dear PVS-Studio, please check
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
+//
+// Log module
+//
+// How Linux printk() handles recursion, buffering, etc:
+// https://lwn.net/Articles/780556/
+//
+
#include <assert.h>
#include <inttypes.h>
#include <stdarg.h>
@@ -99,9 +106,14 @@ void log_unlock(void)
uv_mutex_unlock(&mutex);
}
-/// @param context description of a shared context or subsystem
-/// @param func_name function name, or NULL
-/// @param line_num source line number, or -1
+/// Logs a message to $NVIM_LOG_FILE.
+///
+/// @param log_level Log level (see log.h)
+/// @param context Description of a shared context or subsystem
+/// @param func_name Function name, or NULL
+/// @param line_num Source line number, or -1
+/// @param eol Append linefeed "\n"
+/// @param fmt printf-style format string
bool logmsg(int log_level, const char *context, const char *func_name,
int line_num, bool eol, const char *fmt, ...)
FUNC_ATTR_UNUSED FUNC_ATTR_PRINTF(6, 7)
@@ -163,7 +175,8 @@ end:
FILE *open_log_file(void)
{
static bool opening_log_file = false;
- // check if it's a recursive call
+ // Disallow recursion. (This only matters for log_path_init; for logmsg and
+ // friends we use a mutex: log_lock).
if (opening_log_file) {
do_log_to_file(stderr, ERROR_LOG_LEVEL, NULL, __func__, __LINE__, true,
"Cannot LOG() recursively.");
diff --git a/src/nvim/map.c b/src/nvim/map.c
index 9b6f57a56f..90da27cf9f 100644
--- a/src/nvim/map.c
+++ b/src/nvim/map.c
@@ -1,12 +1,12 @@
// This is an open source non-commercial project. Dear PVS-Studio, please check
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
-///
-/// map.c: khash.h wrapper
-///
-/// NOTE: Callers must manage memory (allocate) for keys and values.
-/// khash.h does not make its own copy of the key or value.
-///
+//
+// map.c: khash.h wrapper
+//
+// NOTE: Callers must manage memory (allocate) for keys and values.
+// khash.h does not make its own copy of the key or value.
+//
#include <stdlib.h>
#include <stdbool.h>
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 8da64bf01b..abee28e37e 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -8001,7 +8001,6 @@ static void nv_event(cmdarg_T *cap)
// lists or dicts being used.
may_garbage_collect = false;
multiqueue_process_events(main_loop.events);
- cap->retval |= CA_COMMAND_BUSY; // don't call edit() now
finish_op = false;
}
diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c
index 43beb684da..79b0df842f 100644
--- a/src/nvim/terminal.c
+++ b/src/nvim/terminal.c
@@ -403,6 +403,7 @@ void terminal_enter(void)
redraw(false);
s->state.execute = terminal_execute;
+ s->state.check = terminal_check;
state_enter(&s->state);
restart_edit = 0;
@@ -427,6 +428,19 @@ void terminal_enter(void)
}
}
+// Function executed before each iteration of terminal mode.
+// Return:
+// 1 if the iteration should continue normally
+// 0 if the main loop must exit
+static int terminal_check(VimState *state)
+{
+ if (stop_insert_mode) {
+ stop_insert_mode = false;
+ return 0;
+ }
+ return 1;
+}
+
static int terminal_execute(VimState *state, int key)
{
TerminalState *s = (TerminalState *)state;
diff --git a/src/nvim/testdir/test_arglist.vim b/src/nvim/testdir/test_arglist.vim
index ae975fe137..3a9ffbdbf3 100644
--- a/src/nvim/testdir/test_arglist.vim
+++ b/src/nvim/testdir/test_arglist.vim
@@ -329,6 +329,18 @@ func Test_argedit()
%argd
bwipe! C
bwipe! D
+
+ " :argedit reuses the current buffer if it is empty
+ %argd
+ " make sure to use a new buffer number for x when it is loaded
+ bw! x
+ new
+ let a = bufnr('')
+ argedit x
+ call assert_equal(a, bufnr(''))
+ call assert_equal('x', bufname(''))
+ %argd
+ bw! x
endfunc
" Test for the :argdelete command
diff --git a/src/nvim/testdir/test_command_count.vim b/src/nvim/testdir/test_command_count.vim
index 2d793ed88f..7262789ab4 100644
--- a/src/nvim/testdir/test_command_count.vim
+++ b/src/nvim/testdir/test_command_count.vim
@@ -173,7 +173,6 @@ func Test_command_count_4()
only!
exe bufnr . 'buf'
- bnext
let bufnr = bufnr('%')
let buffers = []
.,$-bufdo call add(buffers, bufnr('%'))
diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim
index cb3e7ca8f6..6227095f4f 100644
--- a/src/nvim/testdir/test_quickfix.vim
+++ b/src/nvim/testdir/test_quickfix.vim
@@ -2664,3 +2664,17 @@ func Test_qfwin_pos()
call assert_equal(3, winnr())
close
endfunc
+
+" Test to make sure that an empty quickfix buffer is not reused for loading
+" a normal buffer.
+func Test_empty_qfbuf()
+ enew | only
+ call writefile(["Test"], 'Xfile1')
+ call setqflist([], 'f')
+ copen | only
+ let qfbuf = bufnr('')
+ edit Xfile1
+ call assert_notequal(qfbuf, bufnr(''))
+ enew
+ call delete('Xfile1')
+endfunc
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua
index 75b9fb71c9..068d4973af 100644
--- a/test/functional/api/vim_spec.lua
+++ b/test/functional/api/vim_spec.lua
@@ -56,6 +56,13 @@ describe('API', function()
eq(2, eval('1+1'))
end)
+ it('does not set CA_COMMAND_BUSY #7254', function()
+ nvim('command', 'split')
+ nvim('command', 'autocmd WinEnter * startinsert')
+ nvim('command', 'wincmd w')
+ eq({mode='i', blocking=false}, nvim("get_mode"))
+ end)
+
describe('nvim_command', function()
it('works', function()
local fname = helpers.tmpname()
@@ -83,7 +90,7 @@ describe('API', function()
end)
it('VimL execution error: fails with specific error', function()
- local status, rv = pcall(nvim, "command_output", "buffer 23487")
+ local status, rv = pcall(nvim, "command", "buffer 23487")
eq(false, status) -- nvim_command() failed.
eq("E86: Buffer 23487 does not exist", string.match(rv, "E%d*:.*"))
eq('', eval('v:errmsg')) -- v:errmsg was not updated.
diff --git a/test/functional/terminal/ex_terminal_spec.lua b/test/functional/terminal/ex_terminal_spec.lua
index dbee9bdb49..ca5737db7f 100644
--- a/test/functional/terminal/ex_terminal_spec.lua
+++ b/test/functional/terminal/ex_terminal_spec.lua
@@ -99,6 +99,13 @@ describe(':terminal', function()
eq(3, #jumps)
end)
+ it(':stopinsert RPC request exits terminal-mode #7807', function()
+ command(':terminal')
+ feed('i[tui] insert-mode')
+ eq({ blocking=false, mode='t' }, nvim('get_mode'))
+ command('stopinsert')
+ eq({ blocking=false, mode='n' }, nvim('get_mode'))
+ end)
end)
describe(':terminal (with fake shell)', function()
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua
index 4a89345ee5..b248bd8f6f 100644
--- a/test/functional/ui/float_spec.lua
+++ b/test/functional/ui/float_spec.lua
@@ -550,6 +550,66 @@ describe('floating windows', function()
end
end)
+ it('validates cursor even when window is not entered', function()
+ screen:try_resize(30,5)
+ command("set nowrap")
+ insert([[some text that is wider than the window]])
+ if multigrid then
+ screen:expect([[
+ ## grid 1
+ [2:------------------------------]|
+ [2:------------------------------]|
+ [2:------------------------------]|
+ [2:------------------------------]|
+ |
+ ## grid 2
+ that is wider than the windo^w |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ ]])
+ else
+ screen:expect([[
+ that is wider than the windo^w |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ |
+ ]])
+ end
+
+ local buf = meths.create_buf(false,true)
+ meths.buf_set_lines(buf, 0, -1, true, {'some floaty text'})
+ meths.open_win(buf, false, {relative='editor', width=20, height=1, row=3, col=1})
+ if multigrid then
+ screen:expect{grid=[[
+ ## grid 1
+ [2:------------------------------]|
+ [2:------------------------------]|
+ [2:------------------------------]|
+ [2:------------------------------]|
+ |
+ ## grid 2
+ that is wider than the windo^w |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ ## grid 4
+ {1:some floaty text }|
+ ]], float_pos={
+ [4] = {{id = 1002}, "NW", 1, 3, 1, true}
+ }}
+ else
+ screen:expect([[
+ that is wider than the windo^w |
+ {0:~ }|
+ {0:~ }|
+ {0:~}{1:some floaty text }{0: }|
+ |
+ ]])
+ end
+ end)
+
if multigrid then
pending("supports second UI without multigrid", function()
local session2 = helpers.connect(eval('v:servername'))