aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/vim.c
Commit message (Collapse)AuthorAge
...
* multigrid: rename grid->ScreenLines and other grid arraysBjörn Linse2018-12-31
|
* multigrid: Get rid of global ScreenLines and set_screengridUtkarsh Maheshwari2018-12-31
|
* docJustin M. Keyes2018-12-30
| | | | - CMake features
* docJustin M. Keyes2018-11-28
| | | | | | | | | | - develop.txt is for design/guidelines; architecture/concepts should live elsewhere (currently src/nvim/README.md) - move dev-jargon to intro.txt - replace https://neovim.io/community (deprecated) with https://neovim.io/#chat - <Cmd> avoids CmdlineEnter/Leave https://github.com/vim/vim/issues/2889
* api: implement object namespacesBjörn Linse2018-11-24
| | | | | | | | | Namespaces is a lightweight concept that should be used to group objects for purposes of bulk operations and introspection. This is initially used for highlights and virtual text in buffers, and is planned to also be used for extended marks. There is no plan use them for privileges or isolation, neither to introduce nanespace-level options.
* docJustin M. Keyes2018-11-05
| | | | - update standard-plugin-list. closes #8388
* API: Avoid overrun when formatting error-messageJustin M. Keyes2018-09-05
| | | | | | | msgpack_rpc_to_object (called by handle_request .. msgpack_rpc_to_array) always NUL-terminates API Strings. But handle_request .. msgpack_rpc_get_handler_for operates on a raw msgpack_object, before preparation.
* runtime/doc: fix broken links found by `make html`Justin M. Keyes2018-08-25
|
* highlight: refactor to use stateful representationBjörn Linse2018-07-21
| | | | | This allows us to keep track of the source higlight groups, and not only the final combined highlights.
* highlight: extract low-level highlight logic from syntax, uiBjörn Linse2018-07-21
|
* channel.c: refactor spaghetti codemicha2018-07-14
| | | | | | | | | | | | | | | | | | | | channel.c: WIP remove redundant method check and added FUNC_ATTR_NONNULL_ALL macro channel.c channel_defs.h helpers.c: added Error field to RequestEvent, added no_op handler func channel.c: use const char* instead of string and cleanup channel.c; channel_defs.h; helpers.c: removed error from event again; send errors directly to the channel without using handlers and events channel.c: fixed memory leak and lint errors api/private/dispatch.c; api/vim.c; msgpack_rpc/channel.c msgpack_rpc/helpers.c added Error* field to msgpack_get_handler_for; further refactored channel.c channel.c:323 changed order of evaluation in if statement channel.c: removed superflous whitespace dispatch.c: review comment
* doc: job/channel, misc #7783Justin M. Keyes2018-06-11
| | | | | | | | | | | doc: termios defaults. ref #6992 doc: :help shell-powershell doc: provider: Python minimum version is 2.7, 3.4 doc: remove :!start special-case. #5844 doc: mention #7917 change which accepts empty Array for Dictionary parameter doc: <Cmd> pseudokey doc: lmap change #5658 doc: -s, -es
* API: validation: mention invalid method name (#8489)Justin M. Keyes2018-06-07
|
* nvim_list_uis: include channel idBjörn Linse2018-06-01
|
* api: list information about all channels/jobs.Björn Linse2018-05-23
| | | | | Fire autocmd when channel opens or its info changes. Add a way for API clients can describe themselves.
* API: nvim_get_commands(): return DictionaryJustin M. Keyes2018-05-12
|
* API: nvim_get_commands(): more attributesJustin M. Keyes2018-05-11
| | | | | | | Support more :command attributes: -bang -bar -register
* API: nvim_get_commands(): always return keysJustin M. Keyes2018-05-11
| | | | | | - Always return all keys, with at least NIL value. - Require `opts` param to be {"builtin":false} - Validate `opts` param
* API: nvim_get_commands()Nimit Bhardwaj2018-05-11
|
* Merge #8329 'API: Make nvim_set_option() update `:verbose set …`'Justin M. Keyes2018-05-11
|\
| * api: Make nvim_set_option() update `:verbose set ...`b-r-o-c-k2018-05-03
| | | | | | | | | | | | Make `:verbose set ...` show when an option was last modified by an API client or Lua script/chunk. In the case of an API client, the channel ID is displayed.
* | nvim_eval: fix memory leakJustin M. Keyes2018-05-10
| |
* | API: nvim_eval(): return non-generic VimL errorsJustin M. Keyes2018-05-09
| | | | | | | | Use the same pattern as nvim_call_function (_call_function).
* | API: better way to capture abort-causing non-exception errorsJustin M. Keyes2018-05-09
| | | | | | | | | | | | | | | | This condition is not perfectly reliable: (did_emsg && force_abort && !current_exception) The more proper way to check for abort-causing non-exception errors is to set up `msg_list` using the "pattern" given by do_cmdline().
* | API: return non-generic VimL errorsJustin M. Keyes2018-05-09
| | | | | | | | | | | | | | | | | | | | - Return VimL errors instead of generic errors for: - nvim_call_function - nvim_call_dict_function - Fix tests which were silently broken before this change. This violates #6150 where we agreed not to translate API errors. But that can be fixed later.
* | docJustin M. Keyes2018-05-09
| |
* | API: nvim_call_dict_function: expect actual function, not nameJustin M. Keyes2018-05-06
| |
* | API: nvim_call_dict_function: eliminate `internal` paramJustin M. Keyes2018-05-06
| | | | | | | | | | | | The `internal` param is difficult to explain, and will rarely be anything but `true`. To avoid it, use a hack: check if the resolved dict value starts with "function(".
* | refactor: nvim_call_dict_functionJustin M. Keyes2018-05-06
| | | | | | | | | | - Add test coverage for errors. - Rename, rearrange.
* | API: nvim_call_dict_function #3032Sebastian Witte2018-05-06
|/
* Merge #8218 'Fix errors reported by PVS'Justin M. Keyes2018-04-27
|\ | | | | closes #4983
| * api/vim: Fix PVS/V547: node was already dereferenced, so can’t be NULLZyX2018-04-22
| |
* | API: nvim__stats()Justin M. Keyes2018-04-24
| | | | | | | | Use it to verify fsync() behavior.
* | API/nvim_command_output: handle :echon capture (#8265)Justin M. Keyes2018-04-13
|/ | | ref https://github.com/neovim/python-client/pull/290
* API: nvim_get_proc()Justin M. Keyes2018-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TODO: "exepath" field (win32: QueryFullProcessImageName()) On unix-likes `ps` is used because the platform-specific APIs are a nightmare. For reference, below is a (incomplete) attempt: diff --git a/src/nvim/os/process.c b/src/nvim/os/process.c index 09769925aca5..99afbbf290c1 100644 --- a/src/nvim/os/process.c +++ b/src/nvim/os/process.c @@ -208,3 +210,60 @@ int os_proc_children(int ppid, int **proc_list, size_t *proc_count) return 0; } +/// Gets various properties of the process identified by `pid`. +/// +/// @param pid Process to inspect. +/// @return Map of process properties, empty on error. +Dictionary os_proc_info(int pid) +{ + Dictionary pinfo = ARRAY_DICT_INIT; +#ifdef WIN32 + +#elif defined(__APPLE__) + char buf[PROC_PIDPATHINFO_MAXSIZE]; + if (proc_pidpath(pid, buf, sizeof(buf))) { + name = getName(buf); + PUT(pinfo, "exepath", STRING_OBJ(cstr_to_string(buf))); + return name; + } else { + ILOG("proc_pidpath() failed for pid: %d", pid); + } +#elif defined(BSD) +# if defined(__FreeBSD__) +# define KP_COMM(o) o.ki_comm +# else +# define KP_COMM(o) o.p_comm +# endif + struct kinfo_proc *proc = kinfo_getproc(pid); + if (proc) { + PUT(pinfo, "name", cstr_to_string(KP_COMM(proc))); + xfree(proc); + } else { + ILOG("kinfo_getproc() failed for pid: %d", pid); + } + +#elif defined(__linux__) + char fname[256] = { 0 }; + char buf[MAXPATHL]; + snprintf(fname, sizeof(fname), "/proc/%d/comm", pid); + FILE *fp = fopen(fname, "r"); + // FileDescriptor *f = file_open_new(&error, fname, kFileReadOnly, 0); + // ptrdiff_t file_read(FileDescriptor *const fp, char *const ret_buf, + // const size_t size) + if (fp == NULL) { + ILOG("fopen() of /proc/%d/comm failed", pid); + } else { + size_t n = fread(buf, sizeof(char), sizeof(buf) - 1, fp); + if (n == 0) { + WLOG("fread() of /proc/%d/comm failed", pid); + } else { + size_t end = MIN(sizeof(buf) - 1, n); + end = (end > 0 && buf[end - 1] == '\n') ? end - 1 : end; + buf[end] = '\0'; + PUT(pinfo, "name", STRING_OBJ(cstr_to_string(buf))); + } + } + fclose(fp); +#endif + return pinfo; +}
* nvim_get_proc_children: fallback to shellJustin M. Keyes2018-03-16
| | | | | /proc/…/children may be unavailable because of an unset kernel option. Fallback to `pgrep` invoked in a shell.
* API: nvim_get_proc_children()Justin M. Keyes2018-03-16
| | | | ref https://github.com/libuv/libuv/pull/836
* api: nvim_list_uis #8004geekodour2018-03-03
| | | | | ref #7438 closes #4842
* api: nvim_command_output: direct implJustin M. Keyes2018-01-10
|
* api: change nvim_command_output behaviorJustin M. Keyes2018-01-10
| | | | | | | | | | | | | | | | | | | Implement nvim_command_output with `execute({cmd},"silent")`. Behavior changes: - does not provoke any hit-enter prompt - no longer prepends a newline char - does not capture some noise (like the "[New File]" message, see the change to tabnewentered_spec.lua) Technically ("bug-for-bug") this a breaking change. But the previous behavior of nvim_command_output meant that it probably wasn't used for anything outside of tests. Also remove the undocumented `v:command_output` variable which was a hack introduced only for the purposes of nvim_command_output. closes #7726
* docJustin M. Keyes2017-12-26
| | | | | | | | vim-patch:8.0.1206: no autocmd for entering or leaving the command line (commit a4f6cec7a31ff8dbfa089b9e22227afbeb951e9b) NA patches: vim-patch:8.0.0320: warning for unused variable with small build
* *: Fix linter errorsZyX2017-12-12
|
* doc: hack to avoid doxygen bugJustin M. Keyes2017-12-10
| | | | | | | | Use `@cond <something>` to obscure a section from doxygen. doxygen thinks kvec_withinit_t() is a function. That adds noise to the generated API documentation, and also prevents the following function from being noticed.
* Merge #7234 'built-in expression parser'Justin M. Keyes2017-12-09
|\
| * viml/parser/expressions: Make $ENV not depend on &isidentZyX2017-11-26
| |
| * Merge branch 'master' into expression-parserZyX2017-11-26
| |\ | |/ |/|
| * Merge branch 'master' into expression-parserZyX2017-11-19
| |\
| * | viml/parser/expressions: Add support for parsing assignmentsZyX2017-11-12
| | |
| * | *: Fix linter errorsZyX2017-11-06
| | |
| * | Merge branch 'master' into expression-parserZyX2017-11-06
| |\ \