1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 14:27:58 +01:00

simplify the implementation of :qmark

This commit is contained in:
Doug Kearns
2007-11-06 09:24:21 +00:00
parent e1cd0e07bb
commit bd07083330

View File

@@ -1546,15 +1546,13 @@ vimperator.Commands = function() //{{{
return;
}
var matches1 = args.match(/([a-zA-Z0-9])\s+(.+)/);
var matches2 = args.match(/([a-zA-Z0-9])\s*$/);
if (matches1 && matches1[1])
vimperator.quickmarks.add(matches1[1], matches1[2]);
else if (matches2 && matches2)
vimperator.quickmarks.add(matches2[1], vimperator.buffer.URL);
else
var matches = args.match(/^([a-zA-Z0-9])(?:\s+(.+))?$/);
if (!matches)
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]"],