talonvoice / talon

Issue Tracker for the main Talon app
85 stars 0 forks source link

command not recognized even though `sim` succeeds #526

Open rntz opened 2 years ago

rntz commented 2 years ago

quick_dictation.talon

dictation [mode] [<phrase>]$:
  # don't disable command mode, I want mixed mode.
  # mode.disable("command")
  mode.enable("dictation")
  user.rerun_phrase(phrase or "")

If I have this plus my regular setup, saying slap slap dictation fails to be recognized (nothing shows up in log or subtitles). But sim("slap slap dictation") at the repl works fine:

>>> sim('slap slap dictation')
[1] "slap"
   path: user/knausj/misc/keys.talon
   rule: "<user.special_key>"
[2] "slap"
   path: user/knausj/misc/keys.talon
   rule: "<user.special_key>"
[3] "dictation"
   path: user/mine/momentary/quick_dictation.talon
   rule: "dictation [mode] [<phrase>]"

Moreover, the problem goes away if I avoid the use of an optional phrase:

quick_dictation.talon


dictation [mode] <phrase>$:
  # don't disable command mode, I want mixed mode.
  # mode.disable("command")
  mode.enable("dictation")
  user.rerun_phrase(phrase or "")

dictation [mode]$:
  mode.enable("dictation")

Smells like a decoder or DFA issue?

rntz commented 2 years ago

If this doesn't replicate on vanilla knausj or by just adding a slap command, just let me know what else you need for debugging. Unfortunately too busy right now to try to debug further.

lunixbochs commented 2 years ago

works fine for me in knausj_talon