Merge #11770 from justinmk/release-0.4

This commit is contained in:
Justin M. Keyes 2020-01-26 18:53:52 -08:00 committed by GitHub
commit 910cdac22c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 54 additions and 14 deletions

View File

@ -51,6 +51,9 @@ function! provider#node#Detect() abort
if exists('g:node_host_prog')
return expand(g:node_host_prog)
endif
if !executable('node')
return ''
endif
if !s:is_minimum_version(v:null, 6, 0)
return ''
endif

View File

@ -20872,6 +20872,7 @@ void ex_echo(exarg_T *eap)
char_u *arg = eap->arg;
typval_T rettv;
bool atstart = true;
bool need_clear = true;
const int did_emsg_before = did_emsg;
if (eap->skip)
@ -20914,7 +20915,7 @@ void ex_echo(exarg_T *eap)
char *tofree = encode_tv2echo(&rettv, NULL);
if (*tofree != NUL) {
msg_ext_set_kind("echo");
msg_multiline_attr(tofree, echo_attr, true);
msg_multiline_attr(tofree, echo_attr, true, &need_clear);
}
xfree(tofree);
}
@ -20927,7 +20928,9 @@ void ex_echo(exarg_T *eap)
emsg_skip--;
} else {
// remove text that may still be there from the command
msg_clr_eos();
if (need_clear) {
msg_clr_eos();
}
if (eap->cmdidx == CMD_echo) {
msg_end();
}

View File

@ -228,7 +228,8 @@ int msg_attr(const char *s, const int attr)
}
/// similar to msg_outtrans_attr, but support newlines and tabs.
void msg_multiline_attr(const char *s, int attr, bool check_int)
void msg_multiline_attr(const char *s, int attr,
bool check_int, bool *need_clear)
FUNC_ATTR_NONNULL_ALL
{
const char *next_spec = s;
@ -243,8 +244,9 @@ void msg_multiline_attr(const char *s, int attr, bool check_int)
// Printing all char that are before the char found by strpbrk
msg_outtrans_len_attr((char_u *)s, next_spec - s, attr);
if (*next_spec != TAB) {
if (*next_spec != TAB && *need_clear) {
msg_clr_eos();
*need_clear = false;
}
msg_putchar_attr((uint8_t)(*next_spec), attr);
s = next_spec + 1;
@ -256,6 +258,7 @@ void msg_multiline_attr(const char *s, int attr, bool check_int)
if (*s != NUL) {
msg_outtrans_attr((char_u *)s, attr);
}
return;
}
@ -314,12 +317,15 @@ bool msg_attr_keep(char_u *s, int attr, bool keep, bool multiline)
if (buf != NULL)
s = buf;
bool need_clear = true;
if (multiline) {
msg_multiline_attr((char *)s, attr, false);
msg_multiline_attr((char *)s, attr, false, &need_clear);
} else {
msg_outtrans_attr(s, attr);
}
msg_clr_eos();
if (need_clear) {
msg_clr_eos();
}
retval = msg_end();
if (keep && retval && vim_strsize(s) < (int)(Rows - cmdline_row - 1)

View File

@ -8,8 +8,9 @@ local retry = helpers.retry
do
clear()
if missing_provider('node') then
pending("Missing nodejs host, or nodejs version is too old.", function()end)
local reason = missing_provider('node')
if reason then
pending(string.format("Missing nodejs host, or nodejs version is too old (%s)", reason), function() end)
return
end
end

View File

@ -10,13 +10,14 @@ local pcall_err = helpers.pcall_err
do
clear()
if missing_provider('python3') then
local reason = missing_provider('python3')
if reason then
it(':python3 reports E319 if provider is missing', function()
local expected = [[Vim%(py3.*%):E319: No "python3" provider found.*]]
matches(expected, pcall_err(command, 'py3 print("foo")'))
matches(expected, pcall_err(command, 'py3file foo'))
end)
pending('Python 3 (or the pynvim module) is broken/missing', function() end)
pending(string.format('Python 3 (or the pynvim module) is broken/missing (%s)', reason), function() end)
return
end
end

View File

@ -18,13 +18,14 @@ local pcall_err = helpers.pcall_err
do
clear()
if missing_provider('python') then
local reason = missing_provider('python')
if reason then
it(':python reports E319 if provider is missing', function()
local expected = [[Vim%(py.*%):E319: No "python" provider found.*]]
matches(expected, pcall_err(command, 'py print("foo")'))
matches(expected, pcall_err(command, 'pyfile foo'))
end)
pending('Python 2 (or the pynvim module) is broken/missing', function() end)
pending(string.format('Python 2 (or the pynvim module) is broken/missing (%s)', reason), function() end)
return
end
end

View File

@ -18,13 +18,14 @@ local pcall_err = helpers.pcall_err
do
clear()
if missing_provider('ruby') then
local reason = missing_provider('ruby')
if reason then
it(':ruby reports E319 if provider is missing', function()
local expected = [[Vim%(ruby.*%):E319: No "ruby" provider found.*]]
matches(expected, pcall_err(command, 'ruby puts "foo"'))
matches(expected, pcall_err(command, 'rubyfile foo'))
end)
pending("Missing neovim RubyGem.", function() end)
pending(string.format('Missing neovim RubyGem (%s)', reason), function() end)
return
end
end

View File

@ -938,6 +938,30 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
{7: 0,0-1 100% }|
]]}
end)
it('supports echo with CRLF line separators', function()
feed(':echo "line 1\\r\\nline 2"<cr>')
screen:expect{grid=[[
|
{1:~ }|
{1:~ }|
{3: }|
line 1 |
line 2 |
{4:Press ENTER or type command to continue}^ |
]]}
feed('<cr>:echo "abc\\rz"<cr>')
screen:expect{grid=[[
^ |
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
zbc |
]]}
end)
end)
describe('ui/ext_messages', function()