diff options
-rw-r--r-- | src/nvim/fileio.c | 11 | ||||
-rw-r--r-- | src/nvim/main.c | 6 | ||||
-rw-r--r-- | src/nvim/strings.c | 2 | ||||
-rw-r--r-- | test/functional/clipboard/clipboard_provider_spec.lua | 14 |
4 files changed, 21 insertions, 12 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 9c64be6d0c..873c15ff4a 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -700,16 +700,9 @@ readfile ( wasempty = (curbuf->b_ml.ml_flags & ML_EMPTY); if (!recoverymode && !filtering && !(flags & READ_DUMMY)) { - /* - * Show the user that we are busy reading the input. Sometimes this - * may take a while. When reading from stdin another program may - * still be running, don't move the cursor to the last line, unless - * always using the GUI. - */ - if (read_stdin) { - mch_msg(_("Nvim: Reading from stdin...\n")); - } else if (!read_buffer) + if (!read_stdin && !read_buffer) { filemess(curbuf, sfname, (char_u *)"", 0); + } } msg_scroll = FALSE; /* overwrite the file message */ diff --git a/src/nvim/main.c b/src/nvim/main.c index d7baa7acfa..4416bd067c 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -513,6 +513,12 @@ int main(int argc, char **argv) apply_autocmds(EVENT_VIMENTER, NULL, NULL, false, curbuf); TIME_MSG("VimEnter autocommands"); + // Adjust default register name for "unnamed" in 'clipboard'. Can only be + // done after the clipboard is available and all initial commands that may + // modify the 'clipboard' setting have run; i.e. just before entering the + // main loop. + set_reg_var(get_default_register_name()); + /* When a startup script or session file setup for diff'ing and * scrollbind, sync the scrollbind now. */ if (curwin->w_p_diff && curwin->w_p_scb) { diff --git a/src/nvim/strings.c b/src/nvim/strings.c index 7768636ded..d03970108b 100644 --- a/src/nvim/strings.c +++ b/src/nvim/strings.c @@ -1228,7 +1228,7 @@ int vim_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap, l += snprintf(format + 1, sizeof(format) - 1, ".%d", (int)precision); } - format[l] = fmt_spec == 'F' ? 'f' : fmt_spec; + format[l] = (char)(fmt_spec == 'F' ? 'f' : fmt_spec); format[l + 1] = NUL; assert(l + 1 < (int)sizeof(format)); str_arg_l = (size_t)snprintf(tmp, sizeof(tmp), format, f); diff --git a/test/functional/clipboard/clipboard_provider_spec.lua b/test/functional/clipboard/clipboard_provider_spec.lua index 2b26697b97..d969d4a487 100644 --- a/test/functional/clipboard/clipboard_provider_spec.lua +++ b/test/functional/clipboard/clipboard_provider_spec.lua @@ -89,9 +89,12 @@ describe('the unnamed register', function() end) describe('clipboard usage', function() + local function reset(...) + clear('--cmd', 'let &rtp = "test/functional/fixtures,".&rtp', ...) + end + before_each(function() - clear() - execute('let &rtp = "test/functional/fixtures,".&rtp') + reset() execute('call getreg("*")') -- force load of provider end) @@ -363,6 +366,13 @@ describe('clipboard usage', function() end) end) + it('sets v:register after startup', function() + reset() + eq('"', eval('v:register')) + reset('--cmd', 'set clipboard=unnamed') + eq('*', eval('v:register')) + end) + it('supports :put', function() insert("a line") execute("let g:test_clip['*'] = ['some text']") |