cursorless-dev / cursorless

Don't let the cursor slow you down
https://www.cursorless.org/
MIT License
1.12k stars 78 forks source link

neovim: disable cursorless commands that aren't relevant to terminal to avoid misrecognition #2547

Open fidgetingbits opened 1 month ago

fidgetingbits commented 1 month ago

I'm noticing I get a lot (at least enough to be annoying) of misrecognitions while I'm using the terminal with cursorless, especially while I'm manually spelling something, which is may be something I do more in the terminal than I do in vscode, due to weird file names and stuff.

But I've noticed for instance I can say something and it will miss recognize as click void and will try to click a target identified by space.

This is an example of the log

 'void', 'push'])
[954354.999] user/fidgetingbits-talon/plugin/command_history/command_history.py | action speech.enabled()
[954354.999] user/fidgetingbits-talon/plugin/subtitles/on_phrase.py | action speech.enabled()
[954354.999] user/cursorless-talon/src/cursorless.talon | action user.private_cursorless_action_or_ide_command({'value': 'followLink'
, 'type': 'cursorless_action'}, PrimitiveTarget(mark={'type': 'decoratedSymbol', 'symbolColor': 'default', 'character': ' '}, modifie
rs=None))
[954354.999] user/cursorless-talon/src/actions/actions.py | action user.cursorless_command('followLink', PrimitiveTarget(mark={'type'
: 'decoratedSymbol', 'symbolColor': 'default', 'character': ' '}, modifiers=None))
[954354.999] user/cursorless-talon/src/actions/actions.py | action user.private_cursorless_command_and_wait({'name': 'followLink', 't
arget': PrimitiveTarget(mark={'type': 'decoratedSymbol', 'symbolColor': 'default', 'character': ' '}, modifiers=None)})
[954354.999] user/cursorless-talon/src/command.py | action user.did_emit_pre_phrase_signal()
[954354.999] user/cursorless-talon/src/command.py | action user.private_cursorless_run_rpc_command_get('cursorless.command', {'versio
n': 7, 'spokenForm': 'click void push', 'usePrePhraseSnapshot': True, 'action': {'name': 'followLink', 'target': {'type': 'primitive'
, 'mark': {'type': 'decoratedSymbol', 'symbolColor': 'default', 'character': ' '}}}})
[954354.999] user/cursorless-talon/src/cursorless_command_server.py | action user.run_rpc_command_get('cursorless.command', {'version
': 7, 'spokenForm': 'click void push', 'usePrePhraseSnapshot': True, 'action': {'name': 'followLink', 'target': {'type': 'primitive',
 'mark': {'type': 'decoratedSymbol', 'symbolColor': 'default', 'character': ' '}}}}, None)
[954354.999] user/fidgetingbits-talon/plugin/command_client/command_client.py | action win.title()
[954354.999] user/fidgetingbits-talon/plugin/command_client/command_client.py | action user.command_server_directory()
[954355.000] user/fidgetingbits-talon/plugin/command_client/command_client.py | action user.trigger_command_server_command_execution(
)
[954355.000] user/neovim-talon/apps/neovim.py | action key('ctrl-`')

This ends up landing me in normal mode afterwards.

Click from the terminal is technically something we want eventually, but seemed a little bit surprising since we don't have hat so I perhaps incorrectly think it shouldn't be trying to target them right now?

I also get misrecognitions for things like like pour one, and it will try to pour a target. This me think that we should probably disable certain commands entirely while we're in terminal so they're not even associated with cursorless, but I don't know that that's actually possible. But for instance anything that attempts to edit the buffer while you're in terminal mode, just could probably be disabled. @saidelike I don't know how often you run into stuff like this so far?

saidelike commented 1 month ago

Yes I think that would be nice to have, though I am not sure how to do it. I wonder if this would need to be done on the cursorless-talon side? cc @pokey

That being said, the misrecognition problem is kind of normal if you still use talon-vim and/or lots of your own commands that used to work fine but suddently will also conflict with legit working cursorless commands. so dealing with new conflicts might have to be handled anyway for valid commands.

But I agree having a way to disable those that are not supported would be nice, though I also like the idea of the cursorless being enabled on cursorless-talon side and then the cursorless neovim extension returning that they could have existed but are not supported, because it means other people could wish to add them and do a PR, etc. And also it means we have consistency with vscode in general for all commands.