aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.ci/clang-asan.sh4
-rw-r--r--.ci/gcc-32.sh3
-rw-r--r--.ci/gcc.sh4
-rw-r--r--runtime/doc/cmdline.txt1
-rw-r--r--runtime/doc/editing.txt141
-rw-r--r--runtime/doc/eval.txt4
-rw-r--r--runtime/doc/index.txt1
-rw-r--r--runtime/doc/insert.txt1
-rw-r--r--runtime/doc/manpages/vim.13
-rw-r--r--runtime/doc/nvim_clipboard.txt30
-rw-r--r--runtime/doc/nvim_intro.txt2
-rw-r--r--runtime/doc/nvim_provider.txt19
-rw-r--r--runtime/doc/nvim_python.txt8
-rw-r--r--runtime/doc/options.txt64
-rw-r--r--runtime/doc/quickref.txt3
-rw-r--r--runtime/doc/recover.txt47
-rw-r--r--runtime/doc/remote_plugin.txt91
-rw-r--r--runtime/doc/starting.txt16
-rw-r--r--runtime/doc/todo.txt5
-rw-r--r--runtime/doc/undo.txt10
-rw-r--r--runtime/doc/usr_11.txt2
-rw-r--r--runtime/doc/usr_23.txt96
-rw-r--r--runtime/doc/usr_toc.txt5
-rw-r--r--runtime/doc/various.txt1
-rw-r--r--runtime/doc/vi_diff.txt6
-rw-r--r--runtime/optwin.vim8
-rw-r--r--runtime/syntax/vim.vim16
-rwxr-xr-xscripts/gendeclarations.lua16
-rw-r--r--src/nvim/CMakeLists.txt15
-rw-r--r--src/nvim/api/buffer.c20
-rw-r--r--src/nvim/diff.c2
-rw-r--r--src/nvim/edit.c27
-rw-r--r--src/nvim/ex_cmds.c4
-rw-r--r--src/nvim/message.c5
-rw-r--r--src/nvim/msgpack_rpc/channel.c9
-rw-r--r--src/nvim/os/shell.c52
-rw-r--r--src/nvim/os/shell.h15
-rw-r--r--src/nvim/os/time.c37
-rw-r--r--src/nvim/strings.c10
-rw-r--r--src/nvim/testdir/dotest.in2
-rw-r--r--src/nvim/testdir/test40.in1
-rw-r--r--src/nvim/testdir/test48.in2
-rw-r--r--src/nvim/testdir/test60.in1
-rw-r--r--src/nvim/testdir/test68.in4
-rw-r--r--src/nvim/testdir/test69.in8
-rw-r--r--src/nvim/testdir/test90.in2
-rw-r--r--src/nvim/testdir/test_breakindent.in1
-rw-r--r--src/nvim/testdir/test_breakindent.ok8
-rw-r--r--src/nvim/testdir/test_listlbr.in1
-rw-r--r--src/nvim/testdir/test_listlbr_utf8.in1
-rw-r--r--test/functional/api/buffer_spec.lua5
-rw-r--r--test/functional/api/vim_spec.lua9
-rw-r--r--test/functional/helpers.lua2
-rw-r--r--test/functional/legacy/033_lisp_indent_spec.lua20
-rw-r--r--third-party/CMakeLists.txt16
55 files changed, 296 insertions, 590 deletions
diff --git a/.ci/clang-asan.sh b/.ci/clang-asan.sh
index b1909ea689..3f2fd4df90 100644
--- a/.ci/clang-asan.sh
+++ b/.ci/clang-asan.sh
@@ -33,7 +33,9 @@ export TSAN_OPTIONS="external_symbolizer_path=$symbolizer:log_path=$tmpdir/tsan"
export SKIP_UNITTEST=1
export UBSAN_OPTIONS="log_path=$tmpdir/ubsan" # not sure if this works
-CMAKE_EXTRA_FLAGS="-DTRAVIS_CI_BUILD=ON -DUSE_GCOV=ON"
+CMAKE_EXTRA_FLAGS="-DTRAVIS_CI_BUILD=ON \
+ -DUSE_GCOV=ON \
+ -DBUSTED_OUTPUT_TYPE=plainTerminal"
# Build and output version info.
$MAKE_CMD CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS" nvim
diff --git a/.ci/gcc-32.sh b/.ci/gcc-32.sh
index 13b2d46d8f..e0448894ab 100644
--- a/.ci/gcc-32.sh
+++ b/.ci/gcc-32.sh
@@ -19,7 +19,8 @@ CMAKE_EXTRA_FLAGS="-DTRAVIS_CI_BUILD=ON \
-DCMAKE_SYSTEM_LIBRARY_PATH=/lib32:/usr/lib32:/usr/local/lib32 \
-DFIND_LIBRARY_USE_LIB64_PATHS=OFF \
-DCMAKE_IGNORE_PATH=/lib:/usr/lib:/usr/local/lib \
- -DCMAKE_TOOLCHAIN_FILE=cmake/i386-linux-gnu.toolchain.cmake"
+ -DCMAKE_TOOLCHAIN_FILE=cmake/i386-linux-gnu.toolchain.cmake \
+ -DBUSTED_OUTPUT_TYPE=plainTerminal"
# Build and output version info.
$MAKE_CMD CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS" nvim
diff --git a/.ci/gcc.sh b/.ci/gcc.sh
index 8d09c756a7..ad9cbd33b0 100644
--- a/.ci/gcc.sh
+++ b/.ci/gcc.sh
@@ -15,7 +15,9 @@ setup_prebuilt_deps x64
export VALGRIND=1
export VALGRIND_LOG="$tmpdir/valgrind-%p.log"
-CMAKE_EXTRA_FLAGS="-DTRAVIS_CI_BUILD=ON -DUSE_GCOV=ON"
+CMAKE_EXTRA_FLAGS="-DTRAVIS_CI_BUILD=ON \
+ -DUSE_GCOV=ON \
+ -DBUSTED_OUTPUT_TYPE=plainTerminal"
# Build and output version info.
$MAKE_CMD CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS" nvim
diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt
index 2892faa496..77813423ba 100644
--- a/runtime/doc/cmdline.txt
+++ b/runtime/doc/cmdline.txt
@@ -1053,7 +1053,6 @@ VARIOUS
The command-line window cannot be used:
- when there already is a command-line window (no nesting)
-- for entering an encryption key or when using inputsecret()
- when Vim was not compiled with the |+vertsplit| feature
Some options are set when the command-line window is opened:
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index e4867e7a90..3496a03921 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -136,22 +136,8 @@ as the original file with 'backupext' appended. The default "~" is a bit
strange to avoid accidentally overwriting existing files. If you prefer ".bak"
change the 'backupext' option. Extra dots are replaced with '_' on MS-DOS
machines, when Vim has detected that an MS-DOS-like filesystem is being used
-(e.g., messydos or crossdos) or when the 'shortname' option is on. The
-backup file can be placed in another directory by setting 'backupdir'.
-
- *auto-shortname*
-Technical: On the Amiga you can use 30 characters for a file name. But on an
- MS-DOS-compatible filesystem only 8 plus 3 characters are
- available. Vim tries to detect the type of filesystem when it is
- creating the .swp file. If an MS-DOS-like filesystem is suspected,
- a flag is set that has the same effect as setting the 'shortname'
- option. This flag will be reset as soon as you start editing a
- new file. The flag will be used when making the file name for the
- ".swp" and ".~" files for the current file. But when you are
- editing a file in a normal filesystem and write to an MS-DOS-like
- filesystem the flag will not have been set. In that case the
- creation of the ".~" file may fail and you will get an error
- message. Use the 'shortname' option in this case.
+(e.g., messydos or crossdos). The backup file can be placed in another
+directory by setting 'backupdir'.
When you started editing without giving a file name, "No File" is displayed in
messages. If the ":write" command is used with a file name argument, the file
@@ -550,10 +536,6 @@ Before editing binary, executable or Vim script files you should set the
option. This will avoid the use of 'fileformat'. Without this you risk that
single <NL> characters are unexpectedly replaced with <CR><NL>.
-You can encrypt files that are written by setting the 'key' option. This
-provides some security against others reading your files. |encryption|
-
-
==============================================================================
3. The argument list *argument-list* *arglist*
@@ -1356,119 +1338,12 @@ There are a few things to remember when editing binary files:
==============================================================================
9. Encryption *encryption*
-Vim is able to write files encrypted, and read them back. The encrypted text
-cannot be read without the right key.
-{only available when compiled with the |+cryptv| feature} *E833*
-
-The text in the swap file and the undo file is also encrypted. *E843*
-However, this is done block-by-block and may reduce the time needed to crack a
-password. You can disable the swap file, but then a crash will cause you to
-lose your work. The undo file can be disabled without much disadvantage. >
- :set noundofile
- :noswapfile edit secrets
-
-Note: The text in memory is not encrypted. A system administrator may be able
-to see your text while you are editing it. When filtering text with
-":!filter" or using ":w !command" the text is not encrypted, this may reveal
-it to others. The 'viminfo' file is not encrypted.
-
-WARNING: If you make a typo when entering the key and then write the file and
-exit, the text will be lost!
-
-The normal way to work with encryption, is to use the ":X" command, which will
-ask you to enter a key. A following write command will use that key to
-encrypt the file. If you later edit the same file, Vim will ask you to enter
-a key. If you type the same key as that was used for writing, the text will
-be readable again. If you use a wrong key, it will be a mess.
-
- *:X*
-:X Prompt for an encryption key. The typing is done without showing the
- actual text, so that someone looking at the display won't see it.
- The typed key is stored in the 'key' option, which is used to encrypt
- the file when it is written. The file will remain unchanged until you
- write it. See also |-x|.
-
-The value of the 'key' options is used when text is written. When the option
-is not empty, the written file will be encrypted, using the value as the
-encryption key. A magic number is prepended, so that Vim can recognize that
-the file is encrypted.
-
-To disable the encryption, reset the 'key' option to an empty value: >
- :set key=
-
-You can use the 'cryptmethod' option to select the type of encryption, use one
-of these two: >
- :setlocal cm=zip " weak method, backwards compatible
- :setlocal cm=blowfish " strong method
-Do this before writing the file. When reading an encrypted file it will be
-set automatically to the method used when that file was written. You can
-change 'cryptmethod' before writing that file to change the method.
-To set the default method, used for new files, use one of these in your
-|vimrc| file: >
- set cm=zip
- set cm=blowfish
-The message given for reading and writing a file will show "[crypted]" when
-using zip, "[blowfish]" when using blowfish.
-
-When writing an undo file, the same key and method will be used for the text
-in the undo file. |persistent-undo|.
-
- *E817* *E818* *E819* *E820*
-When encryption does not work properly, you would be able to write your text
-to a file and never be able to read it back. Therefore a test is performed to
-check if the encryption works as expected. If you get one of these errors
-don't write the file encrypted! You need to rebuild the Vim binary to fix
-this.
-
-*E831* This is an internal error, "cannot happen". If you can reproduce it,
-please report to the developers.
-
-When reading a file that has been encrypted and the 'key' option is not empty,
-it will be used for decryption. If the value is empty, you will be prompted
-to enter the key. If you don't enter a key, or you enter the wrong key, the
-file is edited without being decrypted. There is no warning about using the
-wrong key (this makes brute force methods to find the key more difficult).
-
-If want to start reading a file that uses a different key, set the 'key'
-option to an empty string, so that Vim will prompt for a new one. Don't use
-the ":set" command to enter the value, other people can read the command over
-your shoulder.
-
-Since the value of the 'key' option is supposed to be a secret, its value can
-never be viewed. You should not set this option in a vimrc file.
-
-An encrypted file can be recognized by the "file" command, if you add these
-lines to "/etc/magic", "/usr/share/misc/magic" or wherever your system has the
-"magic" file: >
- 0 string VimCrypt~ Vim encrypted file
- >9 string 01 - "zip" cryptmethod
- >9 string 02 - "blowfish" cryptmethod
-
-
-Notes:
-- Encryption is not possible when doing conversion with 'charconvert'.
-- Text you copy or delete goes to the numbered registers. The registers can
- be saved in the .viminfo file, where they could be read. Change your
- 'viminfo' option to be safe.
-- Someone can type commands in Vim when you walk away for a moment, he should
- not be able to get the key.
-- If you make a typing mistake when entering the key, you might not be able to
- get your text back!
-- If you type the key with a ":set key=value" command, it can be kept in the
- history, showing the 'key' value in a viminfo file.
-- There is never 100% safety. The encryption in Vim has not been tested for
- robustness.
-- The algorithm used for 'cryptmethod' "zip" is breakable. A 4 character key
- in about one hour, a 6 character key in one day (on a Pentium 133 PC). This
- requires that you know some text that must appear in the file. An expert
- can break it for any key. When the text has been decrypted, this also means
- that the key can be revealed, and other files encrypted with the same key
- can be decrypted.
-- Pkzip uses the same encryption as 'cryptmethod' "zip", and US Govt has no
- objection to its export. Pkzip's public file APPNOTE.TXT describes this
- algorithm in detail.
-- Vim originates from the Netherlands. That is where the sources come from.
- Thus the encryption code is not exported from the USA.
+ *:X* *E817* *E818* *E819* *E820*
+Support for editing encrypted files has been removed, but may be added back in
+the future. See the following discussions for more information:
+
+ https://github.com/neovim/neovim/issues/694
+ https://github.com/neovim/neovim/issues/701
==============================================================================
10. Timestamps *timestamp* *timestamps*
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 0778cf6122..092994c11d 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2811,7 +2811,7 @@ exists({expr}) The result is a Number, which is non-zero if {expr} is
For checking for a supported feature use |has()|.
Examples: >
- exists("&shortname")
+ exists("&mouse")
exists("$HOSTNAME")
exists("*strftime")
exists("*s:MyFunc")
@@ -5604,7 +5604,6 @@ setwinvar({nr}, {varname}, {val}) *setwinvar()*
sha256({string}) *sha256()*
Returns a String with 64 hex charactes, which is the SHA256
checksum of {string}.
- {only available when compiled with the |+cryptv| feature}
shellescape({string} [, {special}]) *shellescape()*
Escape {string} for use as a shell command argument.
@@ -6681,7 +6680,6 @@ cmdline_hist Compiled with |cmdline-history| support.
cmdline_info Compiled with 'showcmd' and 'ruler' support.
comments Compiled with |'comments'| support.
compatible Compiled to be very Vi compatible.
-cryptv Compiled with encryption support |encryption|.
cscope Compiled with |cscope| support.
debug Compiled with "DEBUG" defined.
dialog_con Compiled with console dialog support.
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index 6792acd390..01ec37b5a0 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1072,7 +1072,6 @@ tag command action ~
|:@@| :@@ repeat the previous ":@"
|:Next| :N[ext] go to previous file in the argument list
|:Print| :P[rint] print lines
-|:X| :X ask for encryption key
|:append| :a[ppend] append text
|:abbreviate| :ab[breviate] enter abbreviation
|:abclear| :abc[lear] remove all abbreviations
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt
index 60454fa8e1..8126a5b458 100644
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -1972,7 +1972,6 @@ self explanatory. Using the long or the short version depends on the
possible
[converted] conversion from 'fileencoding' to
'encoding' done
- [crypted] file was decrypted
[READ ERRORS] not all of the file could be read
diff --git a/runtime/doc/manpages/vim.1 b/runtime/doc/manpages/vim.1
index 820caa24f5..59f21e1b9b 100644
--- a/runtime/doc/manpages/vim.1
+++ b/runtime/doc/manpages/vim.1
@@ -395,9 +395,6 @@ If the {scriptout} file exists, characters are appended.
\-W {scriptout}
Like \-w, but an existing file is overwritten.
.TP
-\-x
-Use encryption when writing files. Will prompt for a crypt key.
-.TP
\-X
Don't connect to the X server. Shortens startup time in a terminal, but the
window title and clipboard will not be used.
diff --git a/runtime/doc/nvim_clipboard.txt b/runtime/doc/nvim_clipboard.txt
index cf38dea3d6..cf63685499 100644
--- a/runtime/doc/nvim_clipboard.txt
+++ b/runtime/doc/nvim_clipboard.txt
@@ -6,25 +6,27 @@
Clipboard integration for Nvim *nvim-clipboard*
-Nvim has no connection to the system clipboard, instead it is accessible
-through the |nvim-provider| infrastructure which transparently uses shell
-commands for communicating with the clipboard.
+Nvim has no direct connection to the system clipboard. Instead, it is
+accessible through the |nvim-provider| infrastructure, which transparently
+uses shell commands for communicating with the clipboard.
-To use clipboard on Nvim, make sure you have one of the following programs
-installed and available on $PATH:
+Clipboard access is implicitly enabled if any of the following clipboard tools
+is found in your `$PATH`.
- xclip
-- xsel(newer alternative to xclip)
-- pbcopy/pbpaste(already available on Mac OS X)
+- xsel (newer alternative to xclip)
+- pbcopy/pbpaste (only for Mac OS X)
-Having any of these programs should enable the '+' and '*' registers. As an
-optional step, set the 'unnamedclip' option to transparently access clipboard
-using the unnamed register. If you use the same |vimrc| for both Vim and Nvim,
-make sure you only set the option when `has('nvim')` is true:
+The presence of a suitable clipboard tool implicitly enables the '+' and '*'
+registers.
+
+If you want to ALWAYS use the clipboard for ALL operations (as opposed
+to interacting with the '+' and/or '*' registers explicitly), set the
+following option:
>
- if has('nvim')
- set unnamedclip
- endif
+ set clipboard+=unnamedplus
<
+See 'clipboard' for details and more options.
+
==============================================================================
vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/nvim_intro.txt b/runtime/doc/nvim_intro.txt
index 8a82a09890..d6389a815d 100644
--- a/runtime/doc/nvim_intro.txt
+++ b/runtime/doc/nvim_intro.txt
@@ -17,7 +17,7 @@ differentiate Nvim from Vim:
2. Job control |job-control|
3. Python plugins |nvim-python|
4. Clipboard integration |nvim-clipboard|
-5. Remote plugins |remote-plugin|
+5. Remote plugins |remote-plugin|
6. Provider infrastructure |nvim-provider|
==============================================================================
diff --git a/runtime/doc/nvim_provider.txt b/runtime/doc/nvim_provider.txt
index e67a5c174c..2ab0510a3b 100644
--- a/runtime/doc/nvim_provider.txt
+++ b/runtime/doc/nvim_provider.txt
@@ -25,7 +25,7 @@ examples of integration with external systems that are implemented in Vim and
are now decoupled from Nvim core as providers:
The first example is clipboard integration: On the original Vim source code,
-clipboard functions account for more than 1k lines of C source code(and that
+clipboard functions account for more than 1k lines of C source code (and that
is just on ui.c). All to peform two tasks that are now accomplished with
simple shell commands such as xclip or pbcopy/pbpaste.
@@ -57,21 +57,20 @@ What these functions do is simple:
implemented, and is called by the "has" vimscript function to check if
features are available.
-The basic idea is that the provider#(name)#Call function should implement
+The basic idea is that the provider#(name)#Call function should implement
integration with an external system, because calling shell commands and
-|msgpack-rpc| clients(Nvim only) is easier to do in vimscript.
+|msgpack-rpc| clients (Nvim only) is easier to do in vimscript.
-Now, back to the python example. Instead of modifying vimscript to allow the
-definition of lowercase functions and commands(for the |:python|, |:pyfile|
-and |:pydo| commands, and the |pyeval()| function), which would break
-backwards compatibility with Vim, we implemented the
+Now, back to the python example. Instead of modifying vimscript to allow for
+the definition of lowercase functions and commands (for the |:python|,
+|:pyfile|, and |:pydo| commands, and the |pyeval()| function), which would
+break backwards compatibility with Vim, we implemented the
autoload/provider/python.vim script and the provider#python#Call function
that is only defined if an external python host is started successfully.
-That works well with the has('python') expression (normally used by python
+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 +python feature.
-
+"think" it is running in a Vim compiled without |+python| feature.
==============================================================================
vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/nvim_python.txt b/runtime/doc/nvim_python.txt
index e60cc93b19..486c25edd0 100644
--- a/runtime/doc/nvim_python.txt
+++ b/runtime/doc/nvim_python.txt
@@ -13,16 +13,16 @@ Python plugins and scripting in Nvim *nvim-python*
1. Introduction *nvim-python-intro*
Through an external python interpreter connected via |msgpack-rpc|, Nvim
-offers some support for the classic |python-vim| interface. For now only the
+offers some support for the legacy |python-vim| interface. For now only the
old Vim 7.3 API is supported.
==============================================================================
2. Quickstart *nvim-python-quickstart*
-If you just want to start using python plugins with Nvim quickly, here's a
-simple step-by-step:
+If you just want to start using Vim python plugins with Nvim quickly, here's a
+simple tutorial:
-- Make sure python 2.6 or 2.7 is available on your `$PATH`
+- Make sure python 2.6 or 2.7 is available in your `$PATH`
- Install the `neovim` python package:
>
$ pip install neovim
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 813ed83be4..0844d74070 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1413,9 +1413,6 @@ A jump table for the options with a short description can be found at |Q_op|.
Note that v:fname_in and v:fname_out will never be the same.
Note that v:charconvert_from and v:charconvert_to may be different
from 'encoding'. Vim internally uses UTF-8 instead of UCS-2 or UCS-4.
- Encryption is not done by Vim when using 'charconvert'. If you want
- to encrypt the file after conversion, 'charconvert' should take care
- of this.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
@@ -2197,36 +2194,8 @@ A jump table for the options with a short description can be found at |Q_op|.
variables overrule the terminal size values obtained
with system specific functions.
-
*'cryptmethod'* *'cm'*
-'cryptmethod' string (default "zip")
- global or local to buffer |global-local|
- {not in Vi}
- Method used for encryption when the buffer is written to a file:
- *pkzip*
- zip PkZip compatible method. A weak kind of encryption.
- Backwards compatible with Vim 7.2 and older.
- *blowfish*
- blowfish Blowfish method. Strong encryption. Requires Vim 7.3
- or later, files can NOT be read by Vim 7.2 and older.
- This adds a "seed" to the file, every time you write
- the file the encrypted bytes will be different.
-
- When reading an encrypted file 'cryptmethod' will be set automatically
- to the detected method of the file being read. Thus if you write it
- without changing 'cryptmethod' the same method will be used.
- Changing 'cryptmethod' does not mark the file as modified, you have to
- explicitly write it, you don't get a warning unless there are other
- modifications. Also see |:X|.
-
- When setting the global value to an empty string, it will end up with
- the value "zip". When setting the local value to an empty string the
- buffer will use the global value.
-
- When a new encryption method is added in a later version of Vim, and
- the current version does not recognize it, you will get *E821* .
- You need to edit this file with the later version of Vim.
-
+'cryptmethod' Removed. {Nvim}
*'cscopepathcomp'* *'cspc'*
'cscopepathcomp' 'cspc' number (default 0)
@@ -4420,23 +4389,8 @@ A jump table for the options with a short description can be found at |Q_op|.
Otherwise only one space is inserted.
NOTE: This option is set when 'compatible' is set.
- *'key'*
-'key' string (default "")
- local to buffer
- {not in Vi}
- {only available when compiled with the |+cryptv|
- feature}
- The key that is used for encrypting and decrypting the current buffer.
- See |encryption| and 'cryptmethod'.
- Careful: Do not set the key value by hand, someone might see the typed
- key. Use the |:X| command. But you can make 'key' empty: >
- :set key=
-< It is not possible to get the value of this option with ":set key" or
- "echo &key". This is to avoid showing it to someone who shouldn't
- know. It also means you cannot see it yourself once you have set it,
- be careful not to make a typing error!
- You can use "&key" in an expression to detect whether encryption is
- enabled. When 'key' is set it returns "*****" (five stars).
+ *'key'*
+'key' Removed. {Nvim}
*'keymap'* *'kmp'* *E544*
'keymap' 'kmp' string (default "")
@@ -6255,17 +6209,7 @@ A jump table for the options with a short description can be found at |Q_op|.
set and to the Vim default value when 'compatible' is reset.
*'shortname'* *'sn'* *'noshortname'* *'nosn'*
-'shortname' 'sn' boolean (default off)
- local to buffer
- {not in Vi, not in MS-DOS versions}
- Filenames are assumed to be 8 characters plus one extension of 3
- characters. Multiple dots in file names are not allowed. When this
- option is on, dots in file names are replaced with underscores when
- adding an extension (".~" or ".swp"). This option is not available
- for MS-DOS, because then it would always be on. This option is useful
- when editing files on an MS-DOS compatible filesystem, e.g., messydos
- or crossdos. When running the Win32 GUI version under Win32s, this
- option is always on by default.
+'shortname' 'sn' Removed. {Nvim}
*'showbreak'* *'sbr'* *E595*
'showbreak' 'sbr' string (default "")
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index a332b6fcc9..9a9e85d421 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -653,7 +653,6 @@ Short explanation of each option: *option-list*
'confirm' 'cf' ask what to do about unsaved/read-only files
'copyindent' 'ci' make 'autoindent' use existing indent structure
'cpoptions' 'cpo' flags for Vi-compatible behavior
-'cryptmethod' 'cm' type of encryption to use for file writing
'cscopepathcomp' 'cspc' how many components of the path to show
'cscopeprg' 'csprg' command to execute cscope
'cscopequickfix' 'csqf' use quickfix window for cscope results
@@ -756,7 +755,6 @@ Short explanation of each option: *option-list*
'iskeyword' 'isk' characters included in keywords
'isprint' 'isp' printable characters
'joinspaces' 'js' two spaces after a period with a join command
-'key' encryption key
'keymap' 'kmp' name of a keyboard mapping
'keymodel' 'km' enable starting/stopping selection with keys
'keywordprg' 'kp' program to use for the "K" command
@@ -859,7 +857,6 @@ Short explanation of each option: *option-list*
'shiftround' 'sr' round indent to multiple of shiftwidth
'shiftwidth' 'sw' number of spaces to use for (auto)indent step
'shortmess' 'shm' list of flags, reduce length of messages
-'shortname' 'sn' non-MS-DOS: Filenames assumed to be 8.3 chars
'showbreak' 'sbr' string to use at the start of wrapped lines
'showcmd' 'sc' show (partial) command in status line
'showfulltag' 'sft' show full tag pattern when completing tag
diff --git a/runtime/doc/recover.txt b/runtime/doc/recover.txt
index 75318b00e6..570340cf0c 100644
--- a/runtime/doc/recover.txt
+++ b/runtime/doc/recover.txt
@@ -33,20 +33,13 @@ with the extension ".swp".
- On Unix, a '.' is prepended to swap file names in the same directory as the
edited file. This avoids that the swap file shows up in a directory
listing.
-- On MS-DOS machines and when the 'shortname' option is on, any '.' in the
- original file name is replaced with '_'.
- If this file already exists (e.g., when you are recovering from a crash) a
warning is given and another extension is used, ".swo", ".swn", etc.
- An existing file will never be overwritten.
- The swap file is deleted as soon as Vim stops editing the file.
-Technical: The replacement of '.' with '_' is done to avoid problems with
- MS-DOS compatible filesystems (e.g., crossdos, multidos). If Vim
- is able to detect that the file is on an MS-DOS-like filesystem, a
- flag is set that has the same effect as the 'shortname' option.
- This flag is reset when you start editing another file.
*E326*
- If the ".swp" file name already exists, the last character is
+Technical: If the ".swp" file name already exists, the last character is
decremented until there is no file with that name or ".saa" is
reached. In the last case, no swap file is created.
@@ -196,42 +189,4 @@ will continue to get warning messages that the ".swp" file already exists.
{Vi: recovers in another way and sends mail if there is something to recover}
-ENCRYPTION AND THE SWAP FILE *:recover-crypt*
-
-When the text file is encrypted the swap file is encrypted as well. This
-makes recovery a bit more complicated. When recovering from a swap file and
-encryption has been used, you will be asked to enter one or two crypt keys.
-
-If the text file does not exist you will only be asked to enter the crypt key
-for the swap file.
-
-If the text file does exist, it may be encrypted in a different way than the
-swap file. You will be asked for the crypt key twice:
-
- Need encryption key for "/tmp/tt" ~
- Enter encryption key: ****** ~
- "/tmp/tt" [crypted] 23200L, 522129C ~
- Using swap file "/tmp/.tt.swp" ~
- Original file "/tmp/tt" ~
- Swap file is encrypted: "/tmp/.tt.swp" ~
- If you entered a new crypt key but did not write the text file, ~
- enter the new crypt key. ~
- If you wrote the text file after changing the crypt key press enter ~
- to use the same key for text file and swap file ~
- Enter encryption key: ~
-
-You can be in one of these two situations:
-
-1. The encryption key was not changed, or after changing the key the text file
- was written. You will be prompted for the crypt key twice. The second
- time you can simply press Enter. That means the same key is used for the
- text file and the swap file.
-2. You entered a new encryption key, but did not save the text file. Vim will
- then use the new key for the swap file, and the text file will still be
- encrypted with the old key. At the second prompt enter the new key.
-
-Note that after recovery the key of the swap file will be used for the text
-file. Thus if you write the text file, you need to use that new key.
-
-
vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/remote_plugin.txt b/runtime/doc/remote_plugin.txt
index ca7e763d1b..e5d1efcc96 100644
--- a/runtime/doc/remote_plugin.txt
+++ b/runtime/doc/remote_plugin.txt
@@ -14,12 +14,12 @@ Nvim support for remote plugins *remote-plugin*
==============================================================================
1. Introduction *remote-plugin-intro*
-A big Nvim goal is to allow extensibility in arbitrary programming languages
-without requiring direct support from the editor. This is achieved with
-remote plugins, coprocesses that have a direct communication channel(via
+Extensibility is a primary goal of Nvim. Any programming language may be used
+to extend nvim without changes to nvim itself. This is achieved with remote
+plugins, coprocesses that have a direct communication channel (via
|msgpack-rpc|) with the Nvim process.
-Even though these plugins are running in separate processes, they can call, be
+Even though these plugins are running in separate processes they can call, be
called, and receive events just as if the code was being executed in the main
process.
@@ -27,24 +27,24 @@ process.
2. Plugin hosts *remote-plugin-hosts*
While plugins can be implemented as arbitrary programs that communicate
-directly with Nvim API and are called via |rpcrequest()| and |rpcnotify()|,
-that is not the best approach available. Instead, developers should first
-check if a plugin host implementation is available for their favorite
-programming language.
+directly with the high-level Nvim API and are called via |rpcrequest()| and
+|rpcnotify()|, that is not the best approach available. Instead, developers
+should first check if a plugin host implementation is available for their
+chosen programming language.
Plugin hosts are programs that provide a high level environment for plugins,
-and also take care of most boilerplate involved in defining commands, autocmds
-and functions that are implemented over msgpack-rpc connections. They are
-loaded the first time one of its registered plugins are required, keeping
-Nvim startup as fast a possible despite the number of installed plugins/hosts.
+taking care of most boilerplate involved in defining commands, autocmds, and
+functions that are implemented over |msgpack-rpc| connections. Hosts are
+loaded only when one of their registered plugins require it, keeping Nvim's
+startup as fast as possible if many plugins/hosts are installed.
==============================================================================
3. Example *remote-plugin-example*
The best way to learn about remote plugins is with an example, so let's see
-how a very useless python plugin looks like. This plugin exports a command, a
-function and an autocmd. The plugin is called 'Limit', and all it does is
-limit the number of requests made to it. Here's the plugin source code:
+what a python plugin looks like. This plugin exports a command, a function and
+an autocmd. The plugin is called 'Limit', and all it does is limit the number
+of requests made to it. Here's the plugin source code:
>
import neovim
@@ -53,7 +53,7 @@ limit the number of requests made to it. Here's the plugin source code:
def __init__(self, vim):
self.vim = vim
self.calls = 0
-
+
@neovim.command('Cmd', range='', nargs='*', sync=True)
def command_handler(self, args, range):
self._increment_calls()
@@ -61,76 +61,75 @@ limit the number of requests made to it. Here's the plugin source code:
'Command: Called %d times, args: %s, range: %s' % (self.calls,
args,
range))
-
+
@neovim.autocmd('BufEnter', pattern='*.py', eval='expand("<afile>")',
sync=True)
def autocmd_handler(self, filename):
self._increment_calls()
self.vim.current.line = (
'Autocmd: Called %s times, file: %s' % (self.calls, filename))
-
+
@neovim.function('Func')
def function_handler(self, args):
self._increment_calls()
self.vim.current.line = (
'Function: Called %d times, args: %s' % (self.calls, args))
-
+
def _increment_calls(self):
if self.calls == 5:
raise Exception('Too many calls!')
self.calls += 1
<
-As can be seen, the plugin is implemented using pure python idioms(classes,
-methods and decorators), the translation between these language-specific
-idioms to vimscript occurs while the plugin manifest is being generated(see
+As can be seen, the plugin is implemented using pure python idioms (classes,
+methods, and decorators), the translation between these language-specific
+idioms to vimscript occurs while the plugin manifest is being generated (see
below).
Notice that the exported command and autocmd are defined with the "sync" flag,
which affects how Nvim calls the plugin: with "sync" the |rpcrequest()|
function is used, which will block Nvim until the handler function returns a
value. Without the "sync" flag, the call is made using a fire and forget
-approach with |rpcnotify()|(return values or exceptions raised in the handler
-function are ignored)
+approach with |rpcnotify()| (return values or exceptions raised in the handler
+function are ignored).
To test the above plugin, it must be saved in "rplugin/python" in a
-'runtimepath' directory(~/.nvim/rplugin/python/limit.py for example).
-Then, the remote plugin manifest must be generated with
-`:UpdateRemotePlugins`.
+'runtimepath' directory (~/.nvim/rplugin/python/limit.py for example). Then,
+the remote plugin manifest must be generated with `:UpdateRemotePlugins`.
==============================================================================
-4. remote plugin manifest *remote-plugin-manifest*
+4. Remote plugin manifest *remote-plugin-manifest*
-Just installing remote plugins to "rplugin/{host}" isn't enough to
-load them at startup. The `:UpdateRemotePlugins` command must be executed
-every time a remote plugin is installed, updated, or deleted.
+Just installing remote plugins to "rplugin/{host}" isn't enough for them to be
+automatically loaded when required. The `:UpdateRemotePlugins` command must be
+executed every time a remote plugin is installed, updated, or deleted.
`:UpdateRemotePlugins` will generate the remote plugin manifest, a special
vimscript file containing declarations for all vimscript entities
(commands/autocommands/functions) defined by all remote plugins, with each
entity associated with the host and plugin path. The manifest can be seen as a
-generated extension to the user's vimrc(it even has the vimrc filename
+generated extension to the user's vimrc (it even has the vimrc filename
prepended).
The manifest declarations are nothing but calls to the remote#host#RegisterPlugin
function, which will take care of bootstrapping the host as soon as the
-declared command, autocommand or function is used for the first time.
+declared command, autocommand, or function is used for the first time.
-The manifest generation step is necessary to keep editor startup fast in
-situations where a user has remote plugins with different hosts. For
-example, imagine a user that has three plugins, for python, java and .NET
-hosts respectively, if we were to load all three plugins at startup, then
-three language runtimes would also be spawned which could take seconds!
+The manifest generation step is necessary to keep Nvim's startup fast in
+situations where a user has remote plugins with different hosts. For example,
+say a user has three plugins, for python, java and .NET hosts respectively. If
+we were to load all three plugins at startup, then three language runtimes
+would also be spawned which could take seconds!
With the manifest, each host will only be loaded when required. Continuing
-with the example, imagine the java plugin is a semantic completion engine for
-java files, if it defines an BufEnter *.java autocommand then the java host
-will only be spawned when java source files are loaded.
-
-If the explicit call to `:UpdateRemotePlugins` seems incovenient, try
-to see it like this: Its a way to give IDE-like capabilities to nvim while
-still keeping it a fast/lightweight editor for general use. It can also be
-seen as an analogous to the |:helptags| facility.
+with the example, say the java plugin is a semantic completion engine for java
+source files. If it defines the autocommand "BufEnter *.java", then the java
+host will only be spawned when files ending with ".java" are loaded.
+
+If the explicit call to `:UpdateRemotePlugins` seems incovenient, try to see
+it like this: It's a way to give IDE-like capabilities to nvim while still
+keeping it fast and lightweight for general use. It can also be seen as
+analogous to the |:helptags| facility.
==============================================================================
vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index d002a3a4ab..dbd87721fc 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -482,14 +482,6 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
":rv" or ":wv" are used. See also |viminfo-file|.
{not in Vi}
- *-x*
--x Use encryption to read/write files. Will prompt for a key,
- which is then stored in the 'key' option. All writes will
- then use this key to encrypt the text. The '-x' argument is
- not needed when reading a file, because there is a check if
- the file that is being read has been encrypted, and Vim asks
- for a key automatically. |encryption|
-
*-X*
-X Do not try connecting to the X server to get the current
window title and copy/paste using the X clipboard. This
@@ -1143,10 +1135,10 @@ vimrc file.
These commands will write ":map" and ":set" commands to a file, in such a way
that when these commands are executed, the current key mappings and options
will be set to the same values. The options 'columns', 'endofline',
-'fileformat', 'key', 'lines', 'modified', 'scroll', 'term', 'ttyfast' and
-'ttymouse' are not included, because these are terminal or file dependent.
-Note that the options 'binary', 'paste' and 'readonly' are included, this
-might not always be what you want.
+'fileformat', 'lines', 'modified', 'scroll', 'term', 'ttyfast' and 'ttymouse'
+are not included, because these are terminal or file dependent. Note that the
+options 'binary', 'paste' and 'readonly' are included, this might not always
+be what you want.
When special keys are used in mappings, The 'cpoptions' option will be
temporarily set to its Vim default, to avoid the mappings to be
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 1cab028bc2..45f3ae6c4a 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -3373,8 +3373,6 @@ Built-in script language:
Patch by Ilya Sher, 2004 Mar 4.
Return a list instead.
char2hex() convert char string to hex string.
- crypt() encrypt string
- decrypt() decrypt string
base64enc() base 64 encoding
base64dec() base 64 decoding
attributes() return file protection flags "drwxrwxrwx"
@@ -4819,8 +4817,7 @@ Digraphs:
Writing files:
- In vim_rename(), should lock "from" file when deleting "to" file for
- systems other than Amiga. Avoids problems with unexpected longname to
- shortname conversion.
+ systems other than Amiga.
8 write mch_isdevice() for Amiga, Mac, VMS, etc.
8 When appending to a file, Vim should also make a backup and a 'patchmode'
file.
diff --git a/runtime/doc/undo.txt b/runtime/doc/undo.txt
index 46469b3533..fba981d4a3 100644
--- a/runtime/doc/undo.txt
+++ b/runtime/doc/undo.txt
@@ -256,9 +256,6 @@ message about that when opening a file.
Undo files are normally saved in the same directory as the file. This can be
changed with the 'undodir' option.
-When the file is encrypted, the text in the undo file is also crypted. The
-same key and method is used. |encryption|
-
You can also save and restore undo histories by using ":wundo" and ":rundo"
respectively:
*:wundo* *:rundo*
@@ -321,13 +318,6 @@ Reading an existing undo file may fail for several reasons:
the undo file cannot be used, it would corrupt the text. This also
happens when 'encoding' differs from when the undo file was written.
*E825* The undo file does not contain valid contents and cannot be used.
-*E826* The undo file is encrypted but decryption failed.
-*E827* The undo file is encrypted but this version of Vim does not support
- encryption. Open the file with another Vim.
-*E832* The undo file is encrypted but 'key' is not set, the text file is not
- encrypted. This would happen if the text file was written by Vim
- encrypted at first, and later overwritten by not encrypted text.
- You probably want to delete this undo file.
"Not reading undo file, owner differs"
The undo file is owned by someone else than the owner of the text
file. For safety the undo file is not used.
diff --git a/runtime/doc/usr_11.txt b/runtime/doc/usr_11.txt
index 9935ded48c..ec404f3301 100644
--- a/runtime/doc/usr_11.txt
+++ b/runtime/doc/usr_11.txt
@@ -283,8 +283,6 @@ machines. Therefore, don't rely on Vim always warning you.
If you really don't want to see this message, you can add the 'A' flag to the
'shortmess' option. But it's very unusual that you need this.
-For remarks about encryption and the swap file, see |:recover-crypt|.
-
==============================================================================
*11.4* Further reading
diff --git a/runtime/doc/usr_23.txt b/runtime/doc/usr_23.txt
index 63cbc612de..0578a63ae5 100644
--- a/runtime/doc/usr_23.txt
+++ b/runtime/doc/usr_23.txt
@@ -6,15 +6,13 @@
This chapter is about editing files that are not ordinary files. With Vim you
-can edit files that are compressed or encrypted. Some files need to be
-accessed over the internet. With some restrictions, binary files can be
-edited as well.
+can edit files that are compressed. Some files need to be accessed over the
+internet. With some restrictions, binary files can be edited as well.
|23.1| DOS, Mac and Unix files
|23.2| Files on the internet
-|23.3| Encryption
-|23.4| Binary files
-|23.5| Compressed files
+|23.3| Binary files
+|23.4| Compressed files
Next chapter: |usr_24.txt| Inserting quickly
Previous chapter: |usr_22.txt| Finding the file to edit
@@ -154,89 +152,7 @@ http://.
For more information, also about passwords, see |netrw|.
==============================================================================
-*23.3* Encryption
-
-Some information you prefer to keep to yourself. For example, when writing
-a test on a computer that students also use. You don't want clever students
-to figure out a way to read the questions before the exam starts. Vim can
-encrypt the file for you, which gives you some protection.
- To start editing a new file with encryption, use the "-x" argument to start
-Vim. Example: >
-
- vim -x exam.txt
-
-Vim prompts you for a key used for encrypting and decrypting the file:
-
- Enter encryption key: ~
-
-Carefully type the secret key now. You cannot see the characters you type,
-they will be replaced by stars. To avoid the situation that a typing mistake
-will cause trouble, Vim asks you to enter the key again:
-
- Enter same key again: ~
-
-You can now edit this file normally and put in all your secrets. When you
-finish editing the file and tell Vim to exit, the file is encrypted and
-written.
- When you edit the file with Vim, it will ask you to enter the same key
-again. You don't need to use the "-x" argument. You can also use the normal
-":edit" command. Vim adds a magic string to the file by which it recognizes
-that the file was encrypted.
- If you try to view this file using another program, all you get is garbage.
-Also, if you edit the file with Vim and enter the wrong key, you get garbage.
-Vim does not have a mechanism to check if the key is the right one (this makes
-it much harder to break the key).
-
-
-SWITCHING ENCRYPTION ON AND OFF
-
-To disable the encryption of a file, set the 'key' option to an empty string:
->
- :set key=
-
-The next time you write the file this will be done without encryption.
- Setting the 'key' option to enable encryption is not a good idea, because
-the password appears in the clear. Anyone shoulder-surfing can read your
-password.
- To avoid this problem, the ":X" command was created. It asks you for an
-encryption key, just like the "-x" argument did: >
-
- :X
- Enter encryption key: ******
- Enter same key again: ******
-
-
-LIMITS ON ENCRYPTION
-
-The encryption algorithm used by Vim is weak. It is good enough to keep out
-the casual prowler, but not good enough to keep out a cryptology expert with
-lots of time on his hands. Also you should be aware that the swap file is not
-encrypted; so while you are editing, people with superuser privileges can read
-the unencrypted text from this file.
- One way to avoid letting people read your swap file is to avoid using one.
-If the -n argument is supplied on the command line, no swap file is used
-(instead, Vim puts everything in memory). For example, to edit the encrypted
-file "file.txt" without a swap file use the following command: >
-
- vim -x -n file.txt
-
-When already editing a file, the swapfile can be disabled with: >
-
- :setlocal noswapfile
-
-Since there is no swapfile, recovery will be impossible. Save the file a bit
-more often to avoid the risk of losing your changes.
-
-While the file is in memory, it is in plain text. Anyone with privilege can
-look in the editor's memory and discover the contents of the file.
- If you use a viminfo file, be aware that the contents of text registers are
-written out in the clear as well.
- If you really want to secure the contents of a file, edit it only on a
-portable computer not connected to a network, use good encryption tools, and
-keep the computer locked up in a big safe when not in use.
-
-==============================================================================
-*23.4* Binary files
+*23.3* Binary files
You can edit binary files with Vim. Vim wasn't really made for this, thus
there are a few restrictions. But you can read a file, change a character and
@@ -322,7 +238,7 @@ the right are ignored.
See the manual page of xxd for more information.
==============================================================================
-*23.5* Compressed files
+*23.4* Compressed files
This is easy: You can edit a compressed file just like any other file. The
"gzip" plugin takes care of decompressing the file when you edit it. And
diff --git a/runtime/doc/usr_toc.txt b/runtime/doc/usr_toc.txt
index d98a999aa4..9e4bf5ca93 100644
--- a/runtime/doc/usr_toc.txt
+++ b/runtime/doc/usr_toc.txt
@@ -198,9 +198,8 @@ Subjects that can be read independently.
|usr_23.txt| Editing other files
|23.1| DOS, Mac and Unix files
|23.2| Files on the internet
- |23.3| Encryption
- |23.4| Binary files
- |23.5| Compressed files
+ |23.3| Binary files
+ |23.4| Compressed files
|usr_24.txt| Inserting quickly
|24.1| Making corrections
diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt
index c3c4ed7cfe..6f639e0fe9 100644
--- a/runtime/doc/various.txt
+++ b/runtime/doc/various.txt
@@ -319,7 +319,6 @@ N *+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.
-N *+cryptv* encryption support |encryption|
B *+cscope* |cscope| support
m *+cursorbind* |'cursorbind'| support
m *+cursorshape* |termcap-cursor-shape| support
diff --git a/runtime/doc/vi_diff.txt b/runtime/doc/vi_diff.txt
index aa90dc94b0..af06302243 100644
--- a/runtime/doc/vi_diff.txt
+++ b/runtime/doc/vi_diff.txt
@@ -751,10 +751,6 @@ switched off by setting the 'updatecount' option to 0 or starting Vim with
the "-n" option. Use the 'directory' option for placing the .swp file
somewhere else.
-Vim is able to work correctly on filesystems with 8.3 file names, also when
-using messydos or crossdos filesystems on the Amiga, or any 8.3 mounted
-filesystem under Unix. See |'shortname'|.
-
Error messages are shown at least one second (Vi overwrites error messages).
If Vim gives the |hit-enter| prompt, you can hit any key. Characters other
@@ -939,8 +935,6 @@ Only Vim is able to accept options in between and after the file names.
-W {name} Vim: Append to script file {name}.
--x Vi, Vim: Ask for encryption key. See |encryption|.
-
-X Vim: Don't connect to the X server.
-y Vim: Start in easy mode, like |evim|.
diff --git a/runtime/optwin.vim b/runtime/optwin.vim
index 22581ed98b..c1e59982cf 100644
--- a/runtime/optwin.vim
+++ b/runtime/optwin.vim
@@ -987,14 +987,6 @@ call append("$", "patchmode\tkeep oldest version of a file; specifies file name
call <SID>OptionG("pm", &pm)
call append("$", "fsync\tforcibly sync the file to disk after writing it")
call <SID>BinOptionG("fs", &fs)
-if !has("msdos")
- call append("$", "shortname\tuse 8.3 file names")
- call append("$", "\t(local to buffer)")
- call <SID>BinOptionL("sn")
-endif
-call append("$", "cryptmethod\tencryption method for file writing: zip or blowfish")
-call append("$", "\t(local to buffer)")
-call <SID>OptionL("cm")
call <SID>Header("the swap file")
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
index c8aebd4bb2..8beb64d045 100644
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -27,22 +27,22 @@ syn match vimCommand contained "\<z[-+^.=]\="
syn keyword vimStdPlugin contained DiffOrig Man N[ext] P[rint] S TOhtml XMLent XMLns
" vimOptions are caught only when contained in a vimSet {{{2
-syn keyword vimOption contained acd ambiwidth arabicshape autowriteall backupdir bdlay binary breakat bufhidden cd ci cinw co commentstring confirm cpoptions cscoperelative csre cursorcolumn delcombine diffopt ea efm ep et fdc fdo ffs filetype fo foldlevelstart formatexpr ft gfw gtt guipty hh hkmap ic imaf iminsert includeexpr inf isident key langmap lines lmap ma matchtime mco ml modeline mousefocus mousetime nrformats ofu para pdev pi previewwindow printmbfont qe relativenumber rightleftcmd ru sbr scrolloff selection shellcmdflag shellxescape showbreak si smartcase softtabstop spelllang sps sta su swb synmaxcol tagbsearch tbi termencoding thesaurus titlestring tpm ttm ttytype undodir ut vfile vop wcm whichwrap wildignore winaltkeys winminwidth wmnu write
+syn keyword vimOption contained acd ambiwidth arabicshape autowriteall backupdir bdlay binary breakat bufhidden cd ci cinw co commentstring confirm cpoptions cscoperelative csre cursorcolumn delcombine diffopt ea efm ep et fdc fdo ffs filetype fo foldlevelstart formatexpr ft gfw gtt guipty hh hkmap ic imaf iminsert includeexpr inf isident langmap lines lmap ma matchtime mco ml modeline mousefocus mousetime nrformats ofu para pdev pi previewwindow printmbfont qe relativenumber rightleftcmd ru sbr scrolloff selection shellcmdflag shellxescape showbreak si smartcase softtabstop spelllang sps sta su swb synmaxcol tagbsearch tbi termencoding thesaurus titlestring tpm ttm ttytype undodir ut vfile vop wcm whichwrap wildignore winaltkeys winminwidth wmnu write
syn keyword vimOption contained ai ambw ari aw backupext beval brk buflisted cdpath cin cinwords cocu compatible cpt cscopetag cst cursorline dex digraph ead ei equalalways eventignore fde fdt fic fillchars foldclose foldmarker formatlistpat gcr ghr guicursor guitablabel hi hkmapp icon imak ims incsearch infercase isk keymap langmenu linespace loadplugins macatsui maxcombine mef mls modelines mousehide mp nu omnifunc paragraphs penc pm printdevice printoptions quoteescape remap rl ruf sc scrollopt selectmode shellpipe shellxquote showcmd sidescroll smartindent sol spellsuggest sr stal sua swf syntax taglength tbidi terse tildeop tl tr tty tw undofile vb vi wa wd wi wildignorecase window winwidth wmw writeany
syn keyword vimOption contained akm anti arshape awa backupskip bex browsedir buftype cedit cindent clipboard cole complete crb cscopetagorder csto cwh dg dip eadirection ek equalprg ex fdi fen fileencoding fk foldcolumn foldmethod formatoptions gd go guifont guitabtooltip hid hkp iconstring imc imsearch inde insertmode iskeyword keymodel laststatus lisp lpl magic maxfuncdepth menuitems mm modifiable mousem mps number opendevice paste pex pmbcs printencoding prompt rdt report rlc ruler scb scs sessionoptions shellquote shiftround showfulltag sidescrolloff smarttab sp spf srr startofline suffixes switchbuf ta tagrelative tbis textauto timeout tm ts ttybuiltin tx undolevels vbs viewdir wak weirdinvert wic wildmenu winfixheight wiv wop writebackup
-syn keyword vimOption contained al antialias autochdir background balloondelay bexpr bk bs casemap cf cink cmdheight colorcolumn completefunc copyindent cryptmethod cscopeverbose csverb debug dict dir eb enc errorbells expandtab fdl fenc fileencodings fkmap foldenable foldminlines formatprg gdefault gp guifontset helpfile hidden hl ignorecase imcmdline imsf indentexpr is isp keywordprg lazyredraw lispwords ls makeef maxmapdepth mfd mmd modified mousemodel msm numberwidth operatorfunc pastetoggle pexpr pmbfn printexpr pt re restorescreen rnu rulerformat scr sect sft shellredir shiftwidth showmatch siso smc spc spl ss statusline suffixesadd sws tabline tags tbs textmode timeoutlen to tsl ttyfast uc undoreload vdir viewoptions warn wfh wig wildmode winfixwidth wiw wrap writedelay
+syn keyword vimOption contained al antialias autochdir background balloondelay bexpr bk bs casemap cf cink cmdheight colorcolumn completefunc copyindent cscopeverbose csverb debug dict dir eb enc errorbells expandtab fdl fenc fileencodings fkmap foldenable foldminlines formatprg gdefault gp guifontset helpfile hidden hl ignorecase imcmdline imsf indentexpr is isp keywordprg lazyredraw lispwords ls makeef maxmapdepth mfd mmd modified mousemodel msm numberwidth operatorfunc pastetoggle pexpr pmbfn printexpr pt re restorescreen rnu rulerformat scr sect sft shellredir shiftwidth showmatch siso smc spc spl ss statusline suffixesadd sws tabline tags tbs textmode timeoutlen to tsl ttyfast uc undoreload vdir viewoptions warn wfh wig wildmode winfixwidth wiw wrap writedelay
syn keyword vimOption contained aleph ar autoindent backspace ballooneval bg bkc bsdir cb cfu cinkeys cmdwinheight columns completeopt cot cscopepathcomp cspc cuc deco dictionary directory ed encoding errorfile exrc fdls fencs fileformat flp foldexpr foldnestmax fp gfm grepformat guifontwide helpheight highlight hlg im imd imstatusfunc indentkeys isf isprint km lbr list lsp makeprg maxmem mh mmp more mouses mzq nuw opfunc patchexpr pfn popt printfont pumheight readonly revins ro runtimepath scroll sections sh shellslash shm showmode sj smd spell splitbelow ssl stl sw sxe tabpagemax tagstack tenc textwidth title toolbar tsr ttym udf updatecount ve viminfo wb wfw wildchar wildoptions winheight wm wrapmargin ws
-syn keyword vimOption contained allowrevins arab autoread backup balloonexpr bh bl bsk cc ch cino cmp com concealcursor cp cscopeprg csprg cul def diff display edcompatible endofline errorformat fcl fdm fex fileformats fml foldignore foldopen fs gfn grepprg guiheadroom helplang history hls imactivatefunc imdisable inc indk isfname joinspaces kmp lcs listchars lw mat maxmempattern mis mmt mouse mouseshape mzquantum odev osfiletype patchmode ph preserveindent printheader pvh redrawtime ri rs sb scrollbind secure shcf shelltemp shortmess showtabline slm sn spellcapcheck splitright ssop stmp swapfile sxq tabstop tal term tf titlelen toolbariconsize ttimeout ttymouse udir updatetime verbose virtualedit wc wh wildcharm wim winminheight wmh wrapscan ww
-syn keyword vimOption contained altkeymap arabic autowrite backupcopy bdir bin bomb bt ccv charconvert cinoptions cms comments conceallevel cpo cscopequickfix csqf cursorbind define diffexpr dy ef eol esckeys fcs fdn ff fileignorecase fmr foldlevel foldtext fsync gfs gtl guioptions hf hk hlsearch imactivatekey imi include inex isi js kp linebreak lm lz matchpairs maxmemtot mkspellmem mod mousef mouset nf oft pa path pheader previewheight printmbcharset pvw regexpengine rightleft rtp sbo scrolljump sel shell shortname shq sm so spellfile spr st sts swapsync syn tag tb termbidi tgst titleold top ttimeoutlen ttyscroll ul ur unnamedclip unc verbosefile visualbell
+syn keyword vimOption contained allowrevins arab autoread backup balloonexpr bh bl bsk cc ch cino cmp com concealcursor cp cscopeprg csprg cul def diff display edcompatible endofline errorformat fcl fdm fex fileformats fml foldignore foldopen fs gfn grepprg guiheadroom helplang history hls imactivatefunc imdisable inc indk isfname joinspaces kmp lcs listchars lw mat maxmempattern mis mmt mouse mouseshape mzquantum odev osfiletype patchmode ph preserveindent printheader pvh redrawtime ri rs sb scrollbind secure shcf shelltemp shortmess showtabline slm spellcapcheck splitright ssop stmp swapfile sxq tabstop tal term tf titlelen toolbariconsize ttimeout ttymouse udir updatetime verbose virtualedit wc wh wildcharm wim winminheight wmh wrapscan ww
+syn keyword vimOption contained altkeymap arabic autowrite backupcopy bdir bin bomb bt ccv charconvert cinoptions cms comments conceallevel cpo cscopequickfix csqf cursorbind define diffexpr dy ef eol esckeys fcs fdn ff fileignorecase fmr foldlevel foldtext fsync gfs gtl guioptions hf hk hlsearch imactivatekey imi include inex isi js kp linebreak lm lz matchpairs maxmemtot mkspellmem mod mousef mouset nf oft pa path pheader previewheight printmbcharset pvw regexpengine rightleft rtp sbo scrolljump sel shell shq sm so spellfile spr st sts swapsync syn tag tb termbidi tgst titleold top ttimeoutlen ttyscroll ul ur unnamedclip unc verbosefile visualbell
" vimOptions: These are the turn-off setting variants {{{2
-syn keyword vimOption contained noacd noallowrevins noantialias noarabic noarshape noautoread noaw noballooneval nobinary nobk nobuflisted nocin noconfirm nocopyindent nocscoperelative nocsre nocuc nocursorcolumn nodelcombine nodigraph noed noendofline noerrorbells noex nofen nofk nogd nohid nohkmap nohkp nohlsearch noicon noim noimcmdline noimdisable noinf noinsertmode nojoinspaces nolazyredraw nolinebreak nolist nolpl noma nomagic noml nomodeline nomodified nomousef nomousehide nonumber noopendevice nopi nopreviewwindow nopvw norelativenumber norestorescreen nori norl noro noru nosb noscb noscs nosft noshelltemp noshortname noshowfulltag noshowmode nosm nosmartindent nosmd nosol nosplitbelow nospr nossl nostartofline noswapfile nota notagrelative notbi notbs noterse notextmode notgst notimeout noto notr nottybuiltin notx noundofile novisualbell nowarn noweirdinvert nowfw nowildignorecase nowinfixheight nowiv nowrap nowrite nowritebackup
-syn keyword vimOption contained noai noaltkeymap noar noarabicshape noautochdir noautowrite noawa nobeval nobl nocf nocindent nocp nocscopetag nocst nocul nocursorline nodg noea noedcompatible noeol noesckeys noexpandtab nofic nofkmap nogdefault nohidden nohkmapp nohls noic noignorecase noimc noimd noincsearch noinfercase nois nojs nolbr nolisp noloadplugins nolz nomacatsui nomh nomod nomodifiable nomore nomousefocus nonu noodev nopaste nopreserveindent noprompt noreadonly noremap norevins norightleft nornu nors noruler nosc noscrollbind nosecure noshellslash noshiftround noshowcmd noshowmatch nosi nosmartcase nosmarttab nosn nospell nosplitright nosr nosta nostmp noswf notagbsearch notagstack notbidi notermbidi notextauto notf notildeop notitle notop nottimeout nottyfast noudf novb nowa nowb nowfh nowic nowildmenu nowinfixwidth nowmnu nowrapscan nowriteany nows
+syn keyword vimOption contained noacd noallowrevins noantialias noarabic noarshape noautoread noaw noballooneval nobinary nobk nobuflisted nocin noconfirm nocopyindent nocscoperelative nocsre nocuc nocursorcolumn nodelcombine nodigraph noed noendofline noerrorbells noex nofen nofk nogd nohid nohkmap nohkp nohlsearch noicon noim noimcmdline noimdisable noinf noinsertmode nojoinspaces nolazyredraw nolinebreak nolist nolpl noma nomagic noml nomodeline nomodified nomousef nomousehide nonumber noopendevice nopi nopreviewwindow nopvw norelativenumber norestorescreen nori norl noro noru nosb noscb noscs nosft noshelltemp noshowfulltag noshowmode nosm nosmartindent nosmd nosol nosplitbelow nospr nossl nostartofline noswapfile nota notagrelative notbi notbs noterse notextmode notgst notimeout noto notr nottybuiltin notx noundofile novisualbell nowarn noweirdinvert nowfw nowildignorecase nowinfixheight nowiv nowrap nowrite nowritebackup
+syn keyword vimOption contained noai noaltkeymap noar noarabicshape noautochdir noautowrite noawa nobeval nobl nocf nocindent nocp nocscopetag nocst nocul nocursorline nodg noea noedcompatible noeol noesckeys noexpandtab nofic nofkmap nogdefault nohidden nohkmapp nohls noic noignorecase noimc noimd noincsearch noinfercase nois nojs nolbr nolisp noloadplugins nolz nomacatsui nomh nomod nomodifiable nomore nomousefocus nonu noodev nopaste nopreserveindent noprompt noreadonly noremap norevins norightleft nornu nors noruler nosc noscrollbind nosecure noshellslash noshiftround noshowcmd noshowmatch nosi nosmartcase nosmarttab nospell nosplitright nosr nosta nostmp noswf notagbsearch notagstack notbidi notermbidi notextauto notf notildeop notitle notop nottimeout nottyfast noudf novb nowa nowb nowfh nowic nowildmenu nowinfixwidth nowmnu nowrapscan nowriteany nows
syn keyword vimOption contained noakm noanti noarab noari noautoindent noautowriteall nobackup nobin nobomb noci nocompatible nocrb nocscopeverbose nocsverb nocursorbind nodeco nodiff noeb noek noequalalways noet noexrc nofileignorecase nofoldenable noguipty nohk
" vimOptions: These are the invertible variants {{{2
-syn keyword vimOption contained invacd invallowrevins invantialias invarabic invarshape invautoread invaw invballooneval invbinary invbk invbuflisted invcin invconfirm invcopyindent invcscoperelative invcsre invcuc invcursorcolumn invdelcombine invdigraph inved invendofline inverrorbells invex invfen invfk invgd invhid invhkmap invhkp invhlsearch invicon invim invimcmdline invimdisable invinf invinsertmode invjoinspaces invlazyredraw invlinebreak invlist invlpl invma invmagic invml invmodeline invmodified invmousef invmousehide invnumber invopendevice invpi invpreviewwindow invpvw invrelativenumber invrestorescreen invri invrl invro invru invsb invscb invscs invsft invshelltemp invshortname invshowfulltag invshowmode invsm invsmartindent invsmd invsol invsplitbelow invspr invssl invstartofline invswapfile invta invtagrelative invtbi invtbs invterse invtextmode invtgst invtimeout invto invtr invttybuiltin invtx invundofile invvisualbell invwarn invweirdinvert invwfw invwildignorecase invwinfixheight invwiv invwrap invwrite invwritebackup
-syn keyword vimOption contained invai invaltkeymap invar invarabicshape invautochdir invautowrite invawa invbeval invbl invcf invcindent invcp invcscopetag invcst invcul invcursorline invdg invea invedcompatible inveol invesckeys invexpandtab invfic invfkmap invgdefault invhidden invhkmapp invhls invic invignorecase invimc invimd invincsearch invinfercase invis invjs invlbr invlisp invloadplugins invlz invmacatsui invmh invmod invmodifiable invmore invmousefocus invnu invodev invpaste invpreserveindent invprompt invreadonly invremap invrevins invrightleft invrnu invrs invruler invsc invscrollbind invsecure invshellslash invshiftround invshowcmd invshowmatch invsi invsmartcase invsmarttab invsn invspell invsplitright invsr invsta invstmp invswf invtagbsearch invtagstack invtbidi invtermbidi invtextauto invtf invtildeop invtitle invtop invttimeout invttyfast invudf invvb invwa invwb invwfh invwic invwildmenu invwinfixwidth invwmnu invwrapscan invwriteany invws
+syn keyword vimOption contained invacd invallowrevins invantialias invarabic invarshape invautoread invaw invballooneval invbinary invbk invbuflisted invcin invconfirm invcopyindent invcscoperelative invcsre invcuc invcursorcolumn invdelcombine invdigraph inved invendofline inverrorbells invex invfen invfk invgd invhid invhkmap invhkp invhlsearch invicon invim invimcmdline invimdisable invinf invinsertmode invjoinspaces invlazyredraw invlinebreak invlist invlpl invma invmagic invml invmodeline invmodified invmousef invmousehide invnumber invopendevice invpi invpreviewwindow invpvw invrelativenumber invrestorescreen invri invrl invro invru invsb invscb invscs invsft invshelltemp invshowfulltag invshowmode invsm invsmartindent invsmd invsol invsplitbelow invspr invssl invstartofline invswapfile invta invtagrelative invtbi invtbs invterse invtextmode invtgst invtimeout invto invtr invttybuiltin invtx invundofile invvisualbell invwarn invweirdinvert invwfw invwildignorecase invwinfixheight invwiv invwrap invwrite invwritebackup
+syn keyword vimOption contained invai invaltkeymap invar invarabicshape invautochdir invautowrite invawa invbeval invbl invcf invcindent invcp invcscopetag invcst invcul invcursorline invdg invea invedcompatible inveol invesckeys invexpandtab invfic invfkmap invgdefault invhidden invhkmapp invhls invic invignorecase invimc invimd invincsearch invinfercase invis invjs invlbr invlisp invloadplugins invlz invmacatsui invmh invmod invmodifiable invmore invmousefocus invnu invodev invpaste invpreserveindent invprompt invreadonly invremap invrevins invrightleft invrnu invrs invruler invsc invscrollbind invsecure invshellslash invshiftround invshowcmd invshowmatch invsi invsmartcase invsmarttab invspell invsplitright invsr invsta invstmp invswf invtagbsearch invtagstack invtbidi invtermbidi invtextauto invtf invtildeop invtitle invtop invttimeout invttyfast invudf invvb invwa invwb invwfh invwic invwildmenu invwinfixwidth invwmnu invwrapscan invwriteany invws
syn keyword vimOption contained invakm invanti invarab invari invautoindent invautowriteall invbackup invbin invbomb invci invcompatible invcrb invcscopeverbose invcsverb invcursorbind invdeco invdiff inveb invek invequalalways invet invexrc invfileignorecase invfoldenable invguipty invhk
" termcap codes (which can also be set) {{{2
diff --git a/scripts/gendeclarations.lua b/scripts/gendeclarations.lua
index bc55b48a0a..9398bbb31c 100755
--- a/scripts/gendeclarations.lua
+++ b/scripts/gendeclarations.lua
@@ -3,9 +3,8 @@
local fname = arg[1]
local static_fname = arg[2]
local non_static_fname = arg[3]
-local cpp = arg[4]
+local preproc_fname = arg[4]
-cpp = cpp:gsub(' %-DINCLUDE_GENERATED_DECLARATIONS ', ' ')
local lpeg = require('lpeg')
@@ -156,15 +155,14 @@ local pattern = concat(
if fname == '--help' then
print'Usage:'
print()
- print' gendeclarations.lua definitions.c static.h non-static.h "cc -E …"'
+ print' gendeclarations.lua definitions.c static.h non-static.h preprocessor.i'
os.exit()
end
-local pipe = io.popen(cpp .. ' -DDO_NOT_DEFINE_EMPTY_ATTRIBUTES ' .. fname, 'r')
-local text = pipe:read('*a')
-if not pipe:close() then
- os.exit(2)
-end
+local preproc_f = io.open(preproc_fname)
+local text = preproc_f:read("*all")
+preproc_f:close()
+
local header = [[
#ifndef DEFINE_FUNC_ATTRIBUTES
@@ -181,7 +179,7 @@ local footer = [[
local non_static = header
local static = header
-local filepattern = '^# %d+ "[^"]-/?([^"/]+)"'
+local filepattern = '^#%a* %d+ "[^"]-/?([^"/]+)"'
local curfile
init = 0
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt
index 184bcc0548..2867857fb3 100644
--- a/src/nvim/CMakeLists.txt
+++ b/src/nvim/CMakeLists.txt
@@ -108,13 +108,15 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
endif()
get_directory_property(gen_cdefs COMPILE_DEFINITIONS)
-foreach(gen_cdef ${gen_cdefs})
- set(gen_cflags "${gen_cflags} -D${gen_cdef}")
+foreach(gen_cdef ${gen_cdefs} DO_NOT_DEFINE_EMPTY_ATTRIBUTES)
+ if(NOT "${gen_cdef}" MATCHES "INCLUDE_GENERATED_DECLARATIONS")
+ list(APPEND gen_cflags "-D${gen_cdef}")
+ endif()
endforeach()
get_directory_property(gen_includes INCLUDE_DIRECTORIES)
foreach(gen_include ${gen_includes})
- set(gen_cflags "${gen_cflags} -I${gen_include}")
+ list(APPEND gen_cflags "-I${gen_include}")
endforeach()
string(TOUPPER "${CMAKE_BUILD_TYPE}" build_type)
set(gen_cflags "${gen_cflags} ${CMAKE_C_FLAGS_${build_type}} ${CMAKE_C_FLAGS}")
@@ -131,11 +133,12 @@ foreach(sfile ${NEOVIM_SOURCES}
endif()
set(gf1 "${GENERATED_DIR}/${r}.c.generated.h")
set(gf2 "${GENERATED_INCLUDES_DIR}/${r}.h.generated.h")
+ set(gf3 "${GENERATED_DIR}/${r}.i")
+ separate_arguments(C_FLAGS_ARRAY UNIX_COMMAND ${CMAKE_C_FLAGS})
add_custom_command(
OUTPUT "${gf1}" "${gf2}"
- COMMAND "${LUA_PRG}" "${HEADER_GENERATOR}"
- "${sfile}" "${gf1}" "${gf2}"
- "${CMAKE_C_COMPILER} ${gen_cflags} -E"
+ COMMAND ${CMAKE_C_COMPILER} ${sfile} -o ${gf3} ${gen_cflags} -E ${C_FLAGS_ARRAY}
+ COMMAND "${LUA_PRG}" "${HEADER_GENERATOR}" "${sfile}" "${gf1}" "${gf2}" "${gf3}"
DEPENDS "${HEADER_GENERATOR}" "${sfile}"
)
list(APPEND NEOVIM_GENERATED_SOURCES "${gf1}")
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c
index 982003a31a..0292e82038 100644
--- a/src/nvim/api/buffer.c
+++ b/src/nvim/api/buffer.c
@@ -132,7 +132,12 @@ ArrayOf(String) buffer_get_line_slice(Buffer buffer,
}
const char *bufstr = (char *) ml_get_buf(buf, (linenr_T) lnum, false);
- rv.items[i] = STRING_OBJ(cstr_to_string(bufstr));
+ Object str = STRING_OBJ(cstr_to_string(bufstr));
+
+ // Vim represents NULs as NLs, but this may confuse clients.
+ strchrsub(str.data.string.data, '\n', '\0');
+
+ rv.items[i] = str;
}
end:
@@ -201,7 +206,18 @@ void buffer_set_line_slice(Buffer buffer,
}
String l = replacement.items[i].data.string;
- lines[i] = xmemdupz(l.data, l.size);
+
+ // Fill lines[i] with l's contents. Disallow newlines in the middle of a
+ // line and convert NULs to newlines to avoid truncation.
+ lines[i] = xmallocz(l.size);
+ for (size_t j = 0; j < l.size; j++) {
+ if (l.data[j] == '\n') {
+ api_set_error(err, Exception, _("string cannot contain newlines"));
+ new_len = i + 1;
+ goto end;
+ }
+ lines[i][j] = (char) (l.data[j] == '\0' ? '\n' : l.data[j]);
+ }
}
try_start();
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index 18e30f8587..b557753bff 100644
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -918,7 +918,7 @@ void ex_diffpatch(exarg_T *eap)
#endif // ifdef UNIX
// Avoid ShellCmdPost stuff
block_autocmds();
- (void)call_shell(buf, kShellOptFilter | kShellOptCooked, NULL);
+ (void)call_shell(buf, kShellOptFilter, NULL);
unblock_autocmds();
}
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index c7f20783a9..d5ef84ff7b 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -3439,6 +3439,7 @@ static int ins_compl_get_exp(pos_T *ini)
int dict_f = 0;
compl_T *old_match;
int set_match_pos;
+ int l_ctrl_x_mode = ctrl_x_mode;
if (!compl_started) {
FOR_ALL_BUFFERS(buf) {
@@ -3458,10 +3459,12 @@ static int ins_compl_get_exp(pos_T *ini)
found_new_match = FAIL;
set_match_pos = FALSE;
+ assert(l_ctrl_x_mode == ctrl_x_mode);
+
/* For ^N/^P pick a new entry from e_cpt if compl_started is off,
* or if found_all says this entry is done. For ^X^L only use the
* entries from 'complete' that look in loaded buffers. */
- if ((ctrl_x_mode == 0 || ctrl_x_mode == CTRL_X_WHOLE_LINE)
+ if ((l_ctrl_x_mode == 0 || l_ctrl_x_mode == CTRL_X_WHOLE_LINE)
&& (!compl_started || found_all)) {
found_all = FALSE;
while (*e_cpt == ',' || *e_cpt == ' ')
@@ -3470,7 +3473,7 @@ static int ins_compl_get_exp(pos_T *ini)
ins_buf = curbuf;
first_match_pos = *ini;
/* So that ^N can match word immediately after cursor */
- if (ctrl_x_mode == 0)
+ if (l_ctrl_x_mode == 0)
dec(&first_match_pos);
last_match_pos = first_match_pos;
type = 0;
@@ -3506,7 +3509,7 @@ static int ins_compl_get_exp(pos_T *ini)
} else if (*e_cpt == NUL)
break;
else {
- if (ctrl_x_mode == CTRL_X_WHOLE_LINE)
+ if (l_ctrl_x_mode == CTRL_X_WHOLE_LINE)
type = -1;
else if (*e_cpt == 'k' || *e_cpt == 's') {
if (*e_cpt == 'k')
@@ -3576,7 +3579,7 @@ static int ins_compl_get_exp(pos_T *ini)
* of matches is found when compl_pattern is empty */
if (find_tags(compl_pattern, &num_matches, &matches,
TAG_REGEXP | TAG_NAMES | TAG_NOIC |
- TAG_INS_COMP | (ctrl_x_mode ? TAG_VERBOSE : 0),
+ TAG_INS_COMP | (l_ctrl_x_mode ? TAG_VERBOSE : 0),
TAG_MANY, curbuf->b_ffname) == OK && num_matches > 0) {
ins_compl_add_matches(num_matches, matches, p_ic);
}
@@ -3635,9 +3638,9 @@ static int ins_compl_get_exp(pos_T *ini)
++msg_silent; /* Don't want messages for wrapscan. */
- /* ctrl_x_mode == CTRL_X_WHOLE_LINE || word-wise search that
+ /* l_ctrl_x_mode == CTRL_X_WHOLE_LINE || word-wise search that
* has added a word that was at the beginning of the line */
- if ( ctrl_x_mode == CTRL_X_WHOLE_LINE
+ if ( l_ctrl_x_mode == CTRL_X_WHOLE_LINE
|| (compl_cont_status & CONT_SOL))
found_new_match = search_for_exact_line(ins_buf, pos,
compl_direction, compl_pattern);
@@ -3668,7 +3671,7 @@ static int ins_compl_get_exp(pos_T *ini)
&& ini->col == pos->col)
continue;
ptr = ml_get_buf(ins_buf, pos->lnum, FALSE) + pos->col;
- if (ctrl_x_mode == CTRL_X_WHOLE_LINE) {
+ if (l_ctrl_x_mode == CTRL_X_WHOLE_LINE) {
if (compl_cont_status & CONT_ADDING) {
if (pos->lnum >= ins_buf->b_ml.ml_line_count)
continue;
@@ -3751,8 +3754,8 @@ static int ins_compl_get_exp(pos_T *ini)
found_new_match = OK;
/* break the loop for specialized modes (use 'complete' just for the
- * generic ctrl_x_mode == 0) or when we've found a new match */
- if ((ctrl_x_mode != 0 && ctrl_x_mode != CTRL_X_WHOLE_LINE)
+ * generic l_ctrl_x_mode == 0) or when we've found a new match */
+ if ((l_ctrl_x_mode != 0 && l_ctrl_x_mode != CTRL_X_WHOLE_LINE)
|| found_new_match != FAIL) {
if (got_int)
break;
@@ -3760,7 +3763,7 @@ static int ins_compl_get_exp(pos_T *ini)
if (type != -1)
ins_compl_check_keys(0);
- if ((ctrl_x_mode != 0 && ctrl_x_mode != CTRL_X_WHOLE_LINE)
+ if ((l_ctrl_x_mode != 0 && l_ctrl_x_mode != CTRL_X_WHOLE_LINE)
|| compl_interrupted)
break;
compl_started = TRUE;
@@ -3776,13 +3779,13 @@ static int ins_compl_get_exp(pos_T *ini)
}
compl_started = TRUE;
- if ((ctrl_x_mode == 0 || ctrl_x_mode == CTRL_X_WHOLE_LINE)
+ if ((l_ctrl_x_mode == 0 || l_ctrl_x_mode == CTRL_X_WHOLE_LINE)
&& *e_cpt == NUL) /* Got to end of 'complete' */
found_new_match = FAIL;
i = -1; /* total of matches, unknown */
if (found_new_match == FAIL
- || (ctrl_x_mode != 0 && ctrl_x_mode != CTRL_X_WHOLE_LINE))
+ || (l_ctrl_x_mode != 0 && l_ctrl_x_mode != CTRL_X_WHOLE_LINE))
i = ins_compl_make_cyclic();
/* If several matches were added (FORWARD) or the search failed and has
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 44caa67847..5ae03c6be3 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -1097,7 +1097,7 @@ do_filter (
*/
if (call_shell(
cmd_buf,
- kShellOptFilter | kShellOptCooked | shell_flags,
+ kShellOptFilter | shell_flags,
NULL
)) {
redraw_later_clear();
@@ -1253,7 +1253,7 @@ do_shell (
if (!swapping_screen())
windgoto(msg_row, msg_col);
cursor_on();
- (void)call_shell(cmd, kShellOptCooked | flags, NULL);
+ (void)call_shell(cmd, flags, NULL);
did_check_timestamps = FALSE;
need_check_timestamps = TRUE;
diff --git a/src/nvim/message.c b/src/nvim/message.c
index cd0c548fb4..5832b2e7cb 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -145,7 +145,7 @@ int verb_msg(char_u *s)
return n;
}
-int msg_attr(char_u *s, int attr)
+int msg_attr(char_u *s, int attr) FUNC_ATTR_NONNULL_ARG(1)
{
return msg_attr_keep(s, attr, FALSE);
}
@@ -156,6 +156,7 @@ msg_attr_keep (
int attr,
int keep /* TRUE: set keep_msg if it doesn't scroll */
)
+ FUNC_ATTR_NONNULL_ARG(1)
{
static int entered = 0;
int retval;
@@ -2623,7 +2624,7 @@ int verbose_open(void)
* Give a warning message (for searching).
* Use 'w' highlighting and may repeat the message after redrawing
*/
-void give_warning(char_u *message, bool hl)
+void give_warning(char_u *message, bool hl) FUNC_ATTR_NONNULL_ARG(1)
{
/* Don't do this for ":silent". */
if (msg_silent != 0)
diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c
index 0c04a7b23e..b6ac3fab82 100644
--- a/src/nvim/msgpack_rpc/channel.c
+++ b/src/nvim/msgpack_rpc/channel.c
@@ -241,6 +241,7 @@ Object channel_send_call(uint64_t id,
if (frame.errored) {
api_set_error(err, Exception, "%s", frame.result.data.string.data);
+ api_free_object(frame.result);
return NIL;
}
@@ -347,7 +348,13 @@ static void job_err(RStream *rstream, void *data, bool eof)
static void job_exit(Job *job, void *data)
{
- free_channel((Channel *)data);
+ Channel *channel = data;
+ // ensure the channel is flagged as closed so channel_send_call frees it
+ // later
+ channel->closed = true;
+ if (!kv_size(channel->call_stack)) {
+ free_channel(channel);
+ }
}
static void parse_msgpack(RStream *rstream, void *data, bool eof)
diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c
index cdd85e4e96..88b7f5c73d 100644
--- a/src/nvim/os/shell.c
+++ b/src/nvim/os/shell.c
@@ -141,7 +141,7 @@ int os_call_shell(char_u *cmd, ShellOpts opts, char_u *extra_arg)
}
if (output) {
- write_output(output, nread);
+ (void)write_output(output, nread, true, true);
free(output);
}
@@ -197,6 +197,9 @@ static int shell(const char *cmd,
// the output buffer
DynamicBuffer buf = DYNAMIC_BUFFER_INIT;
rstream_cb data_cb = system_data_cb;
+ if (nread) {
+ *nread = 0;
+ }
if (forward_output) {
data_cb = out_data_cb;
@@ -296,9 +299,9 @@ static void system_data_cb(RStream *rstream, void *data, bool eof)
static void out_data_cb(RStream *rstream, void *data, bool eof)
{
RBuffer *rbuffer = rstream_buffer(rstream);
- size_t len = rbuffer_pending(rbuffer);
- ui_write((char_u *)rbuffer_read_ptr(rbuffer), (int)len);
- rbuffer_consumed(rbuffer, len);
+ size_t written = write_output(rbuffer_read_ptr(rbuffer),
+ rbuffer_pending(rbuffer), false, eof);
+ rbuffer_consumed(rbuffer, written);
}
/// Parses a command string into a sequence of words, taking quotes into
@@ -407,18 +410,27 @@ static void read_input(DynamicBuffer *buf)
}
}
-static void write_output(char *output, size_t remaining)
+static size_t write_output(char *output, size_t remaining, bool to_buffer,
+ bool eof)
{
if (!output) {
- return;
+ return 0;
}
+ char *start = output;
size_t off = 0;
while (off < remaining) {
if (output[off] == NL) {
// Insert the line
output[off] = NUL;
- ml_append(curwin->w_cursor.lnum++, (char_u *)output, 0, false);
+ if (to_buffer) {
+ ml_append(curwin->w_cursor.lnum++, (char_u *)output, 0, false);
+ } else {
+ // pending data from the output buffer has been flushed to the screen,
+ // safe to call ui_write directly
+ ui_write((char_u *)output, (int)off);
+ ui_write((char_u *)"\r\n", 2);
+ }
size_t skip = off + 1;
output += skip;
remaining -= skip;
@@ -433,14 +445,26 @@ static void write_output(char *output, size_t remaining)
off++;
}
- if (remaining) {
- // append unfinished line
- ml_append(curwin->w_cursor.lnum++, (char_u *)output, 0, false);
- // remember that the NL was missing
- curbuf->b_no_eol_lnum = curwin->w_cursor.lnum;
- } else {
- curbuf->b_no_eol_lnum = 0;
+ if (eof) {
+ if (remaining) {
+ if (to_buffer) {
+ // append unfinished line
+ ml_append(curwin->w_cursor.lnum++, (char_u *)output, 0, false);
+ // remember that the NL was missing
+ curbuf->b_no_eol_lnum = curwin->w_cursor.lnum;
+ } else {
+ ui_write((char_u *)output, (int)remaining);
+ ui_write((char_u *)"\r\n", 2);
+ }
+ output += remaining;
+ } else if (to_buffer) {
+ curbuf->b_no_eol_lnum = 0;
+ }
}
+
+ out_flush();
+
+ return (size_t)(output - start);
}
static void shell_write_cb(WStream *wstream, void *data, int status)
diff --git a/src/nvim/os/shell.h b/src/nvim/os/shell.h
index a4c588d7a3..64e7c79ba7 100644
--- a/src/nvim/os/shell.h
+++ b/src/nvim/os/shell.h
@@ -5,14 +5,13 @@
// Flags for mch_call_shell() second argument
typedef enum {
- kShellOptFilter = 1, ///< filtering text
- kShellOptExpand = 2, ///< expanding wildcards
- kShellOptCooked = 4, ///< set term to cooked mode
- kShellOptDoOut = 8, ///< redirecting output
- kShellOptSilent = 16, ///< don't print error returned by command
- kShellOptRead = 32, ///< read lines and insert into buffer
- kShellOptWrite = 64, ///< write lines from buffer
- kShellOptHideMess = 128, ///< previously a global variable from os_unix.c
+ kShellOptFilter = 1, ///< filtering text
+ kShellOptExpand = 2, ///< expanding wildcards
+ kShellOptDoOut = 4, ///< redirecting output
+ kShellOptSilent = 8, ///< don't print error returned by command
+ kShellOptRead = 16, ///< read lines and insert into buffer
+ kShellOptWrite = 32, ///< write lines from buffer
+ kShellOptHideMess = 64, ///< previously a global variable from os_unix.c
} ShellOpts;
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/os/time.c b/src/nvim/os/time.c
index 3794e813d2..810ddea82b 100644
--- a/src/nvim/os/time.c
+++ b/src/nvim/os/time.c
@@ -54,7 +54,22 @@ void os_delay(uint64_t milliseconds, bool ignoreinput)
/// @param microseconds Number of microseconds to sleep
void os_microdelay(uint64_t microseconds)
{
- microdelay(microseconds);
+ uint64_t elapsed = 0;
+ uint64_t ns = microseconds * 1000; // convert to nanoseconds
+ uint64_t base = uv_hrtime();
+
+ uv_mutex_lock(&delay_mutex);
+
+ while (elapsed < ns) {
+ if (uv_cond_timedwait(&delay_cond, &delay_mutex, ns - elapsed)
+ == UV_ETIMEDOUT)
+ break;
+ uint64_t now = uv_hrtime();
+ elapsed += now - base;
+ base = now;
+ }
+
+ uv_mutex_unlock(&delay_mutex);
}
/// Portable version of POSIX localtime_r()
@@ -88,23 +103,3 @@ struct tm *os_get_localtime(struct tm *result) FUNC_ATTR_NONNULL_ALL
time_t rawtime = time(NULL);
return os_localtime_r(&rawtime, result);
}
-
-static void microdelay(uint64_t microseconds)
-{
- uint64_t elapsed = 0;
- uint64_t ns = microseconds * 1000; // convert to nanoseconds
- uint64_t base = uv_hrtime();
-
- uv_mutex_lock(&delay_mutex);
-
- while (elapsed < ns) {
- if (uv_cond_timedwait(&delay_cond, &delay_mutex, ns - elapsed)
- == UV_ETIMEDOUT)
- break;
- uint64_t now = uv_hrtime();
- elapsed += now - base;
- base = now;
- }
-
- uv_mutex_unlock(&delay_mutex);
-}
diff --git a/src/nvim/strings.c b/src/nvim/strings.c
index 20008bca16..1e619b1c6e 100644
--- a/src/nvim/strings.c
+++ b/src/nvim/strings.c
@@ -237,13 +237,9 @@ char_u *vim_strnsave_up(const char_u *string, size_t len)
void vim_strup(char_u *p)
FUNC_ATTR_NONNULL_ALL
{
- char_u *p2;
char_u c;
-
- if (p != NULL) {
- p2 = p;
- while ((c = *p2) != NUL)
- *p2++ = (char_u)((c < 'a' || c > 'z') ? c : c - 0x20);
+ while ((c = *p) != NUL) {
+ *p++ = (char_u)(c < 'a' || c > 'z' ? c : c - 0x20);
}
}
@@ -525,7 +521,7 @@ void sort_strings(char_u **files, int count)
* When "s" is NULL false is returned.
*/
bool has_non_ascii(const char_u *s)
- FUNC_ATTR_NONNULL_ALL FUNC_ATTR_PURE
+ FUNC_ATTR_PURE
{
const char_u *p;
diff --git a/src/nvim/testdir/dotest.in b/src/nvim/testdir/dotest.in
index b2a0e1a68e..b495f674f8 100644
--- a/src/nvim/testdir/dotest.in
+++ b/src/nvim/testdir/dotest.in
@@ -1,3 +1,3 @@
-:set cp
+:set nocp nomore
:map dotest /^STARTTEST j:set ff=unix cpo-=A :.,/ENDTEST/-1w! Xdotest :set ff& cpo+=A nj0:so! Xdotest dotest
dotest
diff --git a/src/nvim/testdir/test40.in b/src/nvim/testdir/test40.in
index d92a18f3d0..ced4572fb8 100644
--- a/src/nvim/testdir/test40.in
+++ b/src/nvim/testdir/test40.in
@@ -2,6 +2,7 @@ Test for "*Cmd" autocommands
STARTTEST
:so small.vim
+:set wildchar=^E
:/^start/,$w! Xxx " write lines below to Xxx
:au BufReadCmd XtestA 0r Xxx|$del
:e XtestA " will read text of Xxd instead
diff --git a/src/nvim/testdir/test48.in b/src/nvim/testdir/test48.in
index 48f4abbf75..25ea2fa154 100644
--- a/src/nvim/testdir/test48.in
+++ b/src/nvim/testdir/test48.in
@@ -4,7 +4,7 @@ STARTTEST
:so small.vim
:set noswf
:set ve=all
--dgg
+j-dgg
:"
:" Insert "keyword keyw", ESC, C CTRL-N, shows "keyword ykeyword".
:" Repeating CTRL-N fixes it. (Mary Ellen Foster)
diff --git a/src/nvim/testdir/test60.in b/src/nvim/testdir/test60.in
index 8835df9e0c..f0f1aecedd 100644
--- a/src/nvim/testdir/test60.in
+++ b/src/nvim/testdir/test60.in
@@ -2,6 +2,7 @@ Tests for the exists() and has() functions. vim: set ft=vim ts=8 sw=2 :
STARTTEST
:so small.vim
+:set wildchar=^E
:function! RunTest(str, result)
if exists(a:str) == a:result
echo "OK"
diff --git a/src/nvim/testdir/test68.in b/src/nvim/testdir/test68.in
index ceaf9af1ab..ca54e942b5 100644
--- a/src/nvim/testdir/test68.in
+++ b/src/nvim/testdir/test68.in
@@ -30,7 +30,7 @@ STARTTEST
/^{/+1
:set tw=3 fo=t
gqgqo
-a 
+a 
ENDTEST
{
@@ -99,7 +99,7 @@ ENDTEST
STARTTEST
/^{/+2
:set tw& fo=a
-I^^
+I^^
ENDTEST
{
diff --git a/src/nvim/testdir/test69.in b/src/nvim/testdir/test69.in
index 674dc32812..26f41e8a29 100644
--- a/src/nvim/testdir/test69.in
+++ b/src/nvim/testdir/test69.in
@@ -15,7 +15,7 @@ STARTTEST
:set tw=2 fo=t
gqgqjgqgqo
XYZ
-abc XYZ
+abc XYZ
ENDTEST
{
@@ -31,7 +31,7 @@ gqgqjgqgqjgqgqjgqgqjgqgqo
Xa
X a
XY
-X Y
+X Y
ENDTEST
{
@@ -55,7 +55,7 @@ aX
abX
abcX
abX c
-abXY
+abXY
ENDTEST
{
@@ -110,7 +110,7 @@ gqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqo
X YZ
XX
XXa
-XXY
+XXY
ENDTEST
{
diff --git a/src/nvim/testdir/test90.in b/src/nvim/testdir/test90.in
index 6bac414f31..3c0d8c030c 100644
--- a/src/nvim/testdir/test90.in
+++ b/src/nvim/testdir/test90.in
@@ -2,7 +2,7 @@ Tests for sha256() function. vim: set ft=vim et ts=2 sw=2 :
STARTTEST
:so small.vim
-:if !has('cryptv') || !exists('*sha256')
+:if !exists('*sha256')
e! test.ok
wq! test.out
:endif
diff --git a/src/nvim/testdir/test_breakindent.in b/src/nvim/testdir/test_breakindent.in
index 150c9430db..0b00c95a85 100644
--- a/src/nvim/testdir/test_breakindent.in
+++ b/src/nvim/testdir/test_breakindent.in
@@ -3,6 +3,7 @@ Test for breakindent
STARTTEST
:so small.vim
:if !exists("+breakindent") | e! test.ok | w! test.out | qa! | endif
+:set wildchar=^E
:10new|:vsp|:vert resize 20
:put =\"\tabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\"
:set ts=4 sw=4 sts=4 breakindent
diff --git a/src/nvim/testdir/test_breakindent.ok b/src/nvim/testdir/test_breakindent.ok
index d89d424fb3..a530c18fd3 100644
--- a/src/nvim/testdir/test_breakindent.ok
+++ b/src/nvim/testdir/test_breakindent.ok
@@ -33,13 +33,13 @@ Test 4: Simple breakindent + min width: 18
Test 7: breakindent + shift by +1 + nu + sbr=? briopt:sbr
2 ab
-? m
-? x
+ ? m
+ ? x
Test 8: breakindent + shift:1 + nu + sbr=# list briopt:sbr
2 ^Iabcd
-# opq
-# BCD
+ # opq
+ # BCD
Test 9: breakindent + shift by +1 + 'nu' + sbr=# list
2 ^Iabcd
diff --git a/src/nvim/testdir/test_listlbr.in b/src/nvim/testdir/test_listlbr.in
index 75b06b4cc7..36235ea915 100644
--- a/src/nvim/testdir/test_listlbr.in
+++ b/src/nvim/testdir/test_listlbr.in
@@ -3,6 +3,7 @@ Test for linebreak and list option (non-utf8)
STARTTEST
:so small.vim
:if !exists("+linebreak") | e! test.ok | w! test.out | qa! | endif
+:set wildchar=^E
:10new|:vsp|:vert resize 20
:put =\"\tabcdef hijklmn\tpqrstuvwxyz_1060ABCDEFGHIJKLMNOP \"
:norm! zt
diff --git a/src/nvim/testdir/test_listlbr_utf8.in b/src/nvim/testdir/test_listlbr_utf8.in
index ba12adae05..23b3098786 100644
--- a/src/nvim/testdir/test_listlbr_utf8.in
+++ b/src/nvim/testdir/test_listlbr_utf8.in
@@ -3,6 +3,7 @@ Test for linebreak and list option in utf-8 mode
STARTTEST
:so small.vim
:if !exists("+linebreak") | e! test.ok | w! test.out | qa! | endif
+:set wildchar=^E
:so mbyte.vim
:if &enc !=? 'utf-8'|:e! test.ok|:w! test.out|qa!|endif
:10new|:vsp|:vert resize 20
diff --git a/test/functional/api/buffer_spec.lua b/test/functional/api/buffer_spec.lua
index 169d605b63..b85594f7af 100644
--- a/test/functional/api/buffer_spec.lua
+++ b/test/functional/api/buffer_spec.lua
@@ -34,6 +34,11 @@ describe('buffer_* functions', function()
curbuf('del_line', 0)
eq('', curbuf('get_line', 0))
end)
+
+ it('can handle NULs', function()
+ curbuf('set_line', 0, 'ab\0cd')
+ eq('ab\0cd', curbuf('get_line', 0))
+ end)
end)
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua
index f34df8cefb..2c17a2acd0 100644
--- a/test/functional/api/vim_spec.lua
+++ b/test/functional/api/vim_spec.lua
@@ -36,6 +36,10 @@ describe('vim_* functions', function()
-- 19 * 2 (each japanese character occupies two cells)
eq(44, nvim('strwidth', 'neovimのデザインかなりまともなのになってる。'))
end)
+
+ it('cannot handle NULs', function()
+ eq(0, nvim('strwidth', '\0abc'))
+ end)
end)
describe('{get,set}_current_line', function()
@@ -52,6 +56,11 @@ describe('vim_* functions', function()
eq({1, 2, {['3'] = 1}}, nvim('get_var', 'lua'))
eq({1, 2, {['3'] = 1}}, nvim('eval', 'g:lua'))
end)
+
+ it('truncates values with NULs in them', function()
+ nvim('set_var', 'xxx', 'ab\0cd')
+ eq('ab', nvim('get_var', 'xxx'))
+ end)
end)
describe('{get,set}_option', function()
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index b758817b41..15adc3b1c3 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -161,7 +161,7 @@ end
local function clear()
if session then
session:request('vim_command', 'qa!')
- session._async_session._msgpack_stream._loop:exit()
+ session:exit()
end
local loop = Loop.new()
local msgpack_stream = MsgpackStream.new(loop)
diff --git a/test/functional/legacy/033_lisp_indent_spec.lua b/test/functional/legacy/033_lisp_indent_spec.lua
index 3ee248815d..0a5577fad3 100644
--- a/test/functional/legacy/033_lisp_indent_spec.lua
+++ b/test/functional/legacy/033_lisp_indent_spec.lua
@@ -22,7 +22,7 @@ describe('lisp indent', function()
:if-exists :supersede)
(let ((,ti ,title))
(as title ,ti)
- (with center
+ (with center
(as h2 (string-upcase ,ti)))
(brs 3)
,@body))))
@@ -35,7 +35,7 @@ describe('lisp indent', function()
,@body
(princ "</a>")))]])
- execute('set lisp expandtab')
+ execute('set lisp')
execute('/^(defun')
feed('=G:/^(defun/,$yank A<cr>')
@@ -52,15 +52,15 @@ describe('lisp indent', function()
(defmacro page (name title &rest body)
(let ((ti (gensym)))
`(with-open-file (*standard-output*
- (html-file ,name)
- :direction :output
- :if-exists :supersede)
+ (html-file ,name)
+ :direction :output
+ :if-exists :supersede)
(let ((,ti ,title))
- (as title ,ti)
- (with center
- (as h2 (string-upcase ,ti)))
- (brs 3)
- ,@body))))
+ (as title ,ti)
+ (with center
+ (as h2 (string-upcase ,ti)))
+ (brs 3)
+ ,@body))))
;;; Utilities for generating links
diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt
index 03fc720843..9f0e3fac9e 100644
--- a/third-party/CMakeLists.txt
+++ b/third-party/CMakeLists.txt
@@ -54,9 +54,9 @@ endif()
include(ExternalProject)
-set(LIBUV_URL https://github.com/libuv/libuv/archive/v0.11.28.tar.gz)
-set(LIBUV_SHA1 3b70b65467ee693228b8b8385665a52690d74092)
-set(LIBUV_MD5 1a849ba4fc571d531482ed74bc7aabc4)
+set(LIBUV_URL https://github.com/libuv/libuv/archive/v1.0.1.tar.gz)
+set(LIBUV_SHA1 be4edcca18a518153b5e249a17621f2674d7654d)
+set(LIBUV_MD5 c5e4bbf954b8438c57d9414ee54b4d90)
set(MSGPACK_URL https://github.com/msgpack/msgpack-c/archive/ecf4b09acd29746829b6a02939db91dfdec635b4.tar.gz)
set(MSGPACK_SHA1 c160ff99f20d9d0a25bea0a57f4452f1c9bde370)
@@ -71,16 +71,16 @@ set(LUAROCKS_SHA1 61a894fd5d61987bf7e7f9c3e0c5de16ba4b68c4)
set(LUAROCKS_MD5 0f53f42909fbcd2c88be303e8f970516)
set(LIBUNIBILIUM_URL https://github.com/neovim/unibilium/archive/neovim.tar.gz)
-set(LIBUNIBILIUM_SHA1 5d3d4913dd267b14f81fc665e0fa20661d3cb817)
-set(LIBUNIBILIUM_MD5 0657a906164529f1e0f60aba3b876f23)
+set(LIBUNIBILIUM_SHA1 ab22e465150458a4ea91b72de997a35f25df1bcf)
+set(LIBUNIBILIUM_MD5 b0749651429aa4c619baf44eedcd15c6)
set(LIBTERMKEY_URL https://github.com/neovim/libtermkey/archive/neovim.tar.gz)
set(LIBTERMKEY_SHA1 a309038a2297fe4905f03a8807723a9aa07c272a)
set(LIBTERMKEY_MD5 c99e5546da0063fa26dfa7d7f1d5a26f)
set(LIBTICKIT_URL https://github.com/neovim/libtickit/archive/neovim.tar.gz)
-set(LIBTICKIT_SHA1 49e609de29c3bdc3b40d2ade76e69fde6e0d74bc)
-set(LIBTICKIT_MD5 71a5d36d0ef6688d79828aabaf27eb36)
+set(LIBTICKIT_SHA1 08a2aa9ab4bacbeeafefac430691089d829fdb13)
+set(LIBTICKIT_MD5 d2d45eb4f2968b068aa5cc310b7f9abd)
if(USE_BUNDLED_LIBUNIBILIUM)
ExternalProject_Add(libunibilium
@@ -281,7 +281,7 @@ if(USE_BUNDLED_LUAROCKS)
add_custom_command(OUTPUT ${DEPS_LIB_DIR}/luarocks/rocks/nvim-client
COMMAND ${DEPS_BIN_DIR}/luarocks
- ARGS build https://raw.githubusercontent.com/neovim/lua-client/0aefb79d8f60fd180594f376d20144414e1f37a4/nvim-client-0.0.1-3.rockspec CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER} LIBUV_DIR=${DEPS_INSTALL_DIR}
+ ARGS build https://raw.githubusercontent.com/neovim/lua-client/a6c232da23dafe085c5606a3d0a666a77dd7d8bd/nvim-client-0.0.1-7.rockspec CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER} LIBUV_DIR=${DEPS_INSTALL_DIR}
DEPENDS lpeg libuv)
add_custom_target(nvim-client
DEPENDS ${DEPS_LIB_DIR}/luarocks/rocks/nvim-client)