The size of long varies depending on architecture, in contrast to the
MAXLNUM constant which sets the maximum allowable number of lines to
2^32-1. This discrepancy may lead to hard to detect bugs, for example
https://github.com/neovim/neovim/issues/18454. Setting linenr_T to a
fix maximum size of 2^32-1 will prevent this type of errors in the
future.
Also change the variables `amount` and `amount_after` to be linenr_T
since they're referring to "the line number difference" between two
texts.
Problem: Cannot parse a date/time string.
Solution: Add strptime(). (Stephen Wall, closes #)
10455d43fe
N/A patches for version.c:
vim-patch:8.1.2344: Cygwin: warning for using strptime()
Problem: Cygwin: warning for using strptime().
Solution: Move defining _XOPEN_SOURCE and __USE_XOPEN to vim.h. (Ken Takata,
closesvim/vim#5265) Use 700 for _XOPEN_SOURCE for mkdtemp().
6a228c6463
* Fix/keep massaging git-describe result
Ref: https://github.com/neovim/neovim/pull/11117#issuecomment-536416223
* build: revisit generation of version from Git
Fixes "make clean && make", where "auto/versiondef.h" would be missing
since b18b84d - because BYPRODUCTS are apparently removed when cleaning.
This includes the following improvements/changes:
- do not run git-describe during CMake's configure phase just for
reporting
- do not print with changed Git version (too noisy, simplifies code)
* Move to src/nvim (included before config) for easier flow
* fallback to describe always, write empty include file
* update_version_stamp.lua: use prefix always
This avoids invoking CMake after a new commit, which might take 15s on
some systems.
Skipped on CMake < 3.2.0 (missing BYPRODUCTS support).
Co-Authored-By: Justin M. Keyes <justinkz@gmail.com>
- In appimage, the message catalog is not used because there is no
message catalog in LOCALE_INSTALL_DIR. Therefore, change to
exepath/../share/locale instead of LOCALE_INSTALL_DIR.
- The old vim style($runtime/lang) is no longer used. Thus all relevant
code is removed.
- Minimum required libuv is now v1.12
- Because `uv_os_getenv` requires allocating, we must manage a map
(`envmap` in `env.c`) to maintain the old behavior of `os_getenv` .
- free() map-items after removal. khash.h does not make copies of
anything, so even its keys must be memory-managed by the caller.
closes#8398closes#9267
There was never any investigation done to determine whether using
jemalloc was actually a net benefit for nvim. It has been a portability
limitation and adds another factor to consider when triaging issues.
Per CMAKE docs, CMAKE_HOST_SYSTEM_VERSION is the result of `uname -r`:
https://cmake.org/cmake/help/v3.4/variable/CMAKE_HOST_SYSTEM_VERSION.html?highlight=uname
A numeric version string for the system. On systems that support
uname, this variable is set to the output of uname -r. On other
systems this is set to major-minor version numbers.
On Windows it is something like "6.1", so it won't match ".*-Microsoft".
Closes#7329
New logging is guarded by cmake LOG_LIST_ACTIONS define. To make it more
efficient it is allocated as a linked list with chunks of length
2^(7+chunk_num); that uses basically the same idea as behind increasing kvec
length (make appending O(1) (amortized)), but reduces constant by not bothering
to move memory around what realloc() would surely do: it is not like we need
random access to log entries here to justify usage of a single continuous memory
block.
API level is disconnected from NVIM version. The API metadata holds the
current API level, and the lowest backwards-compatible level supported
by this instance.
Release 0.1.6 is the first release that reports the Nvim version and API
level.
metadata['version'] = {
major: 0,
minor: 1,
patch: 6,
api_level: 1,
api_compatible: 0,
api_prerelease: false,
}
The API level may remain unchanged across Nvim releases if the API has
not changed.
When changing the API,
- set NVIM_API_PRERELEASE to true
- increment NVIM_API_LEVEL (at most once per Nvim version)
- adjust NVIM_API_LEVEL_COMPAT if backwards-compatibility was broken
api_level_0.mpack was generated from Nvim 0.1.5 with:
nvim --api-info
The API level is disconnected from the NVIM version. The API metadata
holds the current API level, and the lowest backwards-compatible level
supported by this instance.
Release 0.1.6 will be the first release reporting the Nvim version and
API level.
metadata['version'] = {
major: 0,
minor: 1,
patch: 6,
prerelease: true,
api_level: 1,
api_compatible: 0,
}
The API level may remain unchanged across Neovim releases if the API has
not changed.
When changing the API the CMake variable NVIM_API_PRERELEASE is set to
true, and NVIM_API_CURRENT/NVIM_API_COMPATIBILITY are incremented
accordingly.
The functional tests check the API table against fixtures of past
versions of Neovim. It compares all the functions in the old table with
the new one, it does ignore some metadata attributes that do not alter
the function signature or were removed since 0.1.5. Currently the only
fixture is 0.mpack, generated from Neovim 0.1.5 with nvim --api-info.
Allowing this to be controlled externally improves reproducibility, as
well as provides a more useful address to report for "Compiled by". For
example, I intend to set it to the packaging list when building the
Debian package.
Signed-off-by: James McCoy <jamessan@jamessan.com>
Moves low-level functions handling to os/fs.c. Adds file.c with a proxy
interface.
Target: while leaving syscalls handling is os.c (partially handled by libuv),
add buffering for reading and writing to file.c.
The TUI can be enabled/disabled at build time with -DFEAT_TUI, default is ON for
UNIX, and OFF for non UNIX. When off, Neovim prints a message to stderr, along
with a list of the server endpoints.
This was noticed due to a user issue (#4750) when building Neovim 0.1.4
via ports. The crux of the issue is that we did not detect the
be64toh() macro, because there is no endian.h on FreeBSD (along with
several other BSDs). So we were defaulting to our builtin version of
be64toh(). However, it appears that sys/endian.h was being picked up by
an include (likely msgpack.h) and so be64toh() was actually defined and
corrupting our definition of it.
So the answer here was to use the correct include file in our check, and
export that information in the config.h. Then we use that information
to include the right header in shada.c.
This fixes#4750.
Change POROJECT_NAME to 'nvim', and use it as the gettext
domain name. The *.mo files, previously installed as
$runtime/lang/xx/LC_MESSAGES/nvim.mo, are now installed as
$prefix/locale/xx/LC_MESSAGES/nvim.mo.
Unix systems must have this header but Windows does not have it at all.
Since src/nvim/os/unix_defs.h includes <unistd.h> without the guard
in order to avoid including this in the numerous places we would
need <unistd.h> on Unix we just include src/nvim/os/os.h which will pull
in <unistd.h> for us.
In Vim, at least the constant `I_PUSH` is used from <stropts.h>, but
Neovim doesn't seem to use anything from said header.
Besides that, POSIX.1-2008[1] marks this header as obsolescent, and
there don't seem to be many platforms that even have it.
[1]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stropts.h.html#tag_13_52_11
Windows does not have setenv(), instead the _putenv_s() function is used - added
a function check and fatal errors. Implemented os_setenv() for Windows.
Vim supports the original putenv() function if no alternative is available.
Neovim only supports systems where safer alternatives exist, so the check for
putenv() was removed from config/CMakeLists.txt.