Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 36e03ab

Browse files
fix(ex_cmds): address E77 review feedback
1 parent 1f9e928 commit 36e03ab

3 files changed

Lines changed: 11 additions & 15 deletions

File tree

runtime/doc/message.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ into this limit, you have used too many |:highlight| commands with different
548548
arguments. A ":highlight link" is not counted.
549549

550550
*E77* >
551-
Too many file names (glob not allowed)
551+
Too many file names (only one allowed)
552552
553553
More than one file name was given, either explicitly or by expanding a glob.
554554
Only one file name is allowed for the command that was used.

src/nvim/errors.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ EXTERN const char e_swapclose[] INIT(= N_("E72: Close error on swap file"));
118118
EXTERN const char e_toocompl[] INIT(= N_("E74: Command too complex"));
119119
EXTERN const char e_longname[] INIT(= N_("E75: Name too long"));
120120
EXTERN const char e_toomsbra[] INIT(= N_("E76: Too many ["));
121-
EXTERN const char e_toomany[] INIT(= N_("E77: Too many file names (glob not allowed)"));
121+
EXTERN const char e_toomany[] INIT(= N_("E77: Too many file names (only one allowed)"));
122122
EXTERN const char e_trailing[] INIT(= N_("E488: Trailing characters"));
123123
EXTERN const char e_trailing_arg[] INIT(= N_("E488: Trailing characters: %s"));
124124
EXTERN const char e_umark[] INIT(= N_("E78: Unknown mark"));

test/functional/ex_cmds/edit_spec.lua

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,8 @@ local clear = n.clear
1010
local feed = n.feed
1111

1212
describe(':edit', function()
13-
local glob_files = { 'Xedit_glob_one.js', 'Xedit_glob_two.js' }
14-
1513
before_each(function()
1614
clear()
17-
for _, file in ipairs(glob_files) do
18-
fn.delete(file)
19-
end
20-
end)
21-
22-
after_each(function()
23-
for _, file in ipairs(glob_files) do
24-
fn.delete(file)
25-
end
2615
end)
2716

2817
it('without arguments does not restart :terminal buffer', function()
@@ -41,14 +30,21 @@ describe(':edit', function()
4130
eq(bufnr_before, bufnr_after)
4231
end)
4332

44-
it('with glob reports that glob is not allowed', function()
33+
it('with glob reports that only one file is allowed', function()
34+
local glob_files = { 'Xedit_glob_one.js', 'Xedit_glob_two.js' }
35+
4536
for _, file in ipairs(glob_files) do
37+
fn.delete(file)
4638
write_file(file, '')
4739
end
4840

4941
eq(
50-
'Vim(edit):E77: Too many file names (glob not allowed)',
42+
'Vim(edit):E77: Too many file names (only one allowed)',
5143
pcall_err(command, 'edit Xedit_glob_*.js')
5244
)
45+
46+
for _, file in ipairs(glob_files) do
47+
fn.delete(file)
48+
end
5349
end)
5450
end)

0 commit comments

Comments
 (0)