mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 21:07:59 +01:00
simplify the implementation of :qmark
This commit is contained in:
@@ -1117,15 +1117,13 @@ vimperator.Commands = function() //{{{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var matches1 = args.match(/([a-zA-Z0-9])\s+(.+)/);
|
var matches = args.match(/^([a-zA-Z0-9])(?:\s+(.+))?$/);
|
||||||
var matches2 = args.match(/([a-zA-Z0-9])\s*$/);
|
if (!matches)
|
||||||
|
|
||||||
if (matches1 && matches1[1])
|
|
||||||
vimperator.quickmarks.add(matches1[1], matches1[2]);
|
|
||||||
else if (matches2 && matches2)
|
|
||||||
vimperator.quickmarks.add(matches2[1], vimperator.buffer.URL);
|
|
||||||
else
|
|
||||||
vimperator.echoerr("E488: Trailing characters");
|
vimperator.echoerr("E488: Trailing characters");
|
||||||
|
else if (!matches[2])
|
||||||
|
vimperator.quickmarks.add(matches[1], vimperator.buffer.URL);
|
||||||
|
else
|
||||||
|
vimperator.quickmarks.add(matches[1], matches[2]);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
usage: ["qma[rk] {a-zA-Z0-9} [url]"],
|
usage: ["qma[rk] {a-zA-Z0-9} [url]"],
|
||||||
|
|||||||
Reference in New Issue
Block a user