mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 23:07:59 +01:00
display a better error message for invalid ex commands
This commit is contained in:
@@ -117,21 +117,21 @@ const vimperator = (function() //{{{
|
|||||||
clipboardHelper.copyString(str);
|
clipboardHelper.copyString(str);
|
||||||
},
|
},
|
||||||
|
|
||||||
execute: function(string, modifiers)
|
execute: function(str, modifiers)
|
||||||
{
|
{
|
||||||
// skip comments and blank lines
|
// skip comments and blank lines
|
||||||
if (/^\s*("|$)/.test(string))
|
if (/^\s*("|$)/.test(str))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!modifiers)
|
if (!modifiers)
|
||||||
modifiers = {};
|
modifiers = {};
|
||||||
|
|
||||||
var [count, cmd, special, args] = vimperator.commands.parseCommand(string.replace(/^'(.*)'$/, '$1'));
|
var [count, cmd, special, args] = vimperator.commands.parseCommand(str.replace(/^'(.*)'$/, '$1'));
|
||||||
var command = vimperator.commands.get(cmd);
|
var command = vimperator.commands.get(cmd);
|
||||||
|
|
||||||
if (command === null)
|
if (command === null)
|
||||||
{
|
{
|
||||||
vimperator.echoerr("E492: Not an editor command: " + cmd);
|
vimperator.echoerr("E492: Not an editor command: " + str);
|
||||||
vimperator.focusContent();
|
vimperator.focusContent();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user