1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 19:37:57 +01:00

Fix parsing of Ex commands run with leading whitespace.

This commit is contained in:
Doug Kearns
2009-09-04 02:25:06 +10:00
parent 11b54186d5
commit cd52ef6ad3

View File

@@ -921,7 +921,7 @@ function Commands() //{{{
str.replace(/\s*".*$/, ""); str.replace(/\s*".*$/, "");
// 0 - count, 1 - cmd, 2 - special, 3 - args // 0 - count, 1 - cmd, 2 - special, 3 - args
let matches = str.match(/^:*(\d+|%)?([a-zA-Z]+|!)(!)?(?:\s*(.*?))?$/); let matches = str.match(/^[:\s]*(\d+|%)?([a-zA-Z]+|!)(!)?(?:\s*(.*?))?$/);
//var matches = str.match(/^:*(\d+|%)?([a-zA-Z]+|!)(!)?(?:\s*(.*?)\s*)?$/); //var matches = str.match(/^:*(\d+|%)?([a-zA-Z]+|!)(!)?(?:\s*(.*?)\s*)?$/);
if (!matches) if (!matches)
return [null, null, null, null]; return [null, null, null, null];