diff --git a/src/search/QuickOpen.js b/src/search/QuickOpen.js index 473465a93e..207a3dc279 100644 --- a/src/search/QuickOpen.js +++ b/src/search/QuickOpen.js @@ -89,7 +89,7 @@ define(function (require, exports, module) { * @private * @const {RegExp} */ - var CURSOR_POS_EXP = new RegExp(":([^,]+)?(,(.+)?)?"); + var CURSOR_POS_EXP = new RegExp(":([^,:]+)?([,:](.+)?)?"); /** * Current plugin diff --git a/test/spec/QuickOpen-integ-test.js b/test/spec/QuickOpen-integ-test.js index 8f06e98524..78a7918d4f 100644 --- a/test/spec/QuickOpen-integ-test.js +++ b/test/spec/QuickOpen-integ-test.js @@ -182,5 +182,21 @@ define(function (require, exports, module) { it("can directly open a file in a given line and column, centering that line on the screen", async function () { await quickOpenTest("lines:150,20", null, "lotsOfLines.html", 150, 20); }); + + it("can open a file and jump to a line and column with no space after comma", async function () { + await quickOpenTest("lines", ":50,20", "lotsOfLines.html", 50, 20); + }); + + it("can open a file and jump to a line and column with space after comma", async function () { + await quickOpenTest("lines", ":50, 20", "lotsOfLines.html", 50, 20); + }); + + it("can directly open a file with line:column format", async function () { + await quickOpenTest("lines:150:20", null, "lotsOfLines.html", 150, 20); + }); + + it("can directly open a file with line:column format and spaces", async function () { + await quickOpenTest("lines:150: 20", null, "lotsOfLines.html", 150, 20); + }); }); });