Skip to content

Commit

Permalink
fix: Match any ASCII characters in composite keys (#1923)
Browse files Browse the repository at this point in the history
* fix: Match any ASCII characters in composite keys

---------

Co-authored-by: wongxy <hi@xiyao.me>
  • Loading branch information
uduse and xiyaowong committed May 1, 2024
1 parent b817a33 commit 51e2f11
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@
}
],
"patternProperties": {
"^[a-zA-Z]{2}$": {
"^[ -~]{2}$": {
"type": "object",
"properties": {
"command": {
Expand Down
4 changes: 2 additions & 2 deletions src/typing_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ export class TypingManager implements Disposable {
this.compositeFirstKeys = [];
this.compositeSecondKeysForFirstKey = new Map();
Object.keys(this.compositeKeys).forEach((key) => {
if (!/^[a-zA-Z]{2}$/.test(key)) {
if (!/^[ -~]{2}$/.test(key)) {
window.showErrorMessage(
`Invalid composite key: ${key}. Composite key must be exactly 2 characters long.`,
`Invalid composite key: ${key}. Composite key must be exactly 2 ASCII characters long.`,
);
return;
}
Expand Down

0 comments on commit 51e2f11

Please sign in to comment.