aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
| * | | shada: Make ignore_buf also inlineZyX2018-03-27
| | | |
| * | | shada: Save numbered marksZyX2018-03-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problems so far: - Marks in the current instance are not adjusted. - Duplicates are not removed (not that it works in Vim either now, not at 8.0.134 at least).
* | | | build/OpenBSD: need -lpthread -lc++abi for LuaJIT (#8215)Utkarsh Anand2018-04-02
| |/ / |/| |
* | | msg: do not scroll entire screen (#8088)Björn Linse2018-03-31
| | |
* | | build/CMake: LANGUAGES config option #8203Marty E. Plummer2018-03-31
| | | | | | | | | | | | Signed-off-by: Marty E. Plummer <hanetzer@startmail.com>
* | | timer_pause: stop the timer resource (#8199)Utkarsh Maheshwari2018-03-30
| |/ |/| | | | | | | If the timer isn't stopped, it still emits events which consume some CPU. Fix #8188
* | lintJames McCoy2018-03-29
| |
* | Merge pull request #6377 from yagebu/option-fixesJames McCoy2018-03-29
|\ \ | | | | | | | | | | | | options: fixes and some refactoring for number options Closes #6696
| * \ Merge branch 'master' into yagebu/option-fixesJames McCoy2018-03-28
| |\ \
| * \ \ Merge branch 'master' into option-fixesJakob Schnitzer2017-06-28
| |\ \ \
| * \ \ \ Merge branch 'master' into option-fixesJakob Schnitzer2017-04-24
| |\ \ \ \
| * | | | | update for changes in master; fix 'window'; testsJakob Schnitzer2017-03-31
| | | | | |
| * | | | | options: more tests; check first set later; stricter validationJakob Schnitzer2017-03-30
| | | | | |
| * | | | | options: fix setglobal for buf-local number optionsJakob Schnitzer2017-03-30
| | | | | |
| * | | | | options: group num_option validation by typeJakob Schnitzer2017-03-30
| | | | | |
| * | | | | options: more of the sameJakob Schnitzer2017-03-30
| | | | | |
| * | | | | options: move more validation togetherJakob Schnitzer2017-03-30
| | | | | |
| * | | | | options: clean up num_options side-effectsJakob Schnitzer2017-03-30
| | | | | |
| * | | | | options: if invalid value is given, reset to old valueJakob Schnitzer2017-03-30
| | | | | |
| * | | | | options: move code around in set_num_optionJakob Schnitzer2017-03-30
| | | | | | | | | | | | | | | | | | | | | | | | handle side-effects after validation
| * | | | | options: setlocal should only set local valueJakob Schnitzer2017-03-30
| | | | | | | | | | | | | | | | | | | | | | | | For 'iminsert' and 'imsearch' the global value was always changed.
* | | | | | build/NetBSD: use kinfo_proc2; undef uint64_t (#8197)Utkarsh Anand2018-03-29
| |_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | closes #8196 For historical reasons, uint64_t and friends are defined both as typedefs and macros. Some platforms that do that define the macros as identity (#define uint64_t uint64_t), others like NetBSD define to the backing type (#define uint64_t __uint64_t). This is normally transparent, except when multiple levels of macro expansions are used inconsistently.
* | | | | TUI: implement "standout" attribute #8081Nimit Bhardwaj2018-03-27
| |_|_|/ |/| | | | | | | | | | | closes #8054
* | | | Merge #7881 from ZyX-I/fix-7876Justin M. Keyes2018-03-25
|\ \ \ \
| * | | | *: Replace did_throw checks with current_exception checksZyX2018-03-25
| | | | | | | | | | | | | | | Removes obsolete did_throw after that.
| * | | | *: Make sure that !did_throw implies !current_exceptionZyX2018-03-25
| | | | | | | | | | | | | | | | | | | | Fixes #7876
* | | | | vim-patch:8.0.0417: test for the clipboard fails sometimes (#8174)KunMing Xie2018-03-25
|/ / / / | | | | | | | | | | | | | | | | Problem: Test for the clipboard fails sometimes. Solution: Add it to the flaky tests. https://github.com/vim/vim/commit/0fbff646d5beb1f48c9be3d0ce0339be90fd49f5
* | | | vim-patches: test_system.vimJustin M. Keyes2018-03-24
| | | | | | | | | | | | | | | | | | | | | | | | vim-patch:8.0.0185: system() test fails on MS-Windows vim-patch:8.0.0197: system() test skips some parts for MS-Windows vim-patch:8.0.0701: system test failing when using X11 forwarding
* | | | vim-patch:8.0.0184: fix ex-mode exit code #7943sohnryang2018-03-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: When in Ex mode and an error is caught by try-catch, Vim still exits with a non-zero exit code. Solution: Don't set ex_exitval when inside a try-catch. (partly by Christian Brabandt) https://github.com/vim/vim/commit/2b7bc567b9238aaac682236cb4f727d0376e1302
* | | | win: defaults: 'shellcmdflag', 'shellxquote' #7343Jan Edmund Lazo2018-03-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | closes #7698 Wrapping a command in double-quotes allows cmd.exe to safely dequote the entire command as if the user entered the entire command in an interactive prompt. This reduces the need to escape nested and uneven double quotes. The `/s` flag of cmd.exe makes the behaviour more reliable: :set shellcmdflag=/s\ /c Before this patch, cmd.exe cannot use cygwin echo.exe (as opposed to cmd.exe `echo` builtin) even if it is wrapped in double quotes. Example: :: internal echo > cmd /s /c " echo foo\:bar" " foo\:bar" :: cygwin echo.exe > cmd /s /c " "echo" foo\:bar" " foo:bar
* | | | Merge #4419 'implement <Cmd> key'Justin M. Keyes2018-03-24
|\ \ \ \
| * | | | getchar: implement <Cmd> key to invoke command in any modeBjörn Linse2018-03-23
| | | | |
* | | | | refactor/rename: path_to_absolute()Justin M. Keyes2018-03-24
| | | | |
* | | | | refactor/rename: path_try_shorten_fname()Justin M. Keyes2018-03-24
| | | | |
* | | | | refactor/rename: path_is_absolute()Justin M. Keyes2018-03-24
| | | | |
* | | | | refactor: eliminate `autocmd_fname_full` globalJustin M. Keyes2018-03-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's a micro-optimization; check path_is_absolute_path(autocmd_fname) instead. The main optimization (which is still in place) afforded by Vim 7.2.021 was to avoid resolving <afile> when it is not needed.
* | | | | provider/RPC: apply_autocmds_group(): fix double-freeJustin M. Keyes2018-03-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During provider dispatch, eval_call_provider() saves global state--including pointers, such as `autocmd_fname`--into `provider_caller_scope` which is later restored by f_rpcrequest(). But `autocmd_fname` is special-cased in eval_vars(), for performance (see Vim patch 7.2.021; this is also the singular purpose of the `autocmd_fname_full` global. Yay!) If eval_vars() frees `autocmd_fname` then its provider-RPC-scoped alias becomes a problem. Solution: Don't free autocmd_fname in eval_vars(), just copy into it. closes #5245 closes #5617 Reference ------------------------------------------------------------------------ Vim patch 7.2.021 https://github.com/vim/vim/commit/f6dad43c98f47da1ff9d8c99b320fc3674f83c63 Problem: When executing autocommands getting the full file name may be slow. (David Kotchan) Solution: Postpone calling FullName_save() until autocmd_fname is used. vim_dev discussion (2008): "Problem with CursorMoved AutoCommand when Editing Files on a Remote WIndows Share" https://groups.google.com/d/msg/vim_dev/kj95weZa_eE/GTgj4aq5sIgJ
* | | | | vim-patch:8.0.0387: compiler warnings (#8162)KunMing Xie2018-03-23
|/ / / / | | | | | | | | | | | | | | | | Problem: compiler warnings Solution: Add type casts. (Christian Brabandt) https://github.com/vim/vim/commit/b113c3a618113122e62697dd73427261f8c51b2c
* | | | vim-patch:8.0.0357: crash when setting 'guicursor' to weird value (#8161)KunMing Xie2018-03-22
| | | | | | | | | | | | | | | | | | | | Problem: Crash when setting 'guicursor' to weird value. Solution: Avoid negative size. (Dominique Pelle, closes vim/vim#1465) https://github.com/vim/vim/commit/24922ec23360e7ea7c5a803c9edf476bb6395b32
* | | | Merge #8147 'Run old tests in :terminal'Justin M. Keyes2018-03-21
|\ \ \ \
| * | | | oldtests: Make test output least verboseZyX2018-03-21
| | | | | | | | | | | | | | | | | | | | Also removes `-` before `rm -rf` as `-f` is supposed to already suppress error.
| * | | | oldtests: Run old tests in :terminalZyX2018-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reasoning: - No need to check for terminal size. - No need to mess with terminal title. - Allows old tests to timeout with the rest of the build proceeding. - Less and less messy output to travis log. - Opens a path allowing old tests run in parallel. Though last bit needs test refactoring.
* | | | | build/cmake: avoid CMP0054 (#8149)Justin M. Keyes2018-03-20
| | | | | | | | | | | | | | | CMP0054: Only interpret if() arguments as variables or keywords when unquoted.
* | | | | Merge #8128 'build/windows: Simplify build requirements'Justin M. Keyes2018-03-18
|\ \ \ \ \
| * | | | | build: avoid CMP0046 "dependency target does not exist" #8128Justin M. Keyes2018-03-18
| |/ / / /
* / / / / log/channels: Formatting. Also log loopback channel. #8146Justin M. Keyes2018-03-18
|/ / / /
* | | | Merge #8107 'jobs: separate process-group'Justin M. Keyes2018-03-18
|\ \ \ \
| * | | | 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; +}
| * | | | win: nvim_get_proc_children()Justin M. Keyes2018-03-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TODO: Raymond Chen explains[1] racy behavior of the CreateToolhelp32Snapshot approach. Better approach: > create a job object and put process P in it. Then call > QueryInformationJobObject with JobObjectBasicProcessIdList to get the > list of child processes. [1] "Why is CreateToolhelp32Snapshot returning incorrect parent process IDs all of a sudden?" https://blogs.msdn.microsoft.com/oldnewthing/20150403-00/?p=44313
| * | | | 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.