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

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions runtime/doc/message.txt
Original file line number Diff line number Diff line change
Expand Up @@ -548,10 +548,12 @@ into this limit, you have used too many |:highlight| commands with different
arguments. A ":highlight link" is not counted.

*E77* >
Too many file names
Too many file names (only one allowed)

When expanding file names, more than one match was found. Only one match is
allowed for the command that was used.
More than one file name was given, either explicitly or by expanding a glob.
Only one file name is allowed for the command that was used.

Use |:next| if you want to edit all files matching a glob pattern.

*E303* >
Unable to open swap file for "{filename}", recovery impossible
Expand Down
2 changes: 1 addition & 1 deletion src/nvim/errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ EXTERN const char e_swapclose[] INIT(= N_("E72: Close error on swap file"));
EXTERN const char e_toocompl[] INIT(= N_("E74: Command too complex"));
EXTERN const char e_longname[] INIT(= N_("E75: Name too long"));
EXTERN const char e_toomsbra[] INIT(= N_("E76: Too many ["));
EXTERN const char e_toomany[] INIT(= N_("E77: Too many file names"));
EXTERN const char e_toomany[] INIT(= N_("E77: Too many file names (only one allowed)"));
EXTERN const char e_trailing[] INIT(= N_("E488: Trailing characters"));
EXTERN const char e_trailing_arg[] INIT(= N_("E488: Trailing characters: %s"));
EXTERN const char e_umark[] INIT(= N_("E78: Unknown mark"));
Expand Down
20 changes: 20 additions & 0 deletions test/functional/ex_cmds/edit_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ local n = require('test.functional.testnvim')()
local eq, command, fn = t.eq, n.command, n.fn
local ok = t.ok
local matches = t.matches
local pcall_err = t.pcall_err
local write_file = t.write_file
local clear = n.clear
local feed = n.feed

Expand All @@ -27,4 +29,22 @@ describe(':edit', function()
eq(bufname_before, bufname_after)
eq(bufnr_before, bufnr_after)
end)

it('with glob reports that only one file is allowed', function()
local glob_files = { 'Xedit_glob_one.js', 'Xedit_glob_two.js' }

for _, file in ipairs(glob_files) do
fn.delete(file)
write_file(file, '')
end

eq(
'Vim(edit):E77: Too many file names (only one allowed)',
pcall_err(command, 'edit Xedit_glob_*.js')
)

for _, file in ipairs(glob_files) do
fn.delete(file)
end
end)
end)
Loading