Problem
-------
Because test/busted/outputHandlers/nvim.lua doesn't know if it's running
in a terminal (no "isatty" equivalent), it outputs color codes in CI
logs and local tooling that runs the tests in a pipe:
[1m[33m[ SKIPPED ][0m[0m [36m
This is just noise, hard for humans to read.
Solution
--------
Disable the color codes. If we later find a clever way to detect
a terminal in nvim.lua, we might consider re-enabling colors, but that
would still affect the CI build logs...
Analogous to nodejs's `on('data', …)` interface, here on_key is the "add
listener" interface.
ref 3ccdbc570d#12536
BREAKING_CHANGE: vim.register_keystroke_callback() is now an error.
In particular:
- jobwait: omitting {timeout} arg is the same as -1.
- sockconnect: omitting {opts} arg is the same as {}.
- jobsend: obsoleted by chansend; don't mention it in job_control.txt.
- menu_get: add to |functions| table.
[skip ci]
Set a maximum test run-time of 20 minutes to:
- fail faster
- avoid wasting CI resources
- set a bound on the test time (if tests take longer than 20 minutes we
need to invest in parallelizing them...)
Timeout looks like:
-- Tests exited non-zero: Process terminated due to timeout
-- No output to stderr.
CMake Error at /…/neovim/cmake/RunTests.cmake:86
(message):
functional tests failed with error: Process terminated due to timeout
* Revert "vim-patch:8.1.2294: cursor pos wrong with concealing and search causes a scroll"
* Add a test which covers #13074910bbc3cca
while reverting the screen.c code changes from there.
Fixes#14064
Previously, the handler signature was:
function(err, method, params, client_id, bufnr, config)
In order to better support external plugins that wish to extend the
protocol, there is other information which would be advantageous to
forward to the client, such as the original params of the request that
generated the callback.
In order to do this, we would need to break symmetry of the handlers, to
add an additional "params" as the 7th argument.
Instead, this PR changes the signature of the handlers to:
function(err, result, ctx, config)
where ctx (the context) includes params, client_id, and bufnr. This also leaves
flexibility for future use-cases.
BREAKING_CHANGE: changes the signature of the built-in client handlers, requiring
updating handler calls
Work around a glibc bug where it truncates the argument to fpclassify()
from double to float by implementing fpclassify() ourselves.
Correctness test (Note that the FP_SUBNORMAL test depends on an atof() that
knows how to parse subnormals. Glibc does, not sure about other libcs.):
#include <math.h>
#include <stdint.h>
#include <string.h>
int xfpclassify(double d)
{
uint64_t m;
int e;
memcpy(&m, &d, sizeof(m));
e = 0x7ff & (m >> 52);
m = 0xfffffffffffffULL & m;
switch (e) {
default: return FP_NORMAL;
case 0x000: return m ? FP_SUBNORMAL : FP_ZERO;
case 0x7ff: return m ? FP_NAN : FP_INFINITE;
}
}
#include <assert.h>
#include <stdlib.h>
int main(void)
{
assert(FP_ZERO == xfpclassify(atof("0.0")));
assert(FP_ZERO == xfpclassify(atof("-0.0")));
assert(FP_NORMAL == xfpclassify(atof("1.0")));
assert(FP_NORMAL == xfpclassify(atof("-1.0")));
assert(FP_INFINITE == xfpclassify(atof("inf")));
assert(FP_INFINITE == xfpclassify(atof("-inf")));
assert(FP_NAN == xfpclassify(atof("nan")));
assert(FP_NAN == xfpclassify(atof("-nan")));
assert(FP_SUBNORMAL == xfpclassify(atof("1.8011670033376514e-308")));
return 0;
}
I mistakenly suggested maxlines=&cmdwinheight, forgetting that it is
calculated from topline, not cursor. maxlines=1 makes the most sense in
cmdwin.
ref #15401622a36b1f1
Add a new default autocommand to limit syntax highlighting
synchronization in the command window. This refactors the nvim_terminal
autocommand out of main() and into a new init_default_autocmds()
function, which is now part of the startup process and can be further
extended with more default autocommands down the road.
ref #6289#6399
Problem:
jobwait() returns early if the job was stopped, but the job might have
pending callbacks on its event queue which are required to complete its
teardown. State such as term->closed might not be updated yet (by the
pending callbacks), so codepaths such as :bdelete think the job is still
running.
Solution:
Always flush the job's event queue before returning from jobwait().
ref #15349
fixes#15524
Note: this is obviously a quickfix. A scalabe solution will
involve being able to specify a _list_ of modules to be
put into packages.preload, without needing to manually copypasta
a blurb of C code. Perhaps even involving bytecode for
static builds (to speedup initialization)
* fix(tutor): adjust over-80ch lines and corresponding expect file
* fix(tutor): standardise indentation and formatting, add nowrap modeline
- unifies the formatting/layout, which was a bit inconsistent,
- adds a nowrap modeline
Since the tutor uses a lot of conceals, which are included in the character
count when calculating line wrapping, lines were breaking at what looked like
odd spots, which gives a poor first impression and lowered readability.
I have adjusted some lines to be over 80ch in the source, but once they're
rendered out with conceals, they're actually under 80, so even with nowrap we
don't visually extend past 80.
fix#15088