aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt6
-rw-r--r--clint-ignored-files.txt2
-rw-r--r--config/CMakeLists.txt6
-rw-r--r--config/config.h.in12
-rw-r--r--config/versiondef.h.in13
-rw-r--r--runtime/doc/eval.txt5
-rw-r--r--runtime/doc/msgpack_rpc.txt6
-rw-r--r--runtime/doc/nvim_provider.txt26
-rw-r--r--runtime/doc/nvim_python.txt10
-rw-r--r--runtime/doc/remote_plugin.txt6
-rw-r--r--src/nvim/buffer.c3
-rw-r--r--src/nvim/edit.c19
-rw-r--r--src/nvim/eval.c7
-rw-r--r--src/nvim/ex_cmds.c16
-rw-r--r--src/nvim/ex_cmds2.c2
-rw-r--r--src/nvim/ex_docmd.c21
-rw-r--r--src/nvim/ex_getln.c9
-rw-r--r--src/nvim/globals.h17
-rw-r--r--src/nvim/hardcopy.c4
-rw-r--r--src/nvim/memline.c1
-rw-r--r--src/nvim/message.c3
-rw-r--r--src/nvim/misc1.c28
-rw-r--r--src/nvim/msgpack_rpc/remote_ui.c8
-rw-r--r--src/nvim/normal.c6
-rw-r--r--src/nvim/ops.c9
-rw-r--r--src/nvim/option.c38
-rw-r--r--src/nvim/os_unix.c7
-rw-r--r--src/nvim/path.c2
-rw-r--r--src/nvim/screen.c40
-rw-r--r--src/nvim/syntax.c7
-rw-r--r--src/nvim/tag.c4
-rw-r--r--src/nvim/testdir/test77.in30
-rw-r--r--src/nvim/testdir/test77.ok1
-rw-r--r--src/nvim/tui/tui.c2
-rw-r--r--src/nvim/types.h16
-rw-r--r--src/nvim/undo.c4
-rw-r--r--src/nvim/version.c22
-rw-r--r--src/nvim/version.h17
-rw-r--r--src/nvim/version_defs.h56
-rw-r--r--src/nvim/window.c3
-rw-r--r--test/functional/job/job_spec.lua17
-rw-r--r--test/functional/legacy/077_mf_hash_grow_spec.lua45
-rw-r--r--third-party/CMakeLists.txt54
-rw-r--r--third-party/cmake/DownloadAndExtractFile.cmake28
44 files changed, 249 insertions, 389 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4f6c3513b7..1af79e60a8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -187,15 +187,15 @@ include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS})
find_package(LuaJit REQUIRED)
include_directories(SYSTEM ${LUAJIT_INCLUDE_DIRS})
-set(LIBUNIBILIUM_USE_STATIC ON)
+option(LIBUNIBILIUM_USE_STATIC "Use static libunibilium" ON)
find_package(LibUnibilium REQUIRED)
include_directories(SYSTEM ${LIBUNIBILIUM_INCLUDE_DIRS})
-set(LIBTERMKEY_USE_STATIC ON)
+option(LIBTERMKEY_USE_STATIC "Use static libtermkey" ON)
find_package(LibTermkey REQUIRED)
include_directories(SYSTEM ${LIBTERMEY_INCLUDE_DIRS})
-set(LIBVTERM_USE_STATIC ON)
+option(LIBVTERM_USE_STATIC "Use static libvterm" ON)
find_package(LibVterm REQUIRED)
include_directories(SYSTEM ${LIBVTERM_INCLUDE_DIRS})
diff --git a/clint-ignored-files.txt b/clint-ignored-files.txt
index 1d9b6f9a7f..e0e6b9f3d2 100644
--- a/clint-ignored-files.txt
+++ b/clint-ignored-files.txt
@@ -119,7 +119,6 @@ src/nvim/tag.h
src/nvim/term.c
src/nvim/term.h
src/nvim/term_defs.h
-src/nvim/types.h
src/nvim/ui.c
src/nvim/ui.h
src/nvim/undo.c
@@ -127,7 +126,6 @@ src/nvim/undo.h
src/nvim/undo_defs.h
src/nvim/version.c
src/nvim/version.h
-src/nvim/version_defs.h
src/nvim/vim.h
src/nvim/window.c
src/nvim/window.h
diff --git a/config/CMakeLists.txt b/config/CMakeLists.txt
index 1ee5c78adf..0d3ef62297 100644
--- a/config/CMakeLists.txt
+++ b/config/CMakeLists.txt
@@ -79,6 +79,12 @@ configure_file (
"${PROJECT_BINARY_DIR}/config/auto/config.h"
)
+# generate version definitions
+configure_file (
+ "${PROJECT_SOURCE_DIR}/config/versiondef.h.in"
+ "${PROJECT_BINARY_DIR}/config/auto/versiondef.h"
+ )
+
# generate pathdef.c
find_program(WHOAMI_PROG whoami)
find_program(HOSTNAME_PROG hostname)
diff --git a/config/config.h.in b/config/config.h.in
index 9e6f3d8e13..a3cd72b57c 100644
--- a/config/config.h.in
+++ b/config/config.h.in
@@ -1,11 +1,5 @@
-#define NVIM_VERSION_MAJOR @NVIM_VERSION_MAJOR@
-#define NVIM_VERSION_MINOR @NVIM_VERSION_MINOR@
-#define NVIM_VERSION_PATCH @NVIM_VERSION_PATCH@
-#define NVIM_VERSION_PRERELEASE "@NVIM_VERSION_PRERELEASE@"
-#define NVIM_VERSION_BUILD "@NVIM_VERSION_BUILD@"
-#define NVIM_VERSION_COMMIT "@NVIM_VERSION_COMMIT@"
-#define NVIM_VERSION_CFLAGS "@NVIM_VERSION_CFLAGS@"
-#define NVIM_VERSION_BUILD_TYPE "@NVIM_VERSION_BUILD_TYPE@"
+#ifndef AUTO_CONFIG_H
+#define AUTO_CONFIG_H
#cmakedefine DEBUG
@@ -72,3 +66,5 @@
#define FEAT_BROWSE
#define FEAT_CSCOPE
#define FEAT_MOUSE
+
+#endif // AUTO_CONFIG_H
diff --git a/config/versiondef.h.in b/config/versiondef.h.in
new file mode 100644
index 0000000000..a177e599ba
--- /dev/null
+++ b/config/versiondef.h.in
@@ -0,0 +1,13 @@
+#ifndef AUTO_VERSIONDEF_H
+#define AUTO_VERSIONDEF_H
+
+#define NVIM_VERSION_MAJOR @NVIM_VERSION_MAJOR@
+#define NVIM_VERSION_MINOR @NVIM_VERSION_MINOR@
+#define NVIM_VERSION_PATCH @NVIM_VERSION_PATCH@
+#define NVIM_VERSION_PRERELEASE "@NVIM_VERSION_PRERELEASE@"
+#define NVIM_VERSION_BUILD "@NVIM_VERSION_BUILD@"
+#define NVIM_VERSION_COMMIT "@NVIM_VERSION_COMMIT@"
+#define NVIM_VERSION_CFLAGS "@NVIM_VERSION_CFLAGS@"
+#define NVIM_VERSION_BUILD_TYPE "@NVIM_VERSION_BUILD_TYPE@"
+
+#endif // AUTO_VERSIONDEF_H
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index c4d84c36c3..b303ad61b1 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -4019,8 +4019,9 @@ jobsend({job}, {data}) {Nvim} *jobsend()*
{data} may be a string, string convertible, or a list. If
{data} is a list, the items will be separated by newlines and
- any newlines in an item will be sent as a NUL. For example: >
- :call jobsend(j, ["abc", "123\n456"])
+ any newlines in an item will be sent as a NUL. A final newline
+ can be sent by adding a final empty string. For example: >
+ :call jobsend(j, ["abc", "123\n456", ""])
< will send "abc<NL>123<NUL>456<NL>".
jobstart({name}, {prog}[, {argv}]) {Nvim} *jobstart()*
diff --git a/runtime/doc/msgpack_rpc.txt b/runtime/doc/msgpack_rpc.txt
index af4ef3e132..121b47167b 100644
--- a/runtime/doc/msgpack_rpc.txt
+++ b/runtime/doc/msgpack_rpc.txt
@@ -60,7 +60,7 @@ There are two ways to obtain API metadata:
separate compilation step.
Here's a simple way to get human-readable description of the API (requires
-python and the `pyyaml`/`msgpack-python` pip packages):
+Python and the `pyyaml`/`msgpack-python` pip packages):
>
nvim --api-info | python -c 'import msgpack, sys, yaml; print yaml.dump(msgpack.unpackb(sys.stdin.read()))' > api.yaml
@@ -108,7 +108,7 @@ string 'hello world!' on the current nvim instance:
nvim = MessagePack::RPC::Client.new(MessagePack::RPC::UNIXTransport.new, ENV['NVIM_LISTEN_ADDRESS'])
result = nvim.call(:vim_command, 'echo "hello world!"')
<
-A better way is to use the python REPL with the `neovim` package, where API
+A better way is to use the Python REPL with the `neovim` package, where API
functions can be called interactively:
>
>>> from neovim import attach
@@ -119,7 +119,7 @@ functions can be called interactively:
4. Implementing new clients *msgpack-rpc-clients*
Nvim is still in alpha, so there's no in-depth documentation explaining how to
-properly implement a client library yet. The python client (the pip package
+properly implement a client library yet. The Python client (the pip package
"neovim") will always be up-to-date with the latest API changes, so its source
code is the best documentation currently available. There are some guidelines
however:
diff --git a/runtime/doc/nvim_provider.txt b/runtime/doc/nvim_provider.txt
index 2ab0510a3b..cea55a6656 100644
--- a/runtime/doc/nvim_provider.txt
+++ b/runtime/doc/nvim_provider.txt
@@ -10,10 +10,10 @@ First of all, this document is meant to be read by developers interested in
contributing to the refactoring effort. If you are a normal user or plugin
developer looking to learn about Nvim |msgpack-rpc| infrastructure for
implementing plugins in other programming languages, see |external-plugin|.
-For instructions on how to enable python plugins, see |nvim-python|. For
+For instructions on how to enable Python plugins, see |nvim-python|. For
clipboard, see |nvim-clipboard|.
-Instead of doing everything by itself, Nvim aims to simplify it's own
+Instead of doing everything by itself, Nvim aims to simplify its own
maintenance by delegating as much work as possible to external systems. But
some Vim components are too tightly coupled and in some cases the refactoring
work necessary to swap in-house implementations by code that integrates to
@@ -24,18 +24,18 @@ To understand why the provider infrastructure is useful, let us consider two
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,
+The first example is clipboard integration: in the original Vim source code,
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
+is just on ui.c), all to peform two tasks that are now accomplished with
simple shell commands such as xclip or pbcopy/pbpaste.
-The other example is python scripting support: Vim has three files dedicated
-to embed the python interpreter: if_python.c, if_python3.c and if_py_both.h.
-Together these files sum about 9.5k lines of C source code. On Nvim, python
+The other example is Python scripting support: Vim has three files dedicated
+to embed the Python interpreter: if_python.c, if_python3.c and if_py_both.h.
+Together these files sum about 9.5k lines of C source code. On Nvim, Python
scripting is performed by an external host process that is running 2k sloc
-python program.
+Python program.
-In a perfect world, we would implement python and clipboard integration in
+In a perfect world, we would implement Python and clipboard integration in
pure vimscript and without touching the C code. Unfortunately we can't achieve
these goals without severly compromising backwards compatibility with Vim.
Thats where providers comes to rescue.
@@ -61,15 +61,15 @@ 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.
-Now, back to the python example. Instead of modifying vimscript to allow for
+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 is only defined if an external Python host is started successfully.
-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
+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.
==============================================================================
diff --git a/runtime/doc/nvim_python.txt b/runtime/doc/nvim_python.txt
index 486c25edd0..4d80fe941f 100644
--- a/runtime/doc/nvim_python.txt
+++ b/runtime/doc/nvim_python.txt
@@ -12,22 +12,22 @@ Python plugins and scripting in Nvim *nvim-python*
==============================================================================
1. Introduction *nvim-python-intro*
-Through an external python interpreter connected via |msgpack-rpc|, Nvim
+Through an external Python interpreter connected via |msgpack-rpc|, Nvim
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 Vim python plugins with Nvim quickly, here's a
+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 in your `$PATH`
-- Install the `neovim` python package:
+- Make sure Python 2.6 or 2.7 is available in your `$PATH`
+- Install the `neovim` Python package:
>
$ pip install neovim
<
-Most python plugins created for Vim 7.3 should work after these steps.
+Most Python plugins created for Vim 7.3 should work after these steps.
==============================================================================
vim:tw=78:ts=8:noet:ft=help:norl:
diff --git a/runtime/doc/remote_plugin.txt b/runtime/doc/remote_plugin.txt
index e5d1efcc96..7394cf7fe4 100644
--- a/runtime/doc/remote_plugin.txt
+++ b/runtime/doc/remote_plugin.txt
@@ -42,7 +42,7 @@ 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
-what a python plugin looks like. This plugin exports a command, a function and
+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:
>
@@ -81,7 +81,7 @@ of requests made to it. Here's the plugin source code:
self.calls += 1
<
-As can be seen, the plugin is implemented using pure python idioms (classes,
+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).
@@ -117,7 +117,7 @@ declared command, autocommand, or function is used for the first time.
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
+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!
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index fa25b68641..c4abcd77b1 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -70,6 +70,7 @@
#include "nvim/syntax.h"
#include "nvim/ui.h"
#include "nvim/undo.h"
+#include "nvim/version.h"
#include "nvim/window.h"
#include "nvim/os/os.h"
#include "nvim/os/time.h"
@@ -4033,8 +4034,6 @@ void do_modelines(int flags)
--entered;
}
-#include "nvim/version_defs.h" /* for version number */
-
/*
* chk_modeline() - check a single line for a mode string
* Return FAIL if an error encountered.
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index c0bd8cc8fd..c6716dc870 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -268,13 +268,11 @@ edit (
// set Insstart_orig to Insstart
update_Insstart_orig = true;
-#ifdef HAVE_SANDBOX
- /* Don't allow inserting in the sandbox. */
+ // Don't allow inserting in the sandbox.
if (sandbox != 0) {
EMSG(_(e_sandbox));
return FALSE;
}
-#endif
/* Don't allow changes in the buffer while editing the cmdline. The
* caller of getcmdline() may get confused. */
if (textlock != 0) {
@@ -584,9 +582,6 @@ edit (
old_topline = curwin->w_topline;
old_topfill = curwin->w_topfill;
-#ifdef USE_ON_FLY_SCROLL
- dont_scroll = FALSE; /* allow scrolling here */
-#endif
/*
* Get a character for Insert mode. Ignore K_IGNORE.
@@ -4703,9 +4698,6 @@ int get_literal(void)
if (got_int)
return Ctrl_C;
-#ifdef USE_ON_FLY_SCROLL
- dont_scroll = TRUE; /* disallow scrolling here */
-#endif
++no_mapping; /* don't map the next key hits */
cc = 0;
i = 0;
@@ -4964,9 +4956,6 @@ insertchar (
* Don't do this when there an InsertCharPre autocommand is defined,
* because we need to fire the event for every character.
*/
-#ifdef USE_ON_FLY_SCROLL
- dont_scroll = FALSE; /* allow scrolling here */
-#endif
if ( !ISSPECIAL(c)
&& (!has_mbyte || (*mb_char2len)(c) == 1)
@@ -6731,9 +6720,6 @@ static void ins_reg(void)
add_to_showcmd_c(Ctrl_R);
}
-#ifdef USE_ON_FLY_SCROLL
- dont_scroll = TRUE; /* disallow scrolling here */
-#endif
/*
* Don't map the register name. This also prevents the mode message to be
@@ -8058,9 +8044,6 @@ static int ins_digraph(void)
add_to_showcmd_c(Ctrl_K);
}
-#ifdef USE_ON_FLY_SCROLL
- dont_scroll = TRUE; /* disallow scrolling here */
-#endif
/* don't map the digraph chars. This also prevents the
* mode message to be deleted when ESC is hit */
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 45355bd7ac..ae8e0d329f 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -351,7 +351,6 @@ typedef enum {
* The reason to use this table anyway is for very quick access to the
* variables with the VV_ defines.
*/
-#include "nvim/version_defs.h"
/* values for vv_flags: */
#define VV_COMPAT 1 /* compatible, also used without "v:" */
@@ -9479,7 +9478,9 @@ static void getpos_both(typval_T *argvars, typval_T *rettv, bool getcurpos)
list_append_number(l,
(fp != NULL) ? (varnumber_T)fp->coladd : (varnumber_T)0);
if (getcurpos) {
- list_append_number(l, (varnumber_T) curwin->w_curswant + 1);
+ list_append_number(l, curwin->w_curswant == MAXCOL
+ ? (varnumber_T)MAXCOL
+ : (varnumber_T)curwin->w_curswant + 1);
}
}
@@ -10656,7 +10657,7 @@ static void f_jobsend(typval_T *argvars, typval_T *rettv)
}
ssize_t input_len;
- char *input = (char *) save_tv_as_string(&argvars[1], &input_len, true);
+ char *input = (char *) save_tv_as_string(&argvars[1], &input_len, false);
if (!input) {
// Either the error has been handled by save_tv_as_string(), or there is no
// input to send.
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 3dde055c2a..e98032da5c 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -19,7 +19,6 @@
#include "nvim/vim.h"
#include "nvim/ascii.h"
-#include "nvim/version_defs.h"
#include "nvim/ex_cmds.h"
#include "nvim/buffer.h"
#include "nvim/charset.h"
@@ -64,6 +63,7 @@
#include "nvim/tempfile.h"
#include "nvim/ui.h"
#include "nvim/undo.h"
+#include "nvim/version.h"
#include "nvim/window.h"
#include "nvim/os/os.h"
#include "nvim/os/shell.h"
@@ -1708,7 +1708,7 @@ static void do_viminfo(FILE *fp_in, FILE *fp_out, int flags)
if (fp_out != NULL) {
/* Write the info: */
fprintf(fp_out, _("# This viminfo file was generated by Nvim %s.\n"),
- NVIM_VERSION_MEDIUM);
+ mediumVersion);
fputs(_("# You may edit it if you're careful!\n\n"), fp_out);
fputs(_("# Value of 'encoding' when this file was written\n"), fp_out);
fprintf(fp_out, "*encoding=%s\n\n", p_enc);
@@ -3396,16 +3396,13 @@ int check_secure(void)
EMSG(_(e_curdir));
return TRUE;
}
-#ifdef HAVE_SANDBOX
- /*
- * In the sandbox more things are not allowed, including the things
- * disallowed in secure mode.
- */
+
+ // In the sandbox more things are not allowed, including the things
+ // disallowed in secure mode.
if (sandbox != 0) {
EMSG(_(e_sandbox));
return TRUE;
}
-#endif
return FALSE;
}
@@ -3952,9 +3949,6 @@ void do_sub(exarg_T *eap)
ui_cursor_goto(msg_row, msg_col);
RedrawingDisabled = temp;
-#ifdef USE_ON_FLY_SCROLL
- dont_scroll = FALSE; /* allow scrolling here */
-#endif
++no_mapping; /* don't map this key */
++allow_keys; /* allow special keys */
typed = plain_vgetc();
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c
index ffafe3cffb..44cb2d48a2 100644
--- a/src/nvim/ex_cmds2.c
+++ b/src/nvim/ex_cmds2.c
@@ -21,7 +21,7 @@
#ifdef HAVE_LOCALE_H
# include <locale.h>
#endif
-#include "nvim/version_defs.h"
+#include "nvim/version.h"
#include "nvim/ex_cmds2.h"
#include "nvim/buffer.h"
#include "nvim/charset.h"
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 22ffd67fdd..4e835cc43a 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -1093,9 +1093,7 @@ static char_u * do_one_cmd(char_u **cmdlinep,
int save_msg_scroll = msg_scroll;
int save_msg_silent = -1;
int did_esilent = 0;
-#ifdef HAVE_SANDBOX
int did_sandbox = FALSE;
-#endif
cmdmod_T save_cmdmod;
int ni; /* set when Not Implemented */
@@ -1240,11 +1238,9 @@ static char_u * do_one_cmd(char_u **cmdlinep,
continue;
case 's': if (checkforcmd(&ea.cmd, "sandbox", 3)) {
-#ifdef HAVE_SANDBOX
if (!did_sandbox)
++sandbox;
did_sandbox = TRUE;
-#endif
continue;
}
if (!checkforcmd(&ea.cmd, "silent", 3))
@@ -1509,13 +1505,11 @@ static char_u * do_one_cmd(char_u **cmdlinep,
}
if (!ea.skip) {
-#ifdef HAVE_SANDBOX
if (sandbox != 0 && !(ea.argt & SBOXOK)) {
/* Command not allowed in sandbox. */
errormsg = (char_u *)_(e_sandbox);
goto doend;
}
-#endif
if (!curbuf->b_p_ma && (ea.argt & MODIFY)) {
/* Command not allowed in non-'modifiable' buffer */
errormsg = (char_u *)_(e_modifiable);
@@ -1983,10 +1977,8 @@ doend:
msg_col = 0;
}
-#ifdef HAVE_SANDBOX
if (did_sandbox)
--sandbox;
-#endif
if (ea.nextcmd && *ea.nextcmd == NUL) /* not really a next command */
ea.nextcmd = NULL;
@@ -2582,12 +2574,10 @@ set_one_cmd_context (
}
/* An argument can contain just about everything, except
* characters that end the command and white space. */
- else if (c == '|' || c == '\n' || c == '"' || (vim_iswhite(c)
-#ifdef SPACE_IN_FILENAME
- && (!(ea.argt & NOSPC) ||
- usefilter)
-#endif
- )) {
+ else if (c == '|'
+ || c == '\n'
+ || c == '"'
+ || vim_iswhite(c)) {
len = 0; /* avoid getting stuck when space is in 'isfname' */
while (*p != NUL) {
if (has_mbyte)
@@ -6617,9 +6607,6 @@ static void ex_at(exarg_T *eap)
curwin->w_cursor.lnum = eap->line2;
-#ifdef USE_ON_FLY_SCROLL
- dont_scroll = TRUE; /* disallow scrolling here */
-#endif
/* get the register name. No name means to use the previous one */
c = *eap->arg;
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 3dffb1f1d3..a7bb4afa70 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -291,9 +291,6 @@ getcmdline (
redir_off = TRUE; /* Don't redirect the typed command.
Repeated, because a ":redir" inside
completion may switch it on. */
-#ifdef USE_ON_FLY_SCROLL
- dont_scroll = FALSE; /* allow scrolling here */
-#endif
quit_more = FALSE; /* reset after CTRL-D which had a more-prompt */
cursorcmd(); /* set the cursor on the right spot */
@@ -904,9 +901,6 @@ getcmdline (
goto returncmd; /* back to cmd mode */
case Ctrl_R: /* insert register */
-#ifdef USE_ON_FLY_SCROLL
- dont_scroll = TRUE; /* disallow scrolling here */
-#endif
putcmdline('"', TRUE);
++no_mapping;
i = c = plain_vgetc(); /* CTRL-R <char> */
@@ -1270,9 +1264,6 @@ getcmdline (
case Ctrl_K:
ignore_drag_release = TRUE;
putcmdline('?', TRUE);
-#ifdef USE_ON_FLY_SCROLL
- dont_scroll = TRUE; /* disallow scrolling here */
-#endif
c = get_digraph(TRUE);
if (c != NUL)
break;
diff --git a/src/nvim/globals.h b/src/nvim/globals.h
index c0d5217fc2..b15db61f99 100644
--- a/src/nvim/globals.h
+++ b/src/nvim/globals.h
@@ -457,11 +457,8 @@ typedef enum {
'*', '#', '_', '!', '.', 'o'}
EXTERN int highlight_attr[HLF_COUNT]; /* Highl. attr for each context. */
-# define USER_HIGHLIGHT
-#ifdef USER_HIGHLIGHT
EXTERN int highlight_user[9]; /* User[1-9] attributes */
EXTERN int highlight_stlnc[9]; /* On top of user */
-#endif
EXTERN int cterm_normal_fg_color INIT(= 0);
EXTERN int cterm_normal_fg_bold INIT(= 0);
EXTERN int cterm_normal_bg_color INIT(= 0);
@@ -622,7 +619,6 @@ EXTERN int allbuf_lock INIT(= 0);
* changed, no buffer can be deleted and
* current directory can't be changed.
* Used for SwapExists et al. */
-# define HAVE_SANDBOX
EXTERN int sandbox INIT(= 0);
/* Non-zero when evaluating an expression in a
* "sandbox". Several things are not allowed
@@ -838,13 +834,6 @@ EXTERN int ctrl_x_mode INIT(= 0); /* Which Ctrl-X mode are we in? */
EXTERN int no_abbr INIT(= TRUE); /* TRUE when no abbreviations loaded */
-#ifdef USE_EXE_NAME
-EXTERN char_u *exe_name; /* the name of the executable */
-#endif
-
-#ifdef USE_ON_FLY_SCROLL
-EXTERN int dont_scroll INIT(= FALSE); /* don't use scrollbars when TRUE */
-#endif
EXTERN int mapped_ctrl_c INIT(= FALSE); /* CTRL-C is mapped */
EXTERN cmdmod_T cmdmod; /* Ex command modifiers */
@@ -978,10 +967,6 @@ EXTERN int wild_menu_showing INIT(= 0);
EXTERN char breakat_flags[256]; /* which characters are in 'breakat' */
-/* these are in version.c */
-extern char *Version;
-extern char *longVersion;
-
/*
* Some file names are stored in pathdef.c, which is generated from the
* Makefile to make their value depend on the Makefile.
@@ -1180,9 +1165,7 @@ EXTERN char_u e_readonlyvar[] INIT(= N_(
EXTERN char_u e_readonlysbx[] INIT(= N_(
"E794: Cannot set variable in the sandbox: \"%s\""));
EXTERN char_u e_readerrf[] INIT(= N_("E47: Error while reading errorfile"));
-#ifdef HAVE_SANDBOX
EXTERN char_u e_sandbox[] INIT(= N_("E48: Not allowed in sandbox"));
-#endif
EXTERN char_u e_secure[] INIT(= N_("E523: Not allowed here"));
EXTERN char_u e_screenmode[] INIT(= N_(
"E359: Screen mode setting not supported"));
diff --git a/src/nvim/hardcopy.c b/src/nvim/hardcopy.c
index 0da5caf7cd..db81746d73 100644
--- a/src/nvim/hardcopy.c
+++ b/src/nvim/hardcopy.c
@@ -21,7 +21,6 @@
#ifdef HAVE_LOCALE_H
# include <locale.h>
#endif
-#include "nvim/version_defs.h"
#include "nvim/hardcopy.h"
#include "nvim/buffer.h"
#include "nvim/charset.h"
@@ -42,6 +41,7 @@
#include "nvim/strings.h"
#include "nvim/syntax.h"
#include "nvim/ui.h"
+#include "nvim/version.h"
#include "nvim/tempfile.h"
#include "nvim/os/os.h"
#include "nvim/os/input.h"
@@ -2440,7 +2440,7 @@ int mch_print_begin(prt_settings_T *psettings)
STRCPY(buffer, "Unknown");
}
prt_dsc_textline("For", buffer);
- prt_dsc_textline("Creator", NVIM_VERSION_LONG);
+ prt_dsc_textline("Creator", longVersion);
/* Note: to ensure Clean8bit I don't think we can use LC_TIME */
now = time(NULL);
p_time = ctime(&now);
diff --git a/src/nvim/memline.c b/src/nvim/memline.c
index 817fd08a9c..1339671c92 100644
--- a/src/nvim/memline.c
+++ b/src/nvim/memline.c
@@ -70,6 +70,7 @@
#include "nvim/spell.h"
#include "nvim/strings.h"
#include "nvim/ui.h"
+#include "nvim/version.h"
#include "nvim/tempfile.h"
#include "nvim/undo.h"
#include "nvim/window.h"
diff --git a/src/nvim/message.c b/src/nvim/message.c
index 27619fcc5d..3a68de8881 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -794,9 +794,6 @@ void wait_return(int redraw)
State = HITRETURN;
setmouse();
-#ifdef USE_ON_FLY_SCROLL
- dont_scroll = TRUE; /* disallow scrolling here */
-#endif
/* Avoid the sequence that the user types ":" at the hit-return prompt
* to start an Ex command, but the file-changed dialog gets in the
* way. */
diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c
index bf6443e21e..04551355ae 100644
--- a/src/nvim/misc1.c
+++ b/src/nvim/misc1.c
@@ -19,7 +19,7 @@
#include "nvim/vim.h"
#include "nvim/ascii.h"
-#include "nvim/version_defs.h"
+#include "nvim/version.h"
#include "nvim/misc1.h"
#include "nvim/charset.h"
#include "nvim/cursor.h"
@@ -2290,9 +2290,6 @@ int ask_yesno(char_u *str, int direct)
int save_State = State;
++no_wait_return;
-#ifdef USE_ON_FLY_SCROLL
- dont_scroll = TRUE; /* disallow scrolling here */
-#endif
State = CONFIRM; /* mouse behaves like with :confirm */
setmouse(); /* disables mouse for xterm */
++no_mapping;
@@ -2465,9 +2462,6 @@ get_number (
if (msg_silent != 0)
return 0;
-#ifdef USE_ON_FLY_SCROLL
- dont_scroll = TRUE; /* disallow scrolling here */
-#endif
++no_mapping;
++allow_keys; /* no mapping here, but recognize keys */
for (;; ) {
@@ -2955,13 +2949,6 @@ char_u *vim_getenv(char_u *name, int *mustfree)
if (p == NULL) {
if (p_hf != NULL && vim_strchr(p_hf, '$') == NULL)
p = p_hf;
-#ifdef USE_EXE_NAME
- /*
- * Use the name of the executable, obtained from argv[0].
- */
- else
- p = exe_name;
-#endif
if (p != NULL) {
/* remove the file name */
pend = path_tail(p);
@@ -2970,12 +2957,6 @@ char_u *vim_getenv(char_u *name, int *mustfree)
if (p == p_hf)
pend = remove_tail(p, pend, (char_u *)"doc");
-#ifdef USE_EXE_NAME
- /* remove "src/" from exe_name, if present */
- if (p == exe_name)
- pend = remove_tail(p, pend, (char_u *)"src");
-#endif
-
/* for $VIM, remove "runtime/" or "vim54/", if present */
if (!vimruntime) {
pend = remove_tail(p, pend, (char_u *)RUNTIME_DIRNAME);
@@ -2995,13 +2976,6 @@ char_u *vim_getenv(char_u *name, int *mustfree)
free(p);
p = NULL;
} else {
-#ifdef USE_EXE_NAME
- /* may add "/vim54" or "/runtime" if it exists */
- if (vimruntime && (pend = vim_version_dir(p)) != NULL) {
- free(p);
- p = pend;
- }
-#endif
*mustfree = TRUE;
}
}
diff --git a/src/nvim/msgpack_rpc/remote_ui.c b/src/nvim/msgpack_rpc/remote_ui.c
index 361e93a6da..45b3dee0fd 100644
--- a/src/nvim/msgpack_rpc/remote_ui.c
+++ b/src/nvim/msgpack_rpc/remote_ui.c
@@ -66,8 +66,8 @@ static Object remote_ui_attach(uint64_t channel_id, uint64_t request_id,
|| args.items[2].type != kObjectTypeBoolean
|| args.items[0].data.integer <= 0 || args.items[1].data.integer <= 0) {
api_set_error(error, Validation,
- _("Arguments must be a pair of positive integers "
- "representing the remote screen width/height"));
+ _("Invalid arguments. Expected: "
+ "(uint width > 0, uint height > 0, bool enable_rgb)"));
return NIL;
}
UIData *data = xmalloc(sizeof(UIData));
@@ -127,8 +127,8 @@ static Object remote_ui_try_resize(uint64_t channel_id, uint64_t request_id,
|| args.items[1].type != kObjectTypeInteger
|| args.items[0].data.integer <= 0 || args.items[1].data.integer <= 0) {
api_set_error(error, Validation,
- _("Arguments must be a pair of positive integers "
- "representing the remote screen width/height"));
+ _("Invalid arguments. Expected: "
+ "(uint width > 0, uint height > 0)"));
return NIL;
}
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 3906226b2e..c6250297c1 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -473,9 +473,6 @@ normal_cmd (
mapped_len = typebuf_maplen();
State = NORMAL_BUSY;
-#ifdef USE_ON_FLY_SCROLL
- dont_scroll = false; /* allow scrolling here */
-#endif
/* Set v:count here, when called from main() and not a stuffed
* command, so that v:count can be used in an expression mapping
@@ -3607,9 +3604,6 @@ static void nv_zet(cmdarg_T *cap)
return;
n = nchar - '0';
for (;; ) {
-#ifdef USE_ON_FLY_SCROLL
- dont_scroll = true; /* disallow scrolling here */
-#endif
++no_mapping;
++allow_keys; /* no mapping for nchar, but allow key codes */
nchar = plain_vgetc();
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index 395ddf95a7..062fc1bbfa 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -3200,13 +3200,10 @@ void ex_display(exarg_T *eap)
MSG_PUTS_TITLE(_("\n--- Registers ---"));
for (i = -1; i < NUM_REGISTERS && !got_int; ++i) {
name = get_register_name(i);
- if (arg != NULL && vim_strchr(arg, name) == NULL
-#ifdef ONE_CLIPBOARD
- /* Star register and plus register contain the same thing. */
- && (name != '*' || vim_strchr(arg, '+') == NULL)
-#endif
- )
+
+ if (arg != NULL && vim_strchr(arg, name) == NULL) {
continue; /* did not ask for this register */
+ }
get_clipboard(name);
diff --git a/src/nvim/option.c b/src/nvim/option.c
index d52b9ebf7a..3d596f81cc 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -1989,7 +1989,7 @@ void set_init_1(void)
char_u *save_enc;
/* Try setting 'encoding' and check if the value is valid.
- * If not, go back to the default "latin1". */
+ * If not, go back to the default "utf-8". */
save_enc = p_enc;
p_enc = p;
if (STRCMP(p_enc, "gb18030") == 0) {
@@ -2029,8 +2029,13 @@ void set_init_1(void)
} else {
free(p_enc);
+ // mb_init() failed; fallback to utf8 and try again.
p_enc = save_enc;
+ mb_init();
}
+ } else {
+ // enc_locale() failed; initialize the default (utf8).
+ mb_init();
}
/* Set the default for 'helplang'. */
@@ -2525,13 +2530,11 @@ do_set (
goto skip;
}
-#ifdef HAVE_SANDBOX
/* Disallow changing some options in the sandbox */
if (sandbox != 0 && (flags & P_SECURE)) {
errmsg = (char_u *)_(e_sandbox);
goto skip;
}
-#endif
if (vim_strchr((char_u *)"?=:!&<", nextchar) != NULL) {
arg += len;
@@ -3066,9 +3069,7 @@ did_set_option (
* flag. */
uint32_t *p = insecure_flag(opt_idx, opt_flags);
if (secure
-#ifdef HAVE_SANDBOX
|| sandbox != 0
-#endif
|| (opt_flags & OPT_MODELINE))
*p = *p | P_INSECURE;
else if (new_value)
@@ -3577,11 +3578,8 @@ did_set_string_option (
gvarp = (char_u **)get_varp_scope(&(options[opt_idx]), OPT_GLOBAL);
/* Disallow changing some options from secure mode */
- if ((secure
-#ifdef HAVE_SANDBOX
- || sandbox != 0
-#endif
- ) && (options[opt_idx].flags & P_SECURE)) {
+ if ((secure || sandbox != 0)
+ && (options[opt_idx].flags & P_SECURE)) {
errmsg = e_secure;
}
/* Check for a "normal" file name in some options. Disallow a path
@@ -4697,12 +4695,10 @@ set_bool_option (
int old_value = *(int *)varp;
/* Disallow changing some options from secure mode */
- if ((secure
-#ifdef HAVE_SANDBOX
- || sandbox != 0
-#endif
- ) && (options[opt_idx].flags & P_SECURE))
+ if ((secure || sandbox != 0)
+ && (options[opt_idx].flags & P_SECURE)) {
return e_secure;
+ }
*(int *)varp = value; /* set the new value */
/* Remember where the option was set. */
@@ -5064,12 +5060,10 @@ set_num_option (
long *pp = (long *)varp;
/* Disallow changing some options from secure mode. */
- if ((secure
-#ifdef HAVE_SANDBOX
- || sandbox != 0
-#endif
- ) && (options[opt_idx].flags & P_SECURE))
+ if ((secure || sandbox != 0)
+ && (options[opt_idx].flags & P_SECURE)) {
return e_secure;
+ }
*pp = value;
/* Remember where the option was set. */
@@ -5755,13 +5749,11 @@ set_option_value (
EMSG2(_("E355: Unknown option: %s"), name);
else {
uint32_t flags = options[opt_idx].flags;
-#ifdef HAVE_SANDBOX
- /* Disallow changing some options in the sandbox */
+ // Disallow changing some options in the sandbox
if (sandbox > 0 && (flags & P_SECURE)) {
EMSG(_(e_sandbox));
return NULL;
}
-#endif
if (flags & P_STRING)
return set_string_option(opt_idx, string, opt_flags);
else {
diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c
index 87ef1220e7..5d8b4ad26a 100644
--- a/src/nvim/os_unix.c
+++ b/src/nvim/os_unix.c
@@ -317,11 +317,10 @@ int mch_expand_wildcards(int num_pat, char_u **pat, int *num_file,
return OK;
}
-# ifdef HAVE_SANDBOX
- /* Don't allow any shell command in the sandbox. */
- if (sandbox != 0 && check_secure())
+ // Don't allow any shell command in the sandbox.
+ if (sandbox != 0 && check_secure()) {
return FAIL;
-# endif
+ }
/*
* Don't allow the use of backticks in secure and restricted mode.
diff --git a/src/nvim/path.c b/src/nvim/path.c
index 93aa5eed3d..361a4a57f0 100644
--- a/src/nvim/path.c
+++ b/src/nvim/path.c
@@ -403,7 +403,7 @@ char_u *save_absolute_path(const char_u *name)
#if !defined(NO_EXPANDPATH)
-#if defined(UNIX) || defined(USE_UNIXFILENAME)
+#if defined(UNIX)
/*
* Unix style wildcard expansion code.
* It's here because it's used both for Unix and Mac.
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index 69025e15bb..f26c74998e 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -1858,11 +1858,6 @@ static void fold_line(win_T *wp, long fold_count, foldinfo_T *foldinfo, linenr_T
} else
prev_c = u8c;
/* Non-BMP character: display as ? or fullwidth ?. */
-#ifdef UNICODE16
- if (u8c >= 0x10000)
- ScreenLinesUC[idx] = (cells == 2) ? 0xff1f : (int)'?';
- else
-#endif
ScreenLinesUC[idx] = u8c;
for (i = 0; i < Screen_mco; ++i) {
ScreenLinesC[i][idx] = u8cc[i];
@@ -3051,30 +3046,13 @@ win_line (
if ((mb_l == 1 && c >= 0x80)
|| (mb_l >= 1 && mb_c == 0)
- || (mb_l > 1 && (!vim_isprintc(mb_c)
-# ifdef UNICODE16
- || mb_c >= 0x10000
-# endif
- ))) {
- /*
- * Illegal UTF-8 byte: display as <xx>.
- * Non-BMP character : display as ? or fullwidth ?.
- */
-# ifdef UNICODE16
- if (mb_c < 0x10000)
-# endif
- {
- transchar_hex(extra, mb_c);
- if (wp->w_p_rl) /* reverse */
+ || (mb_l > 1 && (!vim_isprintc(mb_c)))) {
+ // Illegal UTF-8 byte: display as <xx>.
+ // Non-BMP character : display as ? or fullwidth ?.
+ transchar_hex(extra, mb_c);
+ if (wp->w_p_rl) { // reverse
rl_mirror(extra);
}
-# ifdef UNICODE16
- else if (utf_char2cells(mb_c) != 2)
- STRCPY(extra, "?");
- else
- /* 0xff1f in UTF-8: full-width '?' */
- STRCPY(extra, "\357\274\237");
-# endif
p_extra = extra;
c = *p_extra;
@@ -5226,14 +5204,6 @@ void screen_puts_len(char_u *text, int textlen, int row, int col, int attr)
else
u8c = utfc_ptr2char(ptr, u8cc);
mbyte_cells = utf_char2cells(u8c);
-# ifdef UNICODE16
- /* Non-BMP character: display as ? or fullwidth ?. */
- if (u8c >= 0x10000) {
- u8c = (mbyte_cells == 2) ? 0xff1f : (int)'?';
- if (attr == 0)
- attr = hl_attr(HLF_8);
- }
-# endif
if (p_arshape && !p_tbidi && arabic_char(u8c)) {
/* Do Arabic shaping. */
if (len >= 0 && (int)(ptr - text) + mbyte_blen >= len) {
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index 3fc004036e..4f67507ea2 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -7174,12 +7174,10 @@ int highlight_changed(void)
int attr;
char_u *end;
int id;
-#ifdef USER_HIGHLIGHT
char_u userhl[10];
int id_SNC = -1;
int id_S = -1;
int hlcnt;
-#endif
static int hl_flags[HLF_COUNT] = HL_FLAGS;
need_highlight_changed = FALSE;
@@ -7251,12 +7249,10 @@ int highlight_changed(void)
return FAIL;
attr = syn_id2attr(id);
p = end - 1;
-#ifdef USER_HIGHLIGHT
if (hlf == (int)HLF_SNC)
id_SNC = syn_get_final_id(id);
else if (hlf == (int)HLF_S)
id_S = syn_get_final_id(id);
-#endif
break;
default: return FAIL;
}
@@ -7267,7 +7263,6 @@ int highlight_changed(void)
}
}
-#ifdef USER_HIGHLIGHT
/* Setup the user highlights
*
* Temporarily utilize 10 more hl entries. Have to be in there
@@ -7327,8 +7322,6 @@ int highlight_changed(void)
}
highlight_ga.ga_len = hlcnt;
-#endif /* USER_HIGHLIGHT */
-
return OK;
}
diff --git a/src/nvim/tag.c b/src/nvim/tag.c
index 44c653c852..9e6a65cef3 100644
--- a/src/nvim/tag.c
+++ b/src/nvim/tag.c
@@ -2416,9 +2416,7 @@ jumpto_tag (
save_secure = secure;
secure = 1;
-#ifdef HAVE_SANDBOX
++sandbox;
-#endif
save_magic = p_magic;
p_magic = FALSE; /* always execute with 'nomagic' */
/* Save value of no_hlsearch, jumping to a tag is not a real search */
@@ -2525,9 +2523,7 @@ jumpto_tag (
wait_return(TRUE);
secure = save_secure;
p_magic = save_magic;
-#ifdef HAVE_SANDBOX
--sandbox;
-#endif
/* restore no_hlsearch when keeping the old search pattern */
if (search_options) {
SET_NO_HLSEARCH(save_no_hlsearch);
diff --git a/src/nvim/testdir/test77.in b/src/nvim/testdir/test77.in
deleted file mode 100644
index 0dbc4fcbaf..0000000000
--- a/src/nvim/testdir/test77.in
+++ /dev/null
@@ -1,30 +0,0 @@
-Inserts 2 million lines with consecutive integers starting from 1
-(essentially, the output of GNU's seq 1 2000000), writes them to Xtest
-and writes its cksum to test.out.
-
-We need 2 million lines to trigger a call to mf_hash_grow(). If it would mess
-up the lines the checksum would differ.
-
-cksum is part of POSIX and so should be available on most Unixes.
-If it isn't available then the test will be skipped.
-
-STARTTEST
-:so small.vim
-:if !executable("cksum")
-: e! test.ok
-: w! test.out
-: qa!
-:endif
-:set fileformat=unix undolevels=-1
-ggdG
-:let i = 1
-:while i <= 2000000 | call append(i, range(i, i + 99)) | let i += 100 | endwhile
-ggdd
-:w! Xtest
-:r !cksum Xtest
-:s/\s/ /g
-:set fileformat&
-:.w! test.out
-:qa!
-ENDTEST
-
diff --git a/src/nvim/testdir/test77.ok b/src/nvim/testdir/test77.ok
deleted file mode 100644
index 11f148c73f..0000000000
--- a/src/nvim/testdir/test77.ok
+++ /dev/null
@@ -1 +0,0 @@
-3678979763 14888896 Xtest
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c
index cdea8673c7..dec2840fdb 100644
--- a/src/nvim/tui/tui.c
+++ b/src/nvim/tui/tui.c
@@ -239,7 +239,7 @@ static void update_attrs(UI *ui, HlAttrs attrs)
if (attrs.italic) {
unibi_out(ui, unibi_enter_italics_mode);
}
- if (attrs.underline) {
+ if (attrs.underline || attrs.undercurl) {
unibi_out(ui, unibi_enter_underline_mode);
}
if (attrs.reverse) {
diff --git a/src/nvim/types.h b/src/nvim/types.h
index a87122d24b..afd684925a 100644
--- a/src/nvim/types.h
+++ b/src/nvim/types.h
@@ -13,19 +13,11 @@
// dummy to pass an ACL to a function
typedef void *vim_acl_T;
-/*
- * Shorthand for unsigned variables. Many systems, but not all, have u_char
- * already defined, so we use char_u to avoid trouble.
- */
+// Shorthand for unsigned variables. Many systems, but not all, have u_char
+// already defined, so we use char_u to avoid trouble.
typedef unsigned char char_u;
-// The u8char_T can hold one decoded UTF-8 character. We normally use 32
-// bits now, since some Asian characters don't fit in 16 bits. u8char_T is
-// only used for displaying, it could be 16 bits to save memory.
-#ifdef UNICODE16
-typedef uint16_t u8char_T;
-#else
+// Can hold one decoded UTF-8 character.
typedef uint32_t u8char_T;
-#endif
-#endif /* NVIM_TYPES_H */
+#endif // NVIM_TYPES_H
diff --git a/src/nvim/undo.c b/src/nvim/undo.c
index 4d84c69158..2c287e0fdf 100644
--- a/src/nvim/undo.c
+++ b/src/nvim/undo.c
@@ -295,13 +295,11 @@ int undo_allowed(void)
return FALSE;
}
-#ifdef HAVE_SANDBOX
- /* In the sandbox it's not allowed to change the text. */
+ // In the sandbox it's not allowed to change the text.
if (sandbox != 0) {
EMSG(_(e_sandbox));
return FALSE;
}
-#endif
/* Don't allow changes in the buffer while editing the cmdline. The
* caller of getcmdline() may get confused. */
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 8abbdb8a8b..474dbf73f8 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -18,10 +18,24 @@
#include "nvim/misc2.h"
#include "nvim/screen.h"
#include "nvim/strings.h"
-#include "nvim/version_defs.h"
+
+// version info generated by the build system
+#include "auto/versiondef.h"
+
+#define STR_(x) #x
+#define STR(x) STR_(x)
+
+// for the startup-screen ( ":intro" command )
+#define NVIM_VERSION_MEDIUM STR(NVIM_VERSION_MAJOR) "." STR(NVIM_VERSION_MINOR)
+
+// for the ":version" command and "nvim --version"
+#define NVIM_VERSION_LONG "NVIM " NVIM_VERSION_MEDIUM "." STR(NVIM_VERSION_PATCH) NVIM_VERSION_PRERELEASE NVIM_VERSION_BUILD
+
char *Version = VIM_VERSION_SHORT;
-char *longVersion = NVIM_VERSION_LONG " (compiled " __DATE__ " " __TIME__ ")";
+char *longVersion = NVIM_VERSION_LONG;
+char *longVersionWithDate = NVIM_VERSION_LONG " (compiled " __DATE__ " " __TIME__ ")";
+char *mediumVersion = NVIM_VERSION_MEDIUM;
char *version_commit = "Commit: " NVIM_VERSION_COMMIT;
char *version_buildtype = "Build type: " NVIM_VERSION_BUILD_TYPE;
char *version_cflags = "Compilation: " NVIM_VERSION_CFLAGS;
@@ -206,7 +220,7 @@ static int included_patches[] = {
//581,
//580,
//579,
- //578,
+ 578,
//577,
//576,
//575,
@@ -885,7 +899,7 @@ void list_version(void)
{
// When adding features here, don't forget to update the list of
// internal variables in eval.c!
- MSG(longVersion);
+ MSG(longVersionWithDate);
MSG(version_commit);
MSG(version_buildtype);
MSG(version_cflags);
diff --git a/src/nvim/version.h b/src/nvim/version.h
index d1b19a062f..c1881250f1 100644
--- a/src/nvim/version.h
+++ b/src/nvim/version.h
@@ -1,6 +1,23 @@
#ifndef NVIM_VERSION_H
#define NVIM_VERSION_H
+// defined in version.c
+extern char* Version;
+extern char* mediumVersion;
+extern char* longVersion;
+
+//
+// Vim version number, name, etc. Patchlevel is defined in version.c.
+//
+#define VIM_VERSION_MAJOR 7
+#define VIM_VERSION_MINOR 4
+#define VIM_VERSION_100 (VIM_VERSION_MAJOR * 100 + VIM_VERSION_MINOR)
+
+// used for the runtime directory name
+#define VIM_VERSION_NODOT "vim74"
+// swap file compatibility (max. length is 6 chars)
+#define VIM_VERSION_SHORT "7.4"
+
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "version.h.generated.h"
#endif
diff --git a/src/nvim/version_defs.h b/src/nvim/version_defs.h
deleted file mode 100644
index 0ba6143632..0000000000
--- a/src/nvim/version_defs.h
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef NVIM_VERSION_DEFS_H
-#define NVIM_VERSION_DEFS_H
-
-// VIM - Vi IMproved by Bram Moolenaar
-//
-// Do ":help uganda" in Vim to read copying and usage conditions.
-// Do ":help credits" in Vim to see a list of people who contributed.
-
-#define STR_(x) #x
-#define STR(x) STR_(x)
-
-//
-// Nvim version identifiers
-//
-#ifndef NVIM_VERSION_MAJOR
-#define NVIM_VERSION_MAJOR 0
-#endif
-#ifndef NVIM_VERSION_MINOR
-#define NVIM_VERSION_MINOR 0
-#endif
-#ifndef NVIM_VERSION_PATCH
-#define NVIM_VERSION_PATCH 0
-#endif
-#ifndef NVIM_VERSION_PRERELEASE
-#define NVIM_VERSION_PRERELEASE "?"
-#endif
-#ifndef NVIM_VERSION_BUILD
-#define NVIM_VERSION_BUILD "?"
-#endif
-#ifndef NVIM_VERSION_COMMIT
-#define NVIM_VERSION_COMMIT "?"
-#endif
-#ifndef NVIM_VERSION_CFLAGS
-#define NVIM_VERSION_CFLAGS "?"
-#endif
-#ifndef NVIM_VERSION_BUILD_TYPE
-#define NVIM_VERSION_BUILD_TYPE "?"
-#endif
-// for the startup-screen
-#define NVIM_VERSION_MEDIUM STR(NVIM_VERSION_MAJOR) "." STR(NVIM_VERSION_MINOR)
-// for the ":version" command and "nvim -h"
-#define NVIM_VERSION_LONG "NVIM " NVIM_VERSION_MEDIUM "." STR(NVIM_VERSION_PATCH) NVIM_VERSION_PRERELEASE NVIM_VERSION_BUILD
-
-//
-// Vim version number, name, etc. Patchlevel is defined in version.c.
-//
-#define VIM_VERSION_MAJOR 7
-#define VIM_VERSION_MINOR 4
-#define VIM_VERSION_100 (VIM_VERSION_MAJOR * 100 + VIM_VERSION_MINOR)
-
-// used for the runtime directory name
-#define VIM_VERSION_NODOT "vim74"
-// swap file compatibility (max. length is 6 chars)
-#define VIM_VERSION_SHORT "7.4"
-
-#endif // NVIM_VERSION_DEFS_H
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 1e8de3ce4f..8b6f925928 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -441,9 +441,6 @@ wingotofile:
case 'g':
case Ctrl_G:
CHECK_CMDWIN
-#ifdef USE_ON_FLY_SCROLL
- dont_scroll = TRUE; /* disallow scrolling here */
-#endif
++ no_mapping;
++allow_keys; /* no mapping for xchar, but allow key codes */
if (xchar == NUL)
diff --git a/test/functional/job/job_spec.lua b/test/functional/job/job_spec.lua
index 9bdade7733..0d561ec4d7 100644
--- a/test/functional/job/job_spec.lua
+++ b/test/functional/job/job_spec.lua
@@ -45,7 +45,7 @@ describe('jobs', function()
eq({'notification', 'stdout', {{'abc', ''}}}, next_message())
nvim('command', 'call jobsend(j, "123\\nxyz\\n")')
eq({'notification', 'stdout', {{'123', 'xyz', ''}}}, next_message())
- nvim('command', 'call jobsend(j, [123, "xyz"])')
+ nvim('command', 'call jobsend(j, [123, "xyz", ""])')
eq({'notification', 'stdout', {{'123', 'xyz', ''}}}, next_message())
nvim('command', "call jobstop(j)")
eq({'notification', 'exit', {0}}, next_message())
@@ -67,7 +67,7 @@ describe('jobs', function()
-- jobsend() preserves NULs.
nvim('command', "let j = jobstart('xxx', 'cat', ['-'])")
- nvim('command', [[call jobsend(j, ["123\n456"])]])
+ nvim('command', [[call jobsend(j, ["123\n456",""])]])
eq({'notification', 'stdout', {{'123\n456', ''}}}, next_message())
nvim('command', "call jobstop(j)")
end)
@@ -92,13 +92,24 @@ describe('jobs', function()
it('can preserve nuls', function()
nvim('command', notify_str('v:job_data[1]', 'get(v:job_data, 2)'))
nvim('command', "let j = jobstart('xxx', 'cat', ['-'])")
- nvim('command', 'call jobsend(j, ["\n123\n", "abc\\nxyz\n"])')
+ nvim('command', 'call jobsend(j, ["\n123\n", "abc\\nxyz\n", ""])')
eq({'notification', 'stdout', {{'\n123\n', 'abc\nxyz\n', ''}}},
next_message())
nvim('command', "call jobstop(j)")
eq({'notification', 'exit', {0}}, next_message())
end)
+ it('can avoid sending final newline', function()
+ nvim('command', notify_str('v:job_data[1]', 'get(v:job_data, 2)'))
+ nvim('command', "let j = jobstart('xxx', 'cat', ['-'])")
+ nvim('command', 'call jobsend(j, ["some data", "without\nfinal nl"])')
+ eq({'notification', 'stdout', {{'some data', 'without\nfinal nl'}}},
+ next_message())
+ nvim('command', "call jobstop(j)")
+ eq({'notification', 'exit', {0}}, next_message())
+ end)
+
+
it('will not allow jobsend/stop on a non-existent job', function()
eq(false, pcall(eval, "jobsend(-1, 'lol')"))
eq(false, pcall(eval, "jobstop(-1)"))
diff --git a/test/functional/legacy/077_mf_hash_grow_spec.lua b/test/functional/legacy/077_mf_hash_grow_spec.lua
new file mode 100644
index 0000000000..01d916ef04
--- /dev/null
+++ b/test/functional/legacy/077_mf_hash_grow_spec.lua
@@ -0,0 +1,45 @@
+-- Inserts 2 million lines with consecutive integers starting from 1
+-- (essentially, the output of GNU's seq 1 2000000), writes them to Xtest
+-- and calculates its cksum.
+-- We need 2 million lines to trigger a call to mf_hash_grow(). If it would mess
+-- up the lines the checksum would differ.
+-- cksum is part of POSIX and so should be available on most Unixes.
+-- If it isn't available then the test will be skipped.
+
+local helpers = require('test.functional.helpers')
+local feed, insert, source = helpers.feed, helpers.insert, helpers.source
+local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect
+
+describe('mf_hash_grow()', function()
+ setup(clear)
+
+ -- Check to see if cksum exists, otherwise skip the test
+ if os.execute('which cksum 2>&1 > /dev/null') ~= 0 then
+ pending("was not tested because cksum was not found")
+ else
+ it('is working', function()
+ execute('set fileformat=unix undolevels=-1')
+
+ -- Fill the buffer with numbers 1 - 2000000
+ execute('let i = 1')
+ execute('while i <= 2000000 | call append(i, range(i, i + 99)) | let i += 100 | endwhile')
+
+ -- Delete empty first line, save to Xtest, and clear buffer
+ feed('ggdd<cr>')
+ execute('w! Xtest')
+ feed('ggdG<cr>')
+
+ -- Calculate the cksum of Xtest and delete first line
+ execute('r !cksum Xtest')
+ feed('ggdd<cr>')
+
+ -- Assert correct output of cksum.
+ expect([[
+ 3678979763 14888896 Xtest]])
+ end)
+ end
+
+ teardown(function()
+ os.remove('Xtest')
+ end)
+end)
diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt
index f11cbc4b7a..cdc0a58bf6 100644
--- a/third-party/CMakeLists.txt
+++ b/third-party/CMakeLists.txt
@@ -50,25 +50,25 @@ endif()
include(ExternalProject)
set(LIBUV_URL https://github.com/libuv/libuv/archive/v1.2.0.tar.gz)
-set(LIBUV_SHA1 38d1ba349fcfc1b221140523ba3d7cf3ea38c20b)
+set(LIBUV_SHA256 bebf424bb239867bbf609abad09a256cae7808c9d5cb346b779acd4b97a56693)
set(MSGPACK_URL https://github.com/msgpack/msgpack-c/archive/f6d0cd9a4ba46f4341014a199e3d352fad76b215.tar.gz)
-set(MSGPACK_SHA1 112ef2e8c58b26ba958554e17df81b1dcd610e9a)
+set(MSGPACK_SHA256 988bb2bf86bb0f69816cbcbe2218285b94dbaa27e839f8b1ffdb0b934a7d726a)
set(LUAJIT_URL http://luajit.org/download/LuaJIT-2.0.3.tar.gz)
-set(LUAJIT_SHA1 2db39e7d1264918c2266b0436c313fbd12da4ceb)
+set(LUAJIT_SHA256 55be6cb2d101ed38acca32c5b1f99ae345904b365b642203194c585d27bebd79)
set(LUAROCKS_URL https://github.com/keplerproject/luarocks/archive/0587afbb5fe8ceb2f2eea16f486bd6183bf02f29.tar.gz)
-set(LUAROCKS_SHA1 61a894fd5d61987bf7e7f9c3e0c5de16ba4b68c4)
+set(LUAROCKS_SHA256 c8ad50938fed66beba74a73621d14121d4a40b796e01c45238de4cdcb47d5e0b)
set(LIBUNIBILIUM_URL https://github.com/mauke/unibilium/archive/bb979ff6f66a18663e15d086dec6276561b86ee0.tar.gz)
-set(LIBUNIBILIUM_SHA1 32c07797f298e5bc722ce14b6b9a2cae68e3c018)
+set(LIBUNIBILIUM_SHA256 bec06ea90128b46f28b91b8b52b861dede5f4ede0a92f05178b3c7bcec237dd1)
set(LIBTERMKEY_URL https://github.com/neovim/libtermkey/archive/8c0cb7108cc63218ea19aa898968eede19e19603.tar.gz)
-set(LIBTERMKEY_SHA1 54e8b6914dab10d4467d2a563f80053a99849fcb)
+set(LIBTERMKEY_SHA256 21846369081e6c9a0b615f4b3889c4cb809321c5ccc6e6c1640eb138f1590072)
-set(LIBVTERM_URL https://github.com/neovim/libvterm/archive/dd92e5ba5b0907571df938ac7601b1641f05ed16.tar.gz)
-set(LIBVTERM_SHA1 9e4c4cdfc4925f1882b704e84c7360e70aeb3d31)
+set(LIBVTERM_URL https://github.com/neovim/libvterm/archive/1b745d29d45623aa8d22a7b9288c7b0e331c7088.tar.gz)
+set(LIBVTERM_SHA256 3fc75908256c0d158d6c2a32d39f34e86bfd26364f5404b7d9c03bb70cdc3611)
if(USE_BUNDLED_LIBUNIBILIUM)
@@ -80,7 +80,7 @@ if(USE_BUNDLED_LIBUNIBILIUM)
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/libunibilium
-DURL=${LIBUNIBILIUM_URL}
- -DEXPECTED_SHA1=${LIBUNIBILIUM_SHA1}
+ -DEXPECTED_SHA256=${LIBUNIBILIUM_SHA256}
-DTARGET=libunibilium
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
CONFIGURE_COMMAND ""
@@ -101,7 +101,7 @@ if(USE_BUNDLED_LIBTERMKEY)
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/libtermkey
-DURL=${LIBTERMKEY_URL}
- -DEXPECTED_SHA1=${LIBTERMKEY_SHA1}
+ -DEXPECTED_SHA256=${LIBTERMKEY_SHA256}
-DTARGET=libtermkey
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
CONFIGURE_COMMAND ""
@@ -125,7 +125,7 @@ if(USE_BUNDLED_LIBVTERM)
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/libvterm
-DURL=${LIBVTERM_URL}
- -DEXPECTED_SHA1=${LIBVTERM_SHA1}
+ -DEXPECTED_SHA256=${LIBVTERM_SHA256}
-DTARGET=libvterm
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
CONFIGURE_COMMAND ""
@@ -148,7 +148,7 @@ if(USE_BUNDLED_LIBUV)
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/libuv
-DURL=${LIBUV_URL}
- -DEXPECTED_SHA1=${LIBUV_SHA1}
+ -DEXPECTED_SHA256=${LIBUV_SHA256}
-DTARGET=libuv
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
CONFIGURE_COMMAND sh ${DEPS_BUILD_DIR}/src/libuv/autogen.sh &&
@@ -168,7 +168,7 @@ if(USE_BUNDLED_MSGPACK)
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/msgpack
-DURL=${MSGPACK_URL}
- -DEXPECTED_SHA1=${MSGPACK_SHA1}
+ -DEXPECTED_SHA256=${MSGPACK_SHA256}
-DTARGET=msgpack
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
CONFIGURE_COMMAND cmake ${DEPS_BUILD_DIR}/src/msgpack
@@ -193,7 +193,7 @@ if(USE_BUNDLED_LUAJIT)
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/luajit
-DURL=${LUAJIT_URL}
- -DEXPECTED_SHA1=${LUAJIT_SHA1}
+ -DEXPECTED_SHA256=${LUAJIT_SHA256}
-DTARGET=luajit
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
CONFIGURE_COMMAND ""
@@ -225,7 +225,7 @@ if(USE_BUNDLED_LUAROCKS)
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/luarocks
-DURL=${LUAROCKS_URL}
- -DEXPECTED_SHA1=${LUAROCKS_SHA1}
+ -DEXPECTED_SHA256=${LUAROCKS_SHA256}
-DTARGET=luarocks
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
BUILD_IN_SOURCE 1
@@ -240,14 +240,22 @@ if(USE_BUNDLED_LUAROCKS)
endif()
add_custom_command(OUTPUT ${DEPS_LIB_DIR}/luarocks/rocks/stable-busted-deps
- COMMAND ${DEPS_BIN_DIR}/luarocks ARGS install lua_cliargs 2.3-3
- COMMAND ${DEPS_BIN_DIR}/luarocks ARGS install luafilesystem 1.6.3-1
- COMMAND ${DEPS_BIN_DIR}/luarocks ARGS install dkjson 2.5-1
- COMMAND ${DEPS_BIN_DIR}/luarocks ARGS install say 1.2-1
- COMMAND ${DEPS_BIN_DIR}/luarocks ARGS install luassert 1.7.2-0
- COMMAND ${DEPS_BIN_DIR}/luarocks ARGS install ansicolors 1.0.2-3
- COMMAND ${DEPS_BIN_DIR}/luarocks ARGS install penlight 1.0.0-1
- COMMAND ${DEPS_BIN_DIR}/luarocks ARGS install mediator_lua 1.1-3
+ COMMAND ${DEPS_BIN_DIR}/luarocks
+ ARGS build lua_cliargs 2.3-3 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
+ COMMAND ${DEPS_BIN_DIR}/luarocks
+ ARGS build luafilesystem 1.6.3-1 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
+ COMMAND ${DEPS_BIN_DIR}/luarocks
+ ARGS build dkjson 2.5-1 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
+ COMMAND ${DEPS_BIN_DIR}/luarocks
+ ARGS build say 1.2-1 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
+ COMMAND ${DEPS_BIN_DIR}/luarocks
+ ARGS build luassert 1.7.2-0 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
+ COMMAND ${DEPS_BIN_DIR}/luarocks
+ ARGS build ansicolors 1.0.2-3 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
+ COMMAND ${DEPS_BIN_DIR}/luarocks
+ ARGS build penlight 1.0.0-1 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
+ COMMAND ${DEPS_BIN_DIR}/luarocks
+ ARGS build mediator_lua 1.1-3 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
COMMAND touch ${DEPS_LIB_DIR}/luarocks/rocks/stable-busted-deps
DEPENDS luarocks)
add_custom_target(stable-busted-deps
diff --git a/third-party/cmake/DownloadAndExtractFile.cmake b/third-party/cmake/DownloadAndExtractFile.cmake
index 875d45795d..305e37e7dd 100644
--- a/third-party/cmake/DownloadAndExtractFile.cmake
+++ b/third-party/cmake/DownloadAndExtractFile.cmake
@@ -10,8 +10,8 @@ if(NOT DEFINED DOWNLOAD_DIR)
message(FATAL_ERROR "DOWNLOAD_DIR must be defined.")
endif()
-if(NOT DEFINED EXPECTED_SHA1)
- message(FATAL_ERROR "EXPECTED_SHA1 must be defined.")
+if(NOT DEFINED EXPECTED_SHA256)
+ message(FATAL_ERROR "EXPECTED_SHA256 must be defined.")
endif()
if(NOT DEFINED TARGET)
@@ -75,18 +75,18 @@ if(NOT status_code EQUAL 0)
")
endif()
-set(NULL_SHA1 "0000000000000000000000000000000000000000")
+set(NULL_SHA256 "0000000000000000000000000000000000000000000000000000000000000000")
-# Allow users to use "SKIP" or "skip" as the sha1 to skip checking the hash.
+# Allow users to use "SKIP" or "skip" as the sha256 to skip checking the hash.
# You can still use the all zeros hash too.
-if((EXPECTED_SHA1 STREQUAL "SKIP") OR (EXPECTED_SHA1 STREQUAL "skip"))
- set(EXPECTED_SHA1 ${NULL_SHA1})
+if((EXPECTED_SHA256 STREQUAL "SKIP") OR (EXPECTED_SHA256 STREQUAL "skip"))
+ set(EXPECTED_SHA256 ${NULL_SHA256})
endif()
-# We could avoid computing the SHA1 entirely if a NULL_SHA1 was given,
+# We could avoid computing the SHA256 entirely if a NULL_SHA256 was given,
# but we want to warn users of an empty file.
-file(SHA1 ${file} ACTUAL_SHA1)
-if(ACTUAL_SHA1 STREQUAL "da39a3ee5e6b4b0d3255bfef95601890afd80709")
+file(SHA256 ${file} ACTUAL_SHA256)
+if(ACTUAL_SHA256 STREQUAL "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")
# File was empty. It's likely due to lack of SSL support.
message(FATAL_ERROR
"Failed to download ${URL}. The file is empty and likely means CMake "
@@ -94,12 +94,12 @@ if(ACTUAL_SHA1 STREQUAL "da39a3ee5e6b4b0d3255bfef95601890afd80709")
"proper SSL support. See "
"https://github.com/neovim/neovim/wiki/Building-Neovim#build-prerequisites "
"for more information.")
-elseif((NOT EXPECTED_SHA1 STREQUAL NULL_SHA1) AND
- (NOT EXPECTED_SHA1 STREQUAL ACTUAL_SHA1))
- # Wasn't a NULL SHA1 and we didn't match, so we fail.
+elseif((NOT EXPECTED_SHA256 STREQUAL NULL_SHA256) AND
+ (NOT EXPECTED_SHA256 STREQUAL ACTUAL_SHA256))
+ # Wasn't a NULL SHA256 and we didn't match, so we fail.
message(FATAL_ERROR
- "Failed to download ${URL}. Expected a SHA1 of "
- "${EXPECTED_SHA1} but got ${ACTUAL_SHA1} instead.")
+ "Failed to download ${URL}. Expected a SHA256 of "
+ "${EXPECTED_SHA256} but got ${ACTUAL_SHA256} instead.")
endif()
message(STATUS "downloading... done")