diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-05-05 09:00:35 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-05-05 09:20:30 +0800 |
commit | bdaaf2e8e113f8c32c70f83b60e0bf3f648357c1 (patch) | |
tree | 04ab960fec3aaaf6d139164e27ee8c4c6ff8f900 | |
parent | 15c502d8be0e9a43372a4357fdc34a5b59169798 (diff) | |
download | rneovim-bdaaf2e8e113f8c32c70f83b60e0bf3f648357c1.tar.gz rneovim-bdaaf2e8e113f8c32c70f83b60e0bf3f648357c1.tar.bz2 rneovim-bdaaf2e8e113f8c32c70f83b60e0bf3f648357c1.zip |
vim-patch:9.0.0250: slightly inconsistent error messages
Problem: Slightly inconsistent error messages.
Solution: Make it "Using a Float". (closes vim/vim#10959)
https://github.com/vim/vim/commit/dde77a7c4d72622284dc5fb72557bde42c314fa6
Co-authored-by: Bram Moolenaar <Bram@vim.org>
-rw-r--r-- | src/nvim/globals.h | 2 | ||||
-rw-r--r-- | test/functional/legacy/glob2regpat_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/vimscript/execute_spec.lua | 6 | ||||
-rw-r--r-- | test/functional/vimscript/writefile_spec.lua | 2 | ||||
-rw-r--r-- | test/unit/eval/typval_spec.lua | 22 |
5 files changed, 17 insertions, 17 deletions
diff --git a/src/nvim/globals.h b/src/nvim/globals.h index c6a3a5895b..698f4a98c7 100644 --- a/src/nvim/globals.h +++ b/src/nvim/globals.h @@ -998,7 +998,7 @@ EXTERN const char e_autocmd_close[] INIT(= N_("E813: Cannot close autocmd window EXTERN const char e_listarg[] INIT(= N_("E686: Argument of %s must be a List")); EXTERN const char e_unsupportedoption[] INIT(= N_("E519: Option not supported")); EXTERN const char e_fnametoolong[] INIT(= N_("E856: Filename too long")); -EXTERN const char e_using_float_as_string[] INIT(= N_("E806: Using Float as a String")); +EXTERN const char e_using_float_as_string[] INIT(= N_("E806: Using a Float as a String")); EXTERN const char e_cannot_edit_other_buf[] INIT(= N_("E788: Not allowed to edit another buffer now")); EXTERN const char e_using_number_as_bool_nr[] INIT(= N_("E1023: Using a Number as a Bool: %d")); EXTERN const char e_not_callable_type_str[] INIT(= N_("E1085: Not a callable type: %s")); diff --git a/test/functional/legacy/glob2regpat_spec.lua b/test/functional/legacy/glob2regpat_spec.lua index c442c628c2..1771f12f85 100644 --- a/test/functional/legacy/glob2regpat_spec.lua +++ b/test/functional/legacy/glob2regpat_spec.lua @@ -8,7 +8,7 @@ describe('glob2regpat()', function() before_each(clear) it('handles invalid input', function() - eq('Vim(call):E806: Using Float as a String', + eq('Vim(call):E806: Using a Float as a String', exc_exec('call glob2regpat(1.33)')) end) it('returns ^$ for empty input', function() diff --git a/test/functional/vimscript/execute_spec.lua b/test/functional/vimscript/execute_spec.lua index bf86f1623e..17edf5c93e 100644 --- a/test/functional/vimscript/execute_spec.lua +++ b/test/functional/vimscript/execute_spec.lua @@ -93,13 +93,13 @@ describe('execute()', function() it('captures errors', function() local ret ret = exc_exec('call execute(0.0)') - eq('Vim(call):E806: Using Float as a String', ret) + eq('Vim(call):E806: Using a Float as a String', ret) ret = exc_exec('call execute(v:_null_dict)') eq('Vim(call):E731: Using a Dictionary as a String', ret) ret = exc_exec('call execute(function("tr"))') eq('Vim(call):E729: Using a Funcref as a String', ret) ret = exc_exec('call execute(["echo 42", 0.0, "echo 44"])') - eq('Vim:E806: Using Float as a String', ret) + eq('Vim:E806: Using a Float as a String', ret) ret = exc_exec('call execute(["echo 42", v:_null_dict, "echo 44"])') eq('Vim:E731: Using a Dictionary as a String', ret) ret = exc_exec('call execute(["echo 42", function("tr"), "echo 44"])') @@ -322,7 +322,7 @@ describe('execute()', function() it('propagates errors for "" and "silent"', function() local ret ret = exc_exec('call execute(0.0, "")') - eq('Vim(call):E806: Using Float as a String', ret) + eq('Vim(call):E806: Using a Float as a String', ret) ret = exc_exec('call execute(v:_null_dict, "silent")') eq('Vim(call):E731: Using a Dictionary as a String', ret) diff --git a/test/functional/vimscript/writefile_spec.lua b/test/functional/vimscript/writefile_spec.lua index da06671fe5..521a4eb2b1 100644 --- a/test/functional/vimscript/writefile_spec.lua +++ b/test/functional/vimscript/writefile_spec.lua @@ -145,7 +145,7 @@ describe('writefile()', function() pcall_err(command, ('call writefile(%s, "%s", "b")'):format(arg, fname))) end for _, args in ipairs({'[], %s, "b"', '[], "' .. fname .. '", %s'}) do - eq('Vim(call):E806: Using Float as a String', + eq('Vim(call):E806: Using a Float as a String', pcall_err(command, ('call writefile(%s)'):format(args:format('0.0')))) eq('Vim(call):E730: Using a List as a String', pcall_err(command, ('call writefile(%s)'):format(args:format('[]')))) diff --git a/test/unit/eval/typval_spec.lua b/test/unit/eval/typval_spec.lua index 7474d5ec99..cde5a731cf 100644 --- a/test/unit/eval/typval_spec.lua +++ b/test/unit/eval/typval_spec.lua @@ -1467,12 +1467,12 @@ describe('typval.c', function() itp('fails with error message on invalid types', function() local l = list(1, empty_list, {}) - eq('', tv_list_find_str(l, 0, 'E806: Using Float as a String')) + eq('', tv_list_find_str(l, 0, 'E806: Using a Float as a String')) eq('', tv_list_find_str(l, 1, 'E730: Using a List as a String')) eq('', tv_list_find_str(l, 2, 'E731: Using a Dictionary as a String')) eq('', tv_list_find_str(l, -1, 'E731: Using a Dictionary as a String')) eq('', tv_list_find_str(l, -2, 'E730: Using a List as a String')) - eq('', tv_list_find_str(l, -3, 'E806: Using Float as a String')) + eq('', tv_list_find_str(l, -3, 'E806: Using a Float as a String')) end) end) end) @@ -1766,7 +1766,7 @@ describe('typval.c', function() eq(s43, dis.te.di_tv.vval.v_string) alloc_log:check({}) eq('', ffi.string(check_emsg(function() return lib.tv_dict_get_string(d, 't', false) end, - 'E806: Using Float as a String'))) + 'E806: Using a Float as a String'))) end) itp('allocates a string copy when requested', function() local function tv_dict_get_string_alloc(d, key, emsg) @@ -1792,7 +1792,7 @@ describe('typval.c', function() eq('42', tv_dict_get_string_alloc(d, 'tes')) eq('45', tv_dict_get_string_alloc(d, 'xx')) eq('43', tv_dict_get_string_alloc(d, 'te')) - eq('', tv_dict_get_string_alloc(d, 't', 'E806: Using Float as a String')) + eq('', tv_dict_get_string_alloc(d, 't', 'E806: Using a Float as a String')) end) end) describe('get_string_buf()', function() @@ -1827,7 +1827,7 @@ describe('typval.c', function() s, r, b = tv_dict_get_string_buf(d, 'test') neq(r, b) eq('tset', s) - s, r, b = tv_dict_get_string_buf(d, 't', nil, 'E806: Using Float as a String') + s, r, b = tv_dict_get_string_buf(d, 't', nil, 'E806: Using a Float as a String') neq(r, b) eq('', s) s, r, b = tv_dict_get_string_buf(d, 'te') @@ -1870,7 +1870,7 @@ describe('typval.c', function() neq(r, b) neq(r, def) eq('tset', s) - s, r, b, def = tv_dict_get_string_buf_chk(d, 'test', 1, nil, nil, 'E806: Using Float as a String') + s, r, b, def = tv_dict_get_string_buf_chk(d, 'test', 1, nil, nil, 'E806: Using a Float as a String') neq(r, b) neq(r, def) eq(nil, s) @@ -2831,7 +2831,7 @@ describe('typval.c', function() alloc_log:clear() for _, v in ipairs({ {lib.VAR_NUMBER, nil}, - {lib.VAR_FLOAT, 'E806: Using Float as a String'}, + {lib.VAR_FLOAT, 'E806: Using a Float as a String'}, {lib.VAR_PARTIAL, 'E729: Using a Funcref as a String'}, {lib.VAR_FUNC, 'E729: Using a Funcref as a String'}, {lib.VAR_LIST, 'E730: Using a List as a String'}, @@ -2986,7 +2986,7 @@ describe('typval.c', function() for _, v in ipairs({ {lib.VAR_NUMBER, {v_number=42}, nil, '42'}, {lib.VAR_STRING, {v_string=to_cstr('100500')}, nil, '100500'}, - {lib.VAR_FLOAT, {v_float=42.53}, 'E806: Using Float as a String', ''}, + {lib.VAR_FLOAT, {v_float=42.53}, 'E806: Using a Float as a String', ''}, {lib.VAR_PARTIAL, {v_partial=NULL}, 'E729: Using a Funcref as a String', ''}, {lib.VAR_FUNC, {v_string=NULL}, 'E729: Using a Funcref as a String', ''}, {lib.VAR_LIST, {v_list=NULL}, 'E730: Using a List as a String', ''}, @@ -3030,7 +3030,7 @@ describe('typval.c', function() for _, v in ipairs({ {lib.VAR_NUMBER, {v_number=42}, nil, '42'}, {lib.VAR_STRING, {v_string=to_cstr('100500')}, nil, '100500'}, - {lib.VAR_FLOAT, {v_float=42.53}, 'E806: Using Float as a String', nil}, + {lib.VAR_FLOAT, {v_float=42.53}, 'E806: Using a Float as a String', nil}, {lib.VAR_PARTIAL, {v_partial=NULL}, 'E729: Using a Funcref as a String', nil}, {lib.VAR_FUNC, {v_string=NULL}, 'E729: Using a Funcref as a String', nil}, {lib.VAR_LIST, {v_list=NULL}, 'E730: Using a List as a String', nil}, @@ -3072,7 +3072,7 @@ describe('typval.c', function() for _, v in ipairs({ {lib.VAR_NUMBER, {v_number=42}, nil, '42'}, {lib.VAR_STRING, {v_string=to_cstr('100500')}, nil, '100500'}, - {lib.VAR_FLOAT, {v_float=42.53}, 'E806: Using Float as a String', ''}, + {lib.VAR_FLOAT, {v_float=42.53}, 'E806: Using a Float as a String', ''}, {lib.VAR_PARTIAL, {v_partial=NULL}, 'E729: Using a Funcref as a String', ''}, {lib.VAR_FUNC, {v_string=NULL}, 'E729: Using a Funcref as a String', ''}, {lib.VAR_LIST, {v_list=NULL}, 'E730: Using a List as a String', ''}, @@ -3115,7 +3115,7 @@ describe('typval.c', function() for _, v in ipairs({ {lib.VAR_NUMBER, {v_number=42}, nil, '42'}, {lib.VAR_STRING, {v_string=to_cstr('100500')}, nil, '100500'}, - {lib.VAR_FLOAT, {v_float=42.53}, 'E806: Using Float as a String', nil}, + {lib.VAR_FLOAT, {v_float=42.53}, 'E806: Using a Float as a String', nil}, {lib.VAR_PARTIAL, {v_partial=NULL}, 'E729: Using a Funcref as a String', nil}, {lib.VAR_FUNC, {v_string=NULL}, 'E729: Using a Funcref as a String', nil}, {lib.VAR_LIST, {v_list=NULL}, 'E730: Using a List as a String', nil}, |