aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-09-08 15:37:24 -0700
committerJustin M. Keyes <justinkz@gmail.com>2019-09-08 15:37:32 -0700
commitacd2729573171995e8a66be7e09ba4e2fc5d9c69 (patch)
treed266fe011b79cb85e1b27eba8c195b37845897ba
parent0dea44f93ce925baedf0f2d39d799f36671986b6 (diff)
downloadrneovim-acd2729573171995e8a66be7e09ba4e2fc5d9c69.tar.gz
rneovim-acd2729573171995e8a66be7e09ba4e2fc5d9c69.tar.bz2
rneovim-acd2729573171995e8a66be7e09ba4e2fc5d9c69.zip
paste: do not clobber msg area for small pastes
-rw-r--r--src/nvim/lua/vim.lua3
-rw-r--r--test/functional/terminal/tui_spec.lua8
2 files changed, 7 insertions, 4 deletions
diff --git a/src/nvim/lua/vim.lua b/src/nvim/lua/vim.lua
index 7d5dc0bffc..cc10118906 100644
--- a/src/nvim/lua/vim.lua
+++ b/src/nvim/lua/vim.lua
@@ -203,8 +203,7 @@ paste = (function()
vim.api.nvim_command(('echo "%s"'):format(dots))
end
if phase == -1 or phase == 3 then
- vim.api.nvim_command('redraw')
- vim.api.nvim_command('echo ""')
+ vim.api.nvim_command('redraw'..(tick > 1 and '|echo ""' or ''))
end
return true -- Paste will not continue if not returning `true`.
end
diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua
index 8fa7442087..01e73a2378 100644
--- a/test/functional/terminal/tui_spec.lua
+++ b/test/functional/terminal/tui_spec.lua
@@ -319,7 +319,7 @@ describe('TUI', function()
{1:x} |
{4:~ }|
{5:[No Name] [+] 3,1 All}|
- |
+ :set ruler |
{3:-- TERMINAL --} |
]]
local expected_attr = {
@@ -353,7 +353,11 @@ describe('TUI', function()
expect_child_buf_lines({''})
-- CRLF input
feed_data('\027[200~'..table.concat(expected_lf,'\r\n')..'\027[201~')
- screen:expect{grid=expected_grid1, attr_ids=expected_attr}
+ screen:expect{
+ grid=expected_grid1:gsub(
+ ':set ruler *',
+ '3 fewer lines; before #1 0 seconds ago '),
+ attr_ids=expected_attr}
expect_child_buf_lines(expected_crlf)
end)