| Commit message (Collapse) | Author | Age |
... | |
|\ |
|
| |\ |
|
| |\ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Fixes problem introduced by “api: Allow kObjectTypeNil to be zero without
breaking compatibility”: apparently there are clients which use metadata and
there are which aren’t. For the first that commit would not be needed, for the
second that commit misses this critical piece.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Now it checks functions also after every semicolon and closing figure brace,
possibly preceded by whitespaces (tabs and spaces). This should make messing
with declarations in macros not needed.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Function declarations generator is able to handle properly only the *first*
function definition that is in macros, and only if it is the first entity in the
macros. So msgpack_rpc_from_* was already really a static function, additionally
its attributes were useless. This commit switches to explicit declarations and
makes generated functions static.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
During testing found the following bugs:
1. msgpack-gen.lua script is completely unprepared for Float values either in
return type or in arguments. Specifically:
1. At the time of writing relevant code FLOAT_OBJ did not exist as well as
FLOATING_OBJ, but it would be used by msgpack-gen.lua should return type
be Float. I added FLOATING_OBJ macros later because did not know that
msgpack-gen.lua uses these _OBJ macros, otherwise it would be FLOAT_OBJ.
2. msgpack-gen.lua should use .data.floating in place of .data.float. But it
did not expect that .data subattribute may have name different from
lowercased type name.
2. vim_replace_termcodes returned its argument as-is if it receives an empty
string (as well as _vim_id*() functions did). But if something in returned
argument lives in an allocated memory such action will cause double free:
once when freeing arguments, then when freeing return value. It did not cause
problems yet because msgpack bindings return empty string as {NULL, 0} and
nothing was actually allocated.
3. New code in msgpack-gen.lua popped arguments in reversed order, making lua
bindings’ signatures be different from API ones.
|
| |_|/
|/| | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
Introduce multiqueue_process_priority() to process only events at or
above a certain priority.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Asynchronous API functions are served immediately, which means pending
input could change the state of Nvim shortly after an async API function
result is returned.
nvim_get_mode() is different:
- If RPCs are known to be blocked, it responds immediately (without
flushing the input/event queue)
- else it is handled just-in-time before waiting for input, after
pending input was processed. This makes the result more reliable
(but not perfect).
Internally this is handled as a special case, but _semantically_ nothing
has changed: API users never know when input flushes, so this internal
special-case doesn't violate that. As far as API users are concerned,
nvim_get_mode() is just another asynchronous API function.
In all cases nvim_get_mode() never blocks for more than the time it
takes to flush the input/event queue (~µs).
Note: This doesn't address #6166; nvim_get_mode() will provoke #6166 if
e.g. `d` is operator-pending.
Closes #6159
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Also re-word some error messages:
- "Key does not exist: %s"
- "Invalid channel: %<PRIu64>"
- "Request array size must be 4 (request) or 3 (notification)"
- "String cannot contain newlines"
References #6150
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
Closes #5984
|
| |/
|/| |
|
| |
| |
| |
| |
| |
| | |
msgpack-c previously only had MSGPACK_OBJECT_FLOAT, which was a 64-bit
value. Now, 32-bit and 64-bit floats are supported as distinct types,
but we'll simply continue to treat everything as 64-bit types.
|
|/
|
|
| |
Function was renamed and changed to return `const char *`.
|
|
|
|
|
|
|
| |
In terminal-mode these options are nonsense because cursor is placed at
end of buffer to "follow" output.
Closes #2259
|
| |
|
|
|
|
|
|
|
|
|
|
| |
STR_CASE previously used a NULL data pointer for the String object, but
this pushes the NULL checks to the rest of the code. Instead,
allocating an empty string solves the same issue of there not being any
data but ensures that we're not passing NULL to functions that don't
expect it.
Closes #5627
|
|
|
|
|
|
| |
Attempting to serialize a NULL string through msgpack results in
msgpack_sbuffer_write attempting to memcpy from a NULL pointer, which is
undefined behavior.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Since data.integer is a different (larger) integer type than
data.{buffer,window,tabpage}, we cannot abuse the union by using
data.integer to access the value for all 4 types. Instead, remove the
{buffer,window,tabpage} members and always use the integer member.
In order to accomodate this, perform distinct validation and coercion
between the Integer type and Buffer/Window/Tabpage types in
object_to_vim, msgpack_rpc helpers, and gendispatch.lua.
|
|
|
|
| |
remove unused response_id parameter of handle_nvim_... helpers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`lib/queue.h` implements a basic queue. `event/queue.c` implements
a specialized data structure on top of lib/queue.h; it is not a "normal"
queue.
Rename the specialized multi-level queue implemented in event/queue.c to
"multiqueue", to avoid confusion when reading the code.
Before this change one can eventually notice that "macros (uppercase
symbols) are for the normal queue, lowercase operations are for the
multi-level queue", but that is unnecessary friction for new developers
(or existing developers just visiting this part of the codebase).
|
|
|
|
| |
This applies both to msgpack-rpc and eval.
|
|
|
|
| |
also allow handle==0 meaning curbuf/curwin/curtab
|
|
|
|
| |
header generator.
|
|
|
|
| |
This makes stderr and exit callbacks work for rpc jobs
|
| |
|
|
|
|
| |
Closes #3364
|
|
|
|
|
|
|
|
|
| |
Also adds one exception to linter rules:
typedef struct {
kvec_t(Object) stack;
} EncodedData;
is completely valid (from the style guide point of view) code.
|
|
|
|
|
|
|
|
|
|
|
| |
It appears that used msgpack library is not able to parse back message created
by msgpack_rpc_from_object() if nesting level is too high, so log_server_msg now
cares about msgpack_unpack_next() return value. Also error message from
server_notifications_spec.lua is not readable if something is wrong (though at
least now it does not crash when parsing deeply nested structures).
log_server_msg() in the test reports
[msgpack-rpc] nvim -> client(1) [error] "parse error"
|
|
|
|
|
|
| |
This removes some stack overflows in new test regarding deeply nested variables.
Now in place of crashing vim_to_object/msgpack_rpc_from_object/etc it crashes
clear_tv with stack overflow.
|
| |
|
|\
| |
| | |
Rename main loop variable from loop to main_loop
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Current name is inappropriate for the following reasons:
1. It is often masked by local `loop` variables.
2. It cannot be searched for. There are many `loop` variables where `loop` is
some local variable. There are many cases when “loop” word is used in
a comment.
3. It is in any case bad idea to use a generic name as a name of the global
variable. Best if global has module prefix: this is why it is in `main.h`:
`main_loop` both stands for “a main loop” and “a loop defined in `main.*`”.
Since I have no idea how to list every occurrence of this variable method used
to rename it is “remove it from globals.h, try to compile, fix errors”. Thus if
some occurrence was hidden under false `#if` branch it was not replaced.
|
| | |
|
|/ |
|
| |
|
| |
|
|
|
|
| |
Originally there were 128 new errors, so I thought this is a good idea to fix
all of them. Of course, this commit also fixes many suppressed errors.
|
| |
|
| |
|
|
|
|
| |
msgpack_rpc_dispatch doesn't exist anymore
|
|
|
|
|
|
|
|
|
|
|
| |
When converting a msgpack object to a String object, strings (and byte
arrays) with length 0 are handled as errors. This is fixed by
always using the msgpack data pointer as a valid pointer. For a NULL
pointer there is nothing to copy.
Test by @snoe
Fixes #3844
|