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.
Note about shada.c:
- shada_read_next_item_start was intentionally shadowing `unpacked` and
`i` because many of the macros (e.g. ADDITIONAL_KEY) implicitly
depended on those variable names.
- Macros were changed to parameterize `unpacked` (but not `i`). Macros
like CLEAR_GA_AND_ERROR_OUT do control-flow (goto), so any other
approach is messy.
Besides the "visible" improvements, this release features numerous
internal improvements to the UI/screen code and test infrastructure.
Numerous patches were merged from Vim, which are not mentioned below.
FEATURES:
07ad5d71ab clipboard: Support custom VimL functions #9304725da1feeb#9401 win/TUI: Improve terminal/console support
7a8dadbedb#9077 startup: Use $XDG_CONFIG_DIRS/nvim/sysinit.vim if it exists
feec926633#9299 support <cmd> mapping in more places
0653ed63a5#9028 diff/highlight: Show underline for low-priority CursorLine
bddcbbb571 signs: Add "numhl" argument #911305f9c7c2f7 clipboard: support Wayland (#9230)
14ae394532#9052 TUI: add support for undercurl and underline color
4fa3492a6f#9023 man.vim: soft (dynamic) wrap #9023
API:
8b39e4ec79#6920 API: implement object namespaces
b1aaa0a881 API: Implement nvim_win_set_buf() #91008de87c7b1c#8180 API: virtual text annotations (nvim_buf_set_virtual_text)
2b9fc9a13f#8660 API: add nvim_buf_is_loaded()
API: buf_get_lines, buf_line_count handle unloaded buffers
88f77c28e5 API: nvim_buf_get_offset_for_line
94841e5eae API/UI: #8221 ext_newgrid, ext_hlstate
(use line-based rather than char-based updates)
UI
b5cfac0894#8806 TUI: use BCE again more often, (smoother resizes/scrolling)
77b5e9ae25#9315 screen: add missing status redraw when redraw_later(CLEAR) was used
5f15788dc3 TUI: clip invalid regions on resize (#8779), fixes#8774c936ae0f36#9193 TUI: improvements for scrolling and clearing
f20427451e#9143 UI: disable clearing almost everywhere
f4b2b66661#9079 TUI: always use safe cursor movement after resize
d36afafc8d#9211 ui_options: also send when starting or from OptionSet
67f80d485c TUI: Avoid reset_cursor_color in old VTE #9191e55ebae373#9021 don't erase screen on `:hi Normal` during startup
c5790d9189#8915 TUI: Hint wrapped lines to terminals.
FIXES:
231de72539 RPC: turn errors from async calls into notifications
907ad921bc TUI: Restore terminal title via "title stacking" (#9407)
cb76a8a95f genappimage: Unset $ARGV0 at invocation #9376b48efd9ba7#9347 TUI: FreeBSD: Improve support for BSD vt console
c16529afa5 TUI: Konsole 18.07.70 supports DECSCUSR (#9364)
aec096fc5b os/lang: use the correct LC_NUMERIC also for OS X
5fee0be915 provider: improve error message (#9344)
3c42d7a10a TUI: alacritty supports set_cursor_color #93537bff9a5de8 TUI: Alacritty supports DECSCUSR (#9048)
57acfceabe macOS: infer primary language if $LANG is empty #9345bc132ae123 runtime/syntax: Fix highlighting of augroup contents (#9328)
715fdfee1e#9297 VimL/confirm(): Show dialog even if :silent
799d9c3215 clipboard: Prefer xclip (#9302)
6dae7776ed provider/nodejs: fix npm,yarn detection
16bc1e9c17#9218 channel: avoid buffering output when only terminal and no callbacks are active
72fecad1ff#8804 Fix crash in lang_init() on macOS if lang_region = NULL
d581398779 ruby: detect rbenv shims for other versions (#8733)
e568ac7a68#9123 third-party/unibilium: Fix parsing of extended capability entries
c4c74c3883 jobstart(): Fix hang on non-executable cwd #92041cf50cbfd9 provider/nodejs: Simultaneously query npm and yarn #90546c496db4b7 undo: Fix infinite loop if undo_read_byte returns EOF #2880f8f83579ff#9034 'swapfile: always show dialog'
CHANGES:
c236e80cf3#9024 --embed: wait for UI unless --headless
180b50dddc#9248 python: 'neovim' module was renamed to 'pynvim'
2000b6a64a#8589 VimL: Remove legacy aliases "v:errmsg", "v:shell_error", "v:this_session"
deb18a050e defaults: background=dark #2894 (#9205)
c1187d4af0 defaults: win: 'shellpipe' for cmd.exe (#8827)
ref #9280
Introduce the `vim.compat` module, to help environments with system Lua
5.2+ run the build/tests. Include the module implicitly in all tests.
ref #8677
legacy `vim` module:
beep
buffer
command
dict
eval
firstline
lastline
line
list
open
type
window
As of CMake 3.12, check_include_files() also link the check executable
against the libraries listed in CMAKE_REQUIRED_LIBRARIES. Therefore we
should unset the CMAKE_REQUIRED_* variables after each respective use to
avoid them unnecessarily bleeding into other checks.
There's a mix of CXX and C related variables being set/referenced in our
CMake files. Since we only use C, use an explicit language list of "C"
instead of the implicit "C CXX" and replace all uses of CXX variables
with their C counterparts
The Debian hurd-i386 [build] failed (partly) due to -D_GNU_SOURCE not be
defined:
[215/286] /usr/bin/cc -DINCLUDE_GENERATED_DECLARATIONS -Iconfig -I../src -Isrc/nvim/auto -Iinclude -I/usr/include/luajit-2.1 -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DDISABLE_LOG -Wdate-time -D_FORTIFY_SOURCE=2 -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -O2 -g -DMIN_LOG_LEVEL=3 -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -Wno-array-bounds -MD -MT src/nvim/CMakeFiles/nvim.dir/os/pty_process_unix.c.o -MF src/nvim/CMakeFiles/nvim.dir/os/pty_process_unix.c.o.d -o src/nvim/CMakeFiles/nvim.dir/os/pty_process_unix.c.o -c ../src/nvim/os/pty_process_unix.c
../src/nvim/os/pty_process_unix.c: In function 'pty_process_tty_name':
../src/nvim/os/pty_process_unix.c:121:10: warning: implicit declaration of function 'ptsname'; did you mean 'ttyname'? [-Wimplicit-function-declaration]
return ptsname(ptyproc->tty_fd);
Hurd is obviously not Linux, but it is using a GNU compiler and glibc so
it needs -D_GNU_SOURCE for the ptsname() definition to be visible.
[build]: https://buildd.debian.org/status/fetch.php?pkg=neovim&arch=hurd-i386&ver=0.3.0-2&stamp=1528981349&raw=0
Enabling CMake's USE_FOLDERS option and adding the FOLDER property to
targets allows some IDEs to list the targets in an organized
hierarchy of folders.
Environment variables are used to detect when the project is being built
from within Clion or Visual Studio, so that the build process can be
simplified by automatically building the bundled dependencies for them.
"Always use `find_package` with `REQUIRED`."
- We make an exception for LuaJit (not REQUIRED): the `nvim-test` target
is included only if we can find LuaJit.
This is partially a cargo-cult (reference below), but it uncovered at
least one problem: `find_package(LibIntl REQUIRED)` fails on my vanilla
ubuntu 16.04 system.
ref: https://schneide.blog/2017/11/06/4-tips-for-better-cmake/
> optional dependencies is nice, but skipping on REQUIRED is not the way
> you want to do it. In the worst case, some of your features will just
> not work if those packages are not found, with no explanation
> whatsoever. Instead, use explicit feature-toggles (e.g. using option())
> that either skip the find_package call or use it with REQUIRED, so the
> user will know that another lib is needed for this feature.
Prior to CMake 2.8.12, generator expressions could only be used in
custom commands so the path to libnvim-test in test/config/paths.lua was
set by inspecting the target's LOCATION property. Post 2.8.12, the
file(GENERATE) command exists to handle this, but it can't interpolate
normal CMake variables.
In order to bridge the gap while < 2.8.12 is supported, use
configure_file() to create paths.lua.gen with the
$<TARGET_FILE:nvim-test> generator expression and then generate the
final paths.lua file.
Closes#7077
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.
closes#7283
regression by 42d892913d
- Don't need to explicitly put "-O2 -g" in RelWithDebInfo; CMake does
that already. That was left-over from 42d892913d which removed the
"Dev" custom build-type, but repurposed the logic for RelWithDebInfo.
- `if(DEFINED MIN_LOG_LEVEL)` doesn't work.
- `if(${MIN_LOG_LEVEL} MATCHES "^$")` doesn't work if -DMIN_LOG_LEVEL is
omitted.
- `if(MIN_LOG_LEVEL)` also isn't what we want: it would be true if
MIN_LOG_LEVEL=0.
As of unibilium 1.2.1, directly manipulating unibi_var_t is deprecated.
../src/nvim/tui/tui.c: In function 'update_attrs':
../src/nvim/tui/tui.c:321:7: warning: 'i' is deprecated: use unibi_var_from_num or unibi_num_from_var instead [-Wdeprecated-declarations]
data->params[0].i = (fg >> 16) & 0xff; // red
^~~~
In file included from ../src/nvim/tui/tui.c:12:0:
/usr/include/unibilium.h:632:9: note: declared here
int i UNIBI_DEPRECATED("use unibi_var_from_num or unibi_num_from_var instead");
^
All use should go through unibi_{num,str}_from_var and
unibi_var_from_{num,str}. Wrap access of unibi_var_t behind a new
UNIBI_SET_NUM_VAR macro which uses the new functions when they're
available.
Handling of process exit is still broken. It detects the moment when the
child process exits, then quickly stops polling for process output. It
should continue polling for output until the agent has scraped all of the
process' output. This problem is easy to notice by running a command like
"dir && exit", but even typing "exit<ENTER>" can manifest the problem --
the "t" might not appear.
winpty's Cygwin adapter handles shutdown by waiting for the agent to close
the CONOUT pipe, which it does after it has scraped the child's last
output. AFAIK, neovim doesn't do anything interesting when winpty closes
the CONOUT pipe.
The main purpose of this build-type was to avoid unwanted ~/.nvimlog
files (which could get really big, and also affects performance) for
non-devs. But that is no longer necessary since the log system now
avoids non-critical logging by default (#6827).
This essentially reverts 87e5a41316
- Establish ERROR log level as "critical". Such errors are rare and will
be valuable when users encounter unusual circumstances.
- Set -DMIN_LOG_LEVEL=3 for release-type builds
Compile `nvim` executable against Lua if PREFER_LUA=ON.
As the testing library `nvim-test` requires LuaJIT, it is
still compiled against LuaJIT. If LuaJIT is not available,
`nvim-test` is not built.
For CI builds unibilium is provided through msys2 packages, and
libtermkey is built from source in third-party from equalsraf/libtermkey.
In Windows we cannot read terminal input from the stdin file descriptor,
instead use libuv's uv_tty API. It should handle key input and encoding.
The UI suspend is not implemented for Windows, because the
SIGSTP/SIGCONT do not exist in windows. Currently this is a NOOP.
Closes#3902Closes#6640
FEATURES:
bc4a2e1576 help, man.vim: "outline" (TOC) feature #516958422f17d8 'guicursor' works in the TUI (and sends info to UIs) #6423129f107c0c api: nvim_get_mode() #62470b59f988f4 api/ui: externalize tabline #6583bc6d868d00 'listchars': `Whitespace` highlight group #63676afa7d66cd writefile() obeys 'fsync' option #6427c60e409471 eval.c refactor (also improves some error messages) #51199d200cd0a3 getcompletion("cmdline") #63762ea7bfc627 terminal: Support extra arguments in 'shell'. #4504bf5110266c DirChanged autocmd #5928#62621743df82f9 'cpoptions': "_" flag to toggle `cw` behaviour #623522337b1c01 CTRL-R omits trailing ^M when pasting to cmdline #61370e44916fff :edit allows unescaped spaces in filename #6119abdbfd26bc eval: Add id() function and make printf("%p") useful #6095bdfa1479d2 findfile(), :find, gf work in :terminal. #60092f38ed11c9 providers: Disable if `g:loaded_*` exists.
b5560a69b1 setpos() can set lowercase marks in other buffers #57537c513d646d Throttle :! output, pulse "..." message. #5396d2e8c76dc2 v:exiting #5651
:terminal improvements #6185#6142
- cursor keeps position after leaving insert-mode.
- 4ceec30cd0 Follows output only if cursor is at end of buffer.
- e7bbd35c81 new option: 'scrollback'
- fedb8443d5 quasi-support for undo and 'modifiable'
- b45ddf731b disables 'list' by default
- disables 'relativenumber' by default
:help now contains full API documentation at `:help api`.
man.vim saw numerous improvements.
Windows support:
- Windows is no longer "experimental", it is fully supported.
- Windows package includes a GUI, curl.exe and other utilities.
"Vim 8" features: partials, lambdas.
SECURITY FIXES:
CVE-2017-5953 CVE-2017-6349 CVE-2017-6350 #6485
CHANGES:
NVIM_TUI_ENABLE_CURSOR_SHAPE was removed. Use 'guicursor' instead.
See https://github.com/neovim/neovim/wiki/Following-HEAD#2017040281525dc5c3 'mouse=a' is no longer the default. (This will probably
change again after it is improved.) #60220c1f783164 defaults: 'showcmd', 'belloff', 'ruler' #6087eb0e94f71b api: {get,set}_option update local options as appropriate #6405bdcb2a38b3 "Reading from stdin..." message was removed. #6298
FIXES:
12fc1defd6 ops: fix i<c-r> with multi-byte text #6524dd391bfca1 Windows: system() and friends #649713352c00f1 Windows: os_get_hostname() #641316babc6687 tui: Less-noisy mouse seqs #64113a9dd13f9e (vim bug) folding edge-cases #6207f6946c68ae job-control: set CLOEXEC on pty processes. #5986d1afd434f3 rplugin: Call s:LoadRemotePlugins() on startup.
1215084676 backtick-expansion works with `shell=fish` #6224e32ec03d67 tui: Improved behavior after resize. #620286c2adc074 edit.c: CTRL-SPC: Insert previously-inserted text. #6090c318d8e672 b:changedtick now follows VimL rules #611234e24cb2f7 terminal: Initialize colors in reverse order #6160e8899178ec undo: Don't set b_u_curhead in ex_undojoin() #5869d25649fa01 undo: :earlier, g-: Set b_u_seq_cur correctly. (#6016)
043d8ba422 'Visual-mode put from @. register' #578242c922b32c open_buffer(): Do `BufEnter` for directories.
50d0d89129 inccommand: Preview :sub commands only after delimiter #59321420e10474 CheckHealth improvements #5519c8d5e9230e jobstart(): Return -1 if cmd is not executable. #5671
Reasoning: luajit is not being compiled with sanitizers, lua is. Given that
linking with sanitized libraries requires sanitizers enabled, it is needed to
either compile libnvim-test with sanitizers or link it with lua compiled without
sanitizers. Most easy way to do the latter is just use luajit which is compiled
without sanitizers (as they do not work well with luajit).
No tests yet, no documentation update, no :lua* stuff, no vim module.
converter.c should also work with typval_T, not Object.
Known problem: luaeval("1", {}) results in
PANIC: unprotected error in call to Lua API (attempt to index a nil value)
Ref #3823
- Add support for TEST_FILE to the `oldtest` target, for consistency
with the busted/lua tests.
Caveat: with the busted/lua tests TEST_FILE takes a full path, whereas
for `oldtest` it must be "test_foo.res".
- Add support for NVIM_PRG, again so that all test-related targets are
consistent.
- Use consistent name for NVIM_PRG. But still need to support NVIM_PROG
for QuickBuild CI.
Note: The `oldtest` target is driven by the top-level Makefile, because
it requires a TTY. CMake 3.2 added a USES_TERMINAL flag to
add_custom_target(). But we support CMake 2.8...
add_custom_target(oldtest
COMMAND make clean
COMMAND make NVIM_PRG=$<TARGET_FILE:nvim> $ENV{MAKEOVERRIDES}
DEPENDS nvim
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/nvim/testdir"
USES_TERMINAL true
)
jemalloc's README states:
> jemalloc [is] the FreeBSD libc allocator since 2005. ... Modern jemalloc
> releases continue to be integrated back into FreeBSD
Since FreeBSD ships with jemalloc in some form, we don't need to require
jemalloc there. Less risk, low cost.
FEATURES:
0b5a7e4ad5#4432 API: external UIs can render custom popupmenu
c6ac4f84b1#4934 API: call any API method from vimscript
31df051ed9#4568 API: nvim_call_atomic(): multiple calls in a single request
b268ba353a#5424 API: nvim_win_get_number(), nvim_tabpage_get_number()
e7e2844d46 has("nvim-1.2.3") checks for a specific Nvim version
522b885a0d#5295, #5493 `:CheckHealth` checks tmux, terminfo, performance
719dae2e01#5384 events: allow event processing in getchar()
f25797f869#5386 API: metadata: Nvim version & API level
22dfe6925d#5389 API: metadata: "since", "deprecated_since"
605e74327a Added QuickFixLine highlight group
CHANGES:
4af6ec746c#5253 perf: Disable clipboard in do_cmdline()
6e9f329d05#5299 perf: Skip foldUpdate() in insert-mode.
9d4fcec7c6#5426 perf: Do not auto-update folds for some foldmethods.
eeec0cab58#5419 tui: Default to normal-mode cursor shape.
FIXES:
e83845285c#5436 tui: Fix "weird characters" / "bleeding termcodes"
10a54ad12e#5243 signal_init: Always unblock SIGCHLD.
bccb49bedb#5316 eval.c: Fix memory leak for detached pty job
626065d385#5227 tchdir: New tab should inherit CWD.
cd321b7d0f#5292 getcwd(): Return empty string if CWD is invalid.
6127eaef05 shada: Fix non-writeable ShaDa directory handling
ca65514a24#2789 system(): Respect shellxescape, shellxquote
2daf54ee8d#4874 Restore vim-like tab dragging
0c536b5d8a#5319 syntax.c: Support bg/fg special color-names.
3c53371b0c#4972 from justinmk/schedule-ui_refresh
68bcb32ec4#4789 tui.c: Do not wait for tui loop on teardown.
c8b6ec2e6a#5409 v:count broken in command-line window
6bc3bcefc6#5461 fix emoji display
51937e1322#5470 fix :terminal with :argadd, :argu
79d77da8a0#5481 external UIs: opening multiple files from command-line
657ba62a84#5501 rplugin: resolve paths in manifest file
6a6f188d2a#5502 system('foo &', 'bar'): Show error, don't crash.
1ff162c0d9#5515 os_nodetype: open fd with O_NONBLOCK
2a6c5bb0c4#5450 modeline: Handle version number overflow.
0ade1bb706#5225 CI tests now run against Windows!
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.
Since C leaves whether char is signed or unsigned up to the implementer,
there are different defaults on different architectures.
Forcing unsigned char for one of our CI builds should help catch these
issues moving forward.
In Windows Lua's os.tmpname() returns relative paths starting with \s,
prepend them with $TEMP to generate a valid path.
In OS X os.tmpname() returns paths in '/tmp' but they should be in
'/private/tmp'. We cannot use os_name() for platform detection because
some tests use tempname() before nvim is spawned, instead use one of the
following:
1. Set SYSTEM_NAME environment variable before calling the tests, it
is set from CMAKE_SYSTEM_NAME(i.e. uname -s or 'Windows')
2. Call uname -s
3. Assume windows