aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/eval.lua8
-rw-r--r--src/nvim/eval/funcs.c3
-rw-r--r--src/nvim/fileio.c2
-rw-r--r--src/nvim/options.lua3
-rw-r--r--src/nvim/os/env.c5
-rw-r--r--src/nvim/os/pty_process_win.c26
6 files changed, 28 insertions, 19 deletions
diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua
index 94c9af50d4..b7120d5dd5 100644
--- a/src/nvim/eval.lua
+++ b/src/nvim/eval.lua
@@ -4365,7 +4365,7 @@ M.funcs = {
{pos1} and {pos2} must both be |List|s with four numbers.
See |getpos()| for the format of the list. It's possible
to specify positions from a different buffer, but please
- note the limitations at |getregion-notes|
+ note the limitations at |getregion-notes|.
The optional argument {opts} is a Dict and supports the
following items:
@@ -4399,9 +4399,9 @@ M.funcs = {
- If {pos1} and {pos2} are not in the same buffer, an empty
list is returned.
- {pos1} and {pos2} must belong to a |bufloaded()| buffer.
- - It is evaluated in current window context, this makes a
- different if a buffer is displayed in a different window and
- 'virtualedit' or 'list' is set
+ - It is evaluated in current window context, which makes a
+ difference if the buffer is displayed in a window with
+ different 'virtualedit' or 'list' values.
Examples: >
:xnoremap <CR>
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c
index 67443b66bc..2f9472f158 100644
--- a/src/nvim/eval/funcs.c
+++ b/src/nvim/eval/funcs.c
@@ -2862,7 +2862,7 @@ static void f_getregion(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
return;
}
- buf_T *save_curbuf = curbuf;
+ buf_T *const save_curbuf = curbuf;
if (fnum1 != 0) {
buf_T *findbuf = buflist_findnr(fnum1);
@@ -2870,7 +2870,6 @@ static void f_getregion(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
if (findbuf == NULL || findbuf->b_ml.ml_mfp == NULL) {
return;
}
- save_curbuf = curbuf;
curbuf = findbuf;
}
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 2c96e4bd87..695631a6f7 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -3153,7 +3153,7 @@ void buf_reload(buf_T *buf, int orig_mode, bool reload_options)
curbuf->b_flags |= BF_CHECK_RO; // check for RO again
keep_filetype = true; // don't detect 'filetype'
if (readfile(buf->b_ffname, buf->b_fname, 0, 0,
- (linenr_T)MAXLNUM, &ea, flags, false) != OK) {
+ (linenr_T)MAXLNUM, &ea, flags, shortmess(SHM_FILEINFO)) != OK) {
if (!aborting()) {
semsg(_("E321: Could not reload \"%s\""), buf->b_fname);
}
diff --git a/src/nvim/options.lua b/src/nvim/options.lua
index 4452df413a..72f9ff849d 100644
--- a/src/nvim/options.lua
+++ b/src/nvim/options.lua
@@ -7331,7 +7331,8 @@ return {
items, for instance "scanning tags"
q do not show "recording @a" when recording a macro *shm-q*
F don't give the file info when editing a file, like *shm-F*
- `:silent` was used for the command
+ `:silent` was used for the command; note that this also
+ affects messages from 'autoread' reloading
S do not show search count message when searching, e.g. *shm-S*
"[1/5]"
diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c
index 0d4452662d..5b1cb01976 100644
--- a/src/nvim/os/env.c
+++ b/src/nvim/os/env.c
@@ -586,6 +586,9 @@ void expand_env_esc(char *restrict srcp, char *restrict dst, int dstlen, bool es
bool copy_char;
bool mustfree; // var was allocated, need to free it later
bool at_start = true; // at start of a name
+#if defined(BACKSLASH_IN_FILENAME)
+ char *const save_dst = dst;
+#endif
int prefix_len = (prefix == NULL) ? 0 : (int)strlen(prefix);
@@ -726,7 +729,7 @@ void expand_env_esc(char *restrict srcp, char *restrict dst, int dstlen, bool es
// with it, skip a character
if (after_pathsep(dst, dst + c)
#if defined(BACKSLASH_IN_FILENAME)
- && dst[-1] != ':'
+ && (dst == save_dst || dst[-1] != ':')
#endif
&& vim_ispathsep(*tail)) {
tail++;
diff --git a/src/nvim/os/pty_process_win.c b/src/nvim/os/pty_process_win.c
index fdc06f9804..12831ff05f 100644
--- a/src/nvim/os/pty_process_win.c
+++ b/src/nvim/os/pty_process_win.c
@@ -32,11 +32,10 @@ static void start_wait_eof_timer(void **argv)
FUNC_ATTR_NONNULL_ALL
{
PtyProcess *ptyproc = (PtyProcess *)argv[0];
- Process *proc = (Process *)ptyproc;
- uv_timer_init(&proc->loop->uv, &ptyproc->wait_eof_timer);
- ptyproc->wait_eof_timer.data = (void *)ptyproc;
- uv_timer_start(&ptyproc->wait_eof_timer, wait_eof_timer_cb, 200, 200);
+ if (ptyproc->finish_wait != NULL) {
+ uv_timer_start(&ptyproc->wait_eof_timer, wait_eof_timer_cb, 200, 200);
+ }
}
/// @returns zero on success, or negative error code.
@@ -117,6 +116,8 @@ int pty_process_spawn(PtyProcess *ptyproc)
}
proc->pid = (int)GetProcessId(process_handle);
+ uv_timer_init(&proc->loop->uv, &ptyproc->wait_eof_timer);
+ ptyproc->wait_eof_timer.data = (void *)ptyproc;
if (!RegisterWaitForSingleObject(&ptyproc->finish_wait,
process_handle,
pty_process_finish1,
@@ -176,6 +177,16 @@ void pty_process_close(PtyProcess *ptyproc)
pty_process_close_master(ptyproc);
+ if (ptyproc->finish_wait != NULL) {
+ UnregisterWaitEx(ptyproc->finish_wait, NULL);
+ ptyproc->finish_wait = NULL;
+ uv_close((uv_handle_t *)&ptyproc->wait_eof_timer, NULL);
+ }
+ if (ptyproc->process_handle != NULL) {
+ CloseHandle(ptyproc->process_handle);
+ ptyproc->process_handle = NULL;
+ }
+
if (proc->internal_close_cb) {
proc->internal_close_cb(proc);
}
@@ -204,6 +215,7 @@ static void wait_eof_timer_cb(uv_timer_t *wait_eof_timer)
PtyProcess *ptyproc = wait_eof_timer->data;
Process *proc = (Process *)ptyproc;
+ assert(ptyproc->finish_wait != NULL);
if (proc->out.closed || proc->out.did_eof || !uv_is_readable(proc->out.uvstream)) {
uv_timer_stop(&ptyproc->wait_eof_timer);
pty_process_finish2(ptyproc);
@@ -215,16 +227,10 @@ static void pty_process_finish2(PtyProcess *ptyproc)
{
Process *proc = (Process *)ptyproc;
- UnregisterWaitEx(ptyproc->finish_wait, NULL);
- uv_close((uv_handle_t *)&ptyproc->wait_eof_timer, NULL);
-
DWORD exit_code = 0;
GetExitCodeProcess(ptyproc->process_handle, &exit_code);
proc->status = proc->exit_signal ? 128 + proc->exit_signal : (int)exit_code;
- CloseHandle(ptyproc->process_handle);
- ptyproc->process_handle = NULL;
-
proc->internal_exit_cb(proc);
}