Skip to content

Commit

Permalink
registers: do not assign ascii letters to special registers (fixes 71…
Browse files Browse the repository at this point in the history
  • Loading branch information
71 committed Nov 1, 2023
1 parent 5fffe3b commit fe89fb5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/state/registers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,11 @@ export abstract class RegisterSet implements vscode.Disposable {
private readonly _onLastMatchesChange = new vscode.EventEmitter<void>();

private readonly _named = new Map<string, Register>();
private readonly _letters = Array.from(
private readonly _letters: readonly GeneralPurposeRegister[] = Array.from(
{ length: 26 },
(_, i) => new GeneralPurposeRegister(String.fromCharCode(97 + i), "symbol-text") as Register,
(_, i) => new GeneralPurposeRegister(String.fromCharCode(97 + i), "symbol-text"),
);
private readonly _digits = Array.from(
private readonly _digits: readonly SpecialRegister[] = Array.from(
{ length: 9 },
(_, i) => new SpecialRegister(
(i + 1).toString(),
Expand Down Expand Up @@ -577,7 +577,6 @@ export abstract class RegisterSet implements vscode.Disposable {
["underscore", this.underscore] as const,
["colon", this.colon] as const,
]) {
this._letters[longName.charCodeAt(0) - 97 /* a */] = register;
this._named.set(longName, register);
}

Expand Down

0 comments on commit fe89fb5

Please sign in to comment.