提交 e79e82ca 编写于 作者: J Johannes Rieken

make dash a separator character, fixes #23746

上级 4c339dfe
......@@ -439,6 +439,7 @@ function printTable(table: number[][], pattern: string, patternLen: number, word
const _seps: { [ch: string]: boolean } = Object.create(null);
_seps['_'] = true;
_seps['-'] = true;
_seps['.'] = true;
_seps[' '] = true;
_seps['/'] = true;
......
......@@ -236,6 +236,12 @@ suite('Filters', () => {
assertMatches('hhighlight', 'editorHoverHighlight', 'editor^Hover^H^i^g^h^l^i^g^h^t', fuzzyScore);
assertMatches('dhhighlight', 'editorHoverHighlight', undefined, fuzzyScore);
});
test('fuzzyScore, #23746', function () {
assertMatches('-moz', '-moz-foo', '^-^m^o^z-foo', fuzzyScore);
assertMatches('moz', '-moz-foo', '-^m^o^z-foo', fuzzyScore);
assertMatches('moz', '-moz-animation', '-^m^o^z-animation', fuzzyScore);
assertMatches('moza', '-moz-animation', '-^m^o^z-^animation', fuzzyScore);
});
test('fuzzyScore', function () {
assertMatches('ab', 'abA', '^a^bA', fuzzyScore);
......@@ -287,7 +293,6 @@ suite('Filters', () => {
assertMatches('fo', 'bar.foo', 'bar.^f^oo', fuzzyScore);
assertMatches('fo', 'bar/foo', 'bar/^f^oo', fuzzyScore);
assertMatches('fo', 'bar\\foo', 'bar\\^f^oo', fuzzyScore);
});
function assertTopScore(filter: typeof fuzzyScore, pattern: string, expected: number, ...words: string[]) {
let topScore = -(100 * 10);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册