aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--clint-ignored-files.txt1
-rw-r--r--config/CMakeLists.txt6
-rw-r--r--config/config.h.in12
-rw-r--r--config/versiondef.h.in13
-rw-r--r--src/nvim/buffer.c3
-rw-r--r--src/nvim/eval.c1
-rw-r--r--src/nvim/ex_cmds.c4
-rw-r--r--src/nvim/ex_cmds2.c2
-rw-r--r--src/nvim/globals.h4
-rw-r--r--src/nvim/hardcopy.c4
-rw-r--r--src/nvim/memline.c1
-rw-r--r--src/nvim/misc1.c2
-rw-r--r--src/nvim/testdir/test77.in30
-rw-r--r--src/nvim/testdir/test77.ok1
-rw-r--r--src/nvim/version.c20
-rw-r--r--src/nvim/version.h17
-rw-r--r--src/nvim/version_defs.h56
-rw-r--r--test/functional/legacy/077_mf_hash_grow_spec.lua45
-rw-r--r--third-party/CMakeLists.txt4
19 files changed, 112 insertions, 114 deletions
diff --git a/clint-ignored-files.txt b/clint-ignored-files.txt
index 7e0063aea0..e0e6b9f3d2 100644
--- a/clint-ignored-files.txt
+++ b/clint-ignored-files.txt
@@ -126,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/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/eval.c b/src/nvim/eval.c
index 9b4b4ce496..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:" */
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index afa397976b..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);
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/globals.h b/src/nvim/globals.h
index 5d52774f40..b15db61f99 100644
--- a/src/nvim/globals.h
+++ b/src/nvim/globals.h
@@ -967,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.
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/misc1.c b/src/nvim/misc1.c
index a836ab5680..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"
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/version.c b/src/nvim/version.c
index 8357de9f46..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;
@@ -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/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 b9e4d0e539..cdc0a58bf6 100644
--- a/third-party/CMakeLists.txt
+++ b/third-party/CMakeLists.txt
@@ -67,8 +67,8 @@ set(LIBUNIBILIUM_SHA256 bec06ea90128b46f28b91b8b52b861dede5f4ede0a92f05178b3c7bc
set(LIBTERMKEY_URL https://github.com/neovim/libtermkey/archive/8c0cb7108cc63218ea19aa898968eede19e19603.tar.gz)
set(LIBTERMKEY_SHA256 21846369081e6c9a0b615f4b3889c4cb809321c5ccc6e6c1640eb138f1590072)
-set(LIBVTERM_URL https://github.com/neovim/libvterm/archive/dd92e5ba5b0907571df938ac7601b1641f05ed16.tar.gz)
-set(LIBVTERM_SHA256 850780dfef9e576c06b0e31ea1356da17da2bb4fd9e065a23ac50c88db2b0630)
+set(LIBVTERM_URL https://github.com/neovim/libvterm/archive/1b745d29d45623aa8d22a7b9288c7b0e331c7088.tar.gz)
+set(LIBVTERM_SHA256 3fc75908256c0d158d6c2a32d39f34e86bfd26364f5404b7d9c03bb70cdc3611)
if(USE_BUNDLED_LIBUNIBILIUM)