Skip to content

Commit

Permalink
fix: compare transcipt with command (#158)
Browse files Browse the repository at this point in the history
* fix: compare transcipt with command

* feat: add command "campo"
  • Loading branch information
ItalloDornelas authored Jul 19, 2024
1 parent 22d6012 commit e00d785
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/editor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,22 @@ export abstract class EditorAdapter {
this._recognition.commands.add(
`buscar (\\p{Letter}+)`,
(detail, command, param, groups) => {
if (detail.transcript === command) {
if (detail.transcript === (groups?.length && groups[0])) {
this._getNavigationFieldDeleted();
}
try {
this._navigationFieldManager.goToField(groups ? groups[1] : "");
} catch (e) {
this.onIaraCommand?.("buscar");
} finally {
console.info(detail, command, param);
}
}
);
this._recognition.commands.add(
`campo (\\p{Letter}+)`,
(detail, command, param, groups) => {
if (detail.transcript === (groups?.length && groups[0])) {
this._getNavigationFieldDeleted();
}
try {
Expand Down

0 comments on commit e00d785

Please sign in to comment.