| Commit message (Collapse) | Author | Age |
... | |
|
|
|
|
|
|
|
|
|
| |
Add missing parentheses and whatnot, move dangling comment, etc. Some
specific items worth mentioning:
Fixed some references to non-existent tags, found via `make html`
msgpack_rpc/channel.c:
ELOG already prefixes each line with "error @ ..."
|
|\
| |
| | |
Fix a couple warnings in the release build.
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Switching cursor off is only necessary in two occasions:
- When redrawing to avoid terminal flickering
- When the editor is busy
The first can now be handled by the TUI, so most calls to ui_cursor_off can be
removed from the core.
So, before this commit it was only necessary to switch the cursor off to notify
the user that nvim was running some long operation. Now the cursor_{on,off}
functions have been replaced by busy_{stop,start} which can be handled in a
UI-specific way(turning the cursor off or showing a busy indicator, for
example).
To make things even more simpler, nvim is always busy except when waiting for
user input or other asynchronous events: It automatically switches to a non-busy
state when the event loop is about to be entered for more than 100 milliseconds.
`ui_busy_start` can be called when its not desired to change the busy state in
the event loop (As its now done by functions that perform blocking shell
invocations).
|
|
|
|
| |
Make the error messages more precise and uniform.
|
|
|
|
|
|
|
|
| |
- process spawning was decoupled from the rest of the job control logic. The
goal is reusing it for spawning processes connected to pseudo terminal file
descriptors.
- job_start now receives a JobOptions structure containing all the startup
options.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Removed term.c, term.h and term_defs.h
- Tests for T_* values were removed. screen.c was simplified as a
consequence(the best strategy for drawing is implemented in the UI layer)
- Redraw functions now call ui.c functions directly. Updates are flushed with
`ui_flush()`
- Removed all termcap options(they now return empty strings for compatibility)
- &term/&ttybuiltin options return a constant value(nvim)
- &t_Co is still available, but it mirrors t_colors directly
- Remove cursor tracking from screen.c and the `screen_start` function. Now the
UI is expected to maintain cursor state across any call, and reset it when
resized.
- Remove unused code
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Remove abstract_ui global, now it is always active
- Remove some terminal handling code
- Remove unused functions
- Remove HAVE_TGETENT/TERMINFO/TERMIOS/IOCTL #ifdefs
- Remove tgetent/terminfo from version.c
- Remove curses/terminfo dependencies
- Only start/stop termcap when starting/exiting the program
- msg_use_printf will return true if there are no attached UIs(
messages will be written to stdout)
- Remove `ex_winpos`(implement `:winpos` with `ex_ni`)
|
|
|
|
|
|
|
|
|
| |
Problem : Read from pointer after free @ {242, 391}.
Diagnostic : Real issues.
Rationale : Channel gets indeed freed on error case, producing
incorrect accesses to freed pointer later on.
Resolution : Implement reference counting mechanism to know when to free
channel.
|
|
|
|
|
|
|
| |
closes #1899
closes #1967
refs https://github.com/msgpack/msgpack-c/pull/194
|
|
|
|
|
|
|
| |
Don't attempt to write an error message to a channel that may have been
closed and freed.
[CID #102150](https://scan8.coverity.com/reports.htm#v22612/p10672/fileInstanceId=3625286&defectInstanceId=1525721&mergedDefectId=102150)
|
| |
|
|
|
|
|
| |
This is required to send redraw notifications while a msgpack-rpc call is being
performed by another channel.
|
|
|
|
|
| |
Forward the command to the remote UI and flush immediately. The
semantics/handling is UI-specific.
|
| |
|
|
|
|
| |
When set to false, nvim will send cterm color numbers with `highlight_set`.
|
| |
|
| |
|
|
|
|
| |
Also disable deferral of attach_ui
|
|
|
|
|
| |
It is necessary to notify the UI when the default background/foreground colors
change in order to render correctly.
|
| |
|
|
|
|
|
| |
This is required to send redraw notifications while a msgpack-rpc call is being
performed by another channel.
|
|
|
|
|
|
| |
- Remove suspend method from the UI protocol
- Handle `:suspend` by disconnecting the last channel that sent a request to
nvim.
|
| |
|
|
|
|
| |
When set to false, nvim will send cterm color numbers with `highlight_set`.
|
| |
|
| |
|
|
|
|
| |
Also don't defer attach_ui handling
|
|
|
|
|
| |
It is necessary to notify the UI when the default background/foreground colors
change in order to render correctly.
|
|
|
|
|
| |
The remote_ui module is an implementation of the UI layer, and it attaches UI
instances that redirect redraw notifications to connected clients.
|
| |
|
|
|
|
|
|
|
|
|
| |
ASAN detected this heap-use-after-free.
A job started by channel_from_job() could terminate and result in a call
to free_channel(), while channel_send_call() was still active/pending
and accessing Channel elements.
Original patch by @tarruda.
|
|
|
|
|
| |
LSAN/ASAN detected, on an error code path, that not all elements of a
struct ChannelCallFrame were freed.
|
| |
|
|
|
|
|
| |
When a job fails to start, it will already call the exit_cb which takes care of
freeing the channel.
|
|
|
|
|
| |
The argument argv of job_start() and channel_from_job() will be
freed. Mark them as such in the comments of this functions.
|
|
|
|
|
|
| |
- When an invalid msgpack RPC msg is received from a channel
we now close that channel all calls on that channel fail with
an error message.
|
| |
|
| |
|
|
|
|
|
| |
- When validating a msgpack msg we need to return on the first error
otherwise we can SEGFAULT with invalid checks
|
|
|
|
|
|
|
|
|
|
| |
It is currently possible for a client to send a response that doesn't match the
current server->client request(at the top of the stack). This commit fixes that
by delaying notifications to until the first `channel_send_call` invocation
returns.
Also remove the "call stack" size check, vim will already break if the call
stack goes too deep.
|
|
|
|
|
| |
Since `mch_exit` will re-enter event_poll, it is necessary to call it outside
libuv event loop.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit @264e0d872c("Remove automatic event deferral") removed the immediate
event queue because event deferral now had to be explicit. The problem is that
while some events don't need to be deferred, they still can result in recursive
`event_poll` calls, and recursion is not supported by libuv. Examples of those
are msgpack-rpc requests while a server->client request is pending, or signals
which can call `mch_exit`(and that will result in `uv_run` calls).
To fix the problem, this reintroduces the immediate event queue for events that
can potentially result in event loop recursion. The non-deferred events are
still processed in `event_poll`, but only after `uv_run` returns.
|
|
|
|
|
|
|
|
| |
If the server fails to start(due to used address for example), the
`server_start` function was freeing the handle memory before it was properly
removed from libuv event loop queue. Fix that by replacing the `free(server)`
call by `uv_close` call, which will take care of freeing the server on the next
event loop iteration. Also replace `EMSG` calls by `ELOG`/`WLOG`.
|
| |
|
|
|
|
|
|
|
|
| |
Passing NULL as the callback for stdout/stderr will result in job_start ignoring
stdout/stderr, respectively. A 'writable' boolean argument was also added, and
when false `job_start` will ignore stdin.
Also, refactor os_system to allow passing NULL as the `output` argument.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
- Expose more logging control from the log.c module(get log stream and omit
newlines)
- Remove logging from the generated functions in msgpack-gen.lua
- Refactor channel.c/helpers.c to log every msgpack-rpc payload using
msgpack_object_print(a helper function from msgpack.h)
- Remove the api_stringify function, it was only useful for logging msgpack-rpc
which is now handled by msgpack_object_print.
|
|
|
|
|
| |
Free the arguments array after sending the response and also avoid
double-sending responses in cases of errors.
|