include ~ in possible icon name. fixes #136172

This commit is contained in:
Tyler Leonhardt 2021-11-04 14:49:14 -07:00
parent c11a9ce097
commit 88d7502f32
No known key found for this signature in database
GPG key ID: 1BC2B6244363E77E
2 changed files with 6 additions and 1 deletions

View file

@ -103,7 +103,7 @@ function doParseLabelWithIcons(text: string, firstIconIndex: number): IParsedLab
// within icon
else if (currentIconStart !== -1) {
// Make sure this is a real icon name
if (/^[a-z0-9\-]$/i.test(char)) {
if (/^[a-z0-9\-~]$/i.test(char)) {
currentIconValue += char;
} else {
// This is not a real icon, treat it as text

View file

@ -63,6 +63,11 @@ suite('Icon Labels', () => {
filterOk(matchesFuzzyIconAware, 'unt', parseLabelWithIcons('$(primitive-dot) $(file-text) Untitled-1'), [
{ start: 30, end: 33 },
]);
// Testing #136172
filterOk(matchesFuzzyIconAware, 's', parseLabelWithIcons('$(loading~spin) start'), [
{ start: 16, end: 17 },
]);
});
test('stripIcons', () => {