aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/msgpack_rpc
Commit message (Collapse)AuthorAge
...
* | lib/kvec: Do not use kv_init unless neededZyX2016-05-30
| |
* | lib/kvec: Remove useless type argument from kv_push macrosZyX2016-05-30
|/
* api: refactor remote ui to use API dispatch generationBjörn Linse2016-05-27
|
* syntax: Add support for the "special" color used for undercurlsAdnoC2016-05-17
|
* *: Fix new linter errorsZyX2016-05-01
| | | | 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.
* Merge tempfile.c back into fileio.cJurica Bradaric2016-04-20
|
* *: Make set_vim_var_\* functions have proper argument typesZyX2016-04-18
|
* bufhl: fix unittests and lintBjörn Linse2016-02-23
| | | | msgpack_rpc_dispatch doesn't exist anymore
* helpers.c: Handle msgpack str/bin objects with length 0 correctlyoni-link2015-12-21
| | | | | | | | | | | 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
* Allow server_start to accept a NULL argumentRui Abreu Ferreira2015-10-18
| | | | | | Return 1 if the endpoint argument is NULL, server_start() can get a NULL value when using server_address_new() or vim_tempname(). Removed the function attribute.
* Implement server_address_new()Rui Abreu Ferreira2015-10-18
| | | | | | | | | | | | | | | | When creating a local socket/pipe (server_start()) Neovim used vim_tempname() to generate a unique socket path. For Windows UNIX filepaths cannot be used as pipe names (they must start with \\.\pipe\). This commit replaces the use of vim_tempname() for server addresses with server_address_new(). server_address_new() generates unique names for local sockets/pipes - for UNIX it uses vim_tempname(), for Windows generates names in the form \\.\pipe\nvim-PID-COUNTER where PID is the current process id, and COUNTER is a static uint32_t counter incremented with every call. This function is now used for server_start() and server_init() when no address is available.
* api: represent api type String as msgpack type STR. closes #1250Björn Linse2015-10-08
|
* log: Make logging thread-safeThiago de Arruda2015-09-06
|
* Windows: avoid "uv_" naming conflicts. #3225Seth Jackson2015-08-27
|
* main: Initialize event loop before command_line_scanThiago de Arruda2015-08-21
| | | | | | | | The call to `event_init()` was too late. `command_line_scan()` in `main()` could already need the loop initialized. Ref https://github.com/neovim/neovim/issues/3045#issuecomment-123405833. A consequence of this change is that it was necessary to move the `channel_from_stdio()` call to `command_line_scan()` when embedded_mode is set.
* tui/remote_ui: Fix some regressionsThiago de Arruda2015-08-21
| | | | | | | | - Explicitly set the SignalWatcher event queue. Without this, the watcher will publish events to the fast queue, resulting in resize bugs for certain terminals(#2322). - Set `async = false` to the `remote_ui_attach` handler(It was a deferred before, this is the new equivalent)
* Notify attached UIs whenever menus changeRobin Allen2015-08-21
| | | | | This adds a redraw notification "update_menu" which is sent whenever Vim's menus are changed by the :menu command and friends.
* rstream: Pass read count to read eventsThiago de Arruda2015-08-13
| | | | This is necessary to keep events in the same order received from the OS.
* event: Refactor async event processingThiago de Arruda2015-08-13
| | | | | | | | | | - Improve the implementation of deferred/immediate events. - Use the new queue module to change how/when events are queued/processed by giving a private queue to each emitter. - Immediate events(which only exist to break uv_run recursion) are now represented in the `loop->fast_events` queue. - Events pushed to child queues are propagated to the event loop main queue and processed as K_EVENT keys.
* process: Pass loop reference during initializationThiago de Arruda2015-08-13
| | | | | Change the API so that it is passed to {uv,pty}_process_init instead of `process_spawn`.
* msgpack: Replace FUNC_ATTR_DEFERRED by FUNC_ATTR_ASYNCThiago de Arruda2015-08-13
| | | | | | | | | | | API functions exposed via msgpack-rpc now fall into two categories: - async functions, which are executed as soon as the request is parsed - sync functions, which are invoked in nvim main loop when processing the `K_EVENT special key Only a few functions which can be safely executed in any context are marked as async.
* channel.c: Only free a channel after close callbacks are executed #3132oni-link2015-08-05
| | | | | | | | | | | | parse_msgpack() closes a channel's stream on EOF error and the stream's close callback close_cb() is queued for the next libuv loop iteration. When parse_msgpack() returns, it has freed the channel and the queued stream callback will access this freed memory. To prevent this, increase the channel's reference count and let the stream's close callback call decref(). Fixes #3128
* tui: Use underline cursor in Replace modeOmar Sandoval2015-07-26
| | | | | | | This is a port of my original contribution to Vim, added in 7.4.687 (https://github.com/vim/vim/commit/v7-4-687). The TUI code has been heavily refactored (see esp. 25ceadab37edba13f5afa78d8b4723da03ef35f0), so this required some translation, but the logic is the same.
* api: Simplify UI API on mode changeOmar Sandoval2015-07-26
| | | | | | | Currently, there are two functions in the UI API that are called when the mode changes: insert_mode() and normal_mode(). These can be folded into a single mode_change() entrypoint which can do whatever it wants based on the mode it is passed, limited to INSERT and NORMAL for now.
* job: Replace by a better process abstraction layerThiago de Arruda2015-07-17
| | | | | | | | | | | | | - New libuv/pty process abstraction with simplified API and no globals. - Remove nvim/os/job*. Jobs are now a concept that apply only to programs spawned by vimscript job* functions. - Refactor shell.c/channel.c to use the new module, which brings a number of advantages: - Simplified API, less code - No slots in the user job table are used - Not possible to acidentally receive data from vimscript - Implement job table in eval.c, which is now a hash table with unilimited job slots and unique job ids.
* server: Extract most logic into the new socket abstractionThiago de Arruda2015-07-17
| | | | | | - Move event loop code into event/socket - Reimplement server.c on top of the new SocketWatcher class - Adapt msgpack_rpc/channel.c
* rstream/wstream: Unify structures and simplify APIThiago de Arruda2015-07-17
| | | | | | | | | | | | | - Simplify RStream/WStream API and make it more consistent with libuv. - Move into the event loop layer(event subdirectory) - Remove uv_helpers module. - Simplify job/process internal modules/API. - Unify RStream and WStream into a single structure. This is necessary because libuv streams can be readable and writable at the same time(and because the uv_helpers.c hack to associate multiple streams with libuv handle was removed) - Make struct definition public, allowing more flexible/simple memory management by users of the module. - Adapt channel/job modules to cope with the changes.
* event loop: New abstraction layer with refactored time/signal APIThiago de Arruda2015-07-17
| | | | | | | | | | - Add event loop abstraction module under src/nvim/event. The src/nvim/event/loop module replaces src/nvim/os/event - Remove direct dependency on libuv signal/timer API and use the new abstraction instead. - Replace all references to uv_default_loop() by &loop.uv, a new global variable that wraps libuv main event loop but allows the event loop functions to be reused in other contexts.
* rbuffer: Reimplement as a ring buffer and decouple from rstreamThiago de Arruda2015-07-01
| | | | | | | | | | | | | | | | | | | | Extract the RBuffer class from rstream.c and reimplement it as a ring buffer, a more efficient version that doesn't need to relocate memory. The old rbuffer_read/rbuffer_write interfaces are kept for simple reading/writing, and the RBUFFER_UNTIL_{FULL,EMPTY} macros are introduced to hide wrapping logic when more control is required(such as passing the buffer pointer to a library function that writes directly to the pointer) Also add a basic infrastructure for writing helper C files that are only compiled in the unit test library, and use this to write unit tests for RBuffer which contains some macros that can't be accessed directly by luajit. Helped-by: oni-link <knil.ino@gmail.com> Reviewed-by: oni-link <knil.ino@gmail.com> Reviewed-by: Scott Prager <splinterofchaos@gmail.com> Reviewed-by: Justin M. Keyes <justinkz@gmail.com> Reviewed-by: Michael Reed <m.reed@mykolab.com>
* ASan: Fix "null pointer passed for argument declared to never be null". #2925Florian Walch2015-06-30
| | | | | | | | Arguments passed to xmemdupz() are sometimes NULL, but xmemdupz() has FUNC_ATTR_NONNULL_ALL. Check pointers for NULL before calling xmemdupz(). Resolves #2533.
* getenv: return NULL if empty #2574Scott Prager2015-05-29
| | | | | | Making an environment variable empty can be a way of unsetting it for platforms that don't support unsetenv(). In most cases, we treat empty variables as having been unset. For all others, use os_env_exists().
* msgpack-rpc: handle failure to convert method arguments #2664Björn Linse2015-05-19
|
* doc: v:servername, serverstart()Justin M. Keyes2015-05-17
|
* server: repurpose legacy v:servernameJustin M. Keyes2015-05-17
| | | | | | | - On startup, v:servername is equivalent to $NVIM_LISTEN_ADDRESS - v:servername may be considered the "default" server address - v:servername does not change unless the associated server is stopped by serverstop()
* coverity/109019: fixing "Sizeof not portable"Chris Hall2015-05-08
| | | | | | | | | suspicious_sizeof: Passing argument 8UL /* sizeof (char const **) */ to function xcalloc and then casting the return value to char ** is suspicious. In this particular case sizeof (char const **) happens to be equal to sizeof (char const *), but this is not a portable as
* Fix a couple uninitialized variable warnings in the release build.John Szakmeister2015-04-18
| | | | | | Reviewed-by: Eliseo Martínez <eliseomarmol@gmail.com> Reviewed-by: Marco Hinz <mh.codebro@gmail.com> Reviewed-by: Björn Linse <bjorn.linse@gmail.com>
* Merge pull request #2331 from splinterofchaos/serverlistenScott Prager2015-04-14
|\ | | | | vimL: serverlisten({addr}), list(), and stop({addr})
| * eval: learn serverstart, list, and close().Scott Prager2015-04-14
| | | | | | | | | | | | Implement functions for spawning, destroying, and listing active servers, and add server_address_list() to msgpack_rpc/server.c for the serverlist() vimL function.
| * msgpack_rpc/server.c: Use a garray over a kmap.Scott Prager2015-04-14
| | | | | | | | | | | | | | | | | | | | | | | | Testing of server_start() and server_stop() found that after adding a server at address addr, pmap_has(addr) would always return true, but pmap_get(addr) would always return NULL. Since a client is only expected to have a small number of servers, an array may be more efficient than a hash map, anyway. Discussion: https://github.com/neovim/neovim/pull/1302#issuecomment-88487148
* | channel: recognized nvim-style errorsScott Prager2015-04-13
| |
* | msgpack: Allow notifications to execute commands.Scott Prager2015-04-13
|/ | | | | | | | | | Consider: `let vim = rpcstart('nvim', ['--embed'])` Allows `rpcnotify(vim, ...)` to work like an asynchronous `rpcrequest(nvim, ...)`. Helped-by: Michael Reed <m.reed@mykolab.com> Helped-by: Justin M. Keyes <>
* memory: Add `free` wrapper and refactor project to use itThiago de Arruda2015-04-13
| | | | | | We already use wrappers for allocation, the new `xfree` function is the equivalent for deallocation and provides a way to fully replace the malloc implementation used by Neovim.
* memory: Replace klib memory pools by malloc/freeThiago de Arruda2015-04-12
| | | | | | Klib pools were used to improve allocation efficiency for some small objects, but it is not a thread-safe approach. Thread safety in allocations will be required for implementing #2371).
* Fix a memory leak for WBuffers used in channel_write().oni-link2015-04-03
| | | | | | | channel_write() uses a ref-counted buffer for writing. This buffer should be released if it was used in "refcount" channel_write() calls. But calling channel_write() on a closed channel would return early and not decrease the refcount of the used buffer.
* Prevent too early sending of delayed notifications.oni-link2015-04-03
| | | | | | | | | | | | | | Notifications for a channel will be sent directly if there are no pending requests (for this channel). Otherwise notifications are queued for later sending. But in two cases a notification could be sent with pending requests: * Broadcasting a notification * A channel that has just finished its last pending request would call send_delayed_notifications() for all channels. To prevent this, every channel can now only send its own delayed notifications and broadcasting checks for pending requests.
* eval: Refactor vimscript job control APIThiago de Arruda2015-03-29
| | | | | | | | | | - Remove JobActivity autocmd and v:job_data variable - Simplify `jobstart` to receive: - An argument vector - An optional dictionary which may contain any of the current `jobstart` options plus `on_stdout`, `on_stderr` and `on_exit` callbacks. - Refactor and add more job tests - Update documentation
* doc: Misc. cleanupJustin M. Keyes2015-03-24
| | | | | | | | | | 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 @ ..."
* Merge pull request #2144 from jszakmeister/fix-warning-in-releaseJohn Szakmeister2015-03-20
|\ | | | | Fix a couple warnings in the release build.
| * Avoid an unused variable warning in the release build.John Szakmeister2015-03-13
| |
* | ui: Replace cursor_{on,off} by busy_{stop,start}Thiago de Arruda2015-03-15
|/ | | | | | | | | | | | | | | | | | | | | | | | 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).