cursorless icon indicating copy to clipboard operation
cursorless copied to clipboard

Community/Knausj conflicts

Open pokey opened this issue 3 years ago • 2 comments

The problem

We have at least the following conflicts with stock knausj:

  • Uses of "that", eg "copy that", "paste that", "phones that", "indent that" etc
  • Uses of "line", eg "copy line", "clear line", etc, although these commands have roughly the same behaviour in knausj
  • "copy <number>" targets line number in knausj, but mark in Cursorless
  • "phones made", "phones whale", etc, where our "phones <target>" conflicts with knausj's "phones <homophone>"
  • "comment <number>" in community refers to line numbers not the decorated digit
  • "copy block" roughly the same behavior, but in community achieved with a cursor dance that is slower and not as reliable. Appears to be quite broken on mac.

Possible solutions

  • Change commands in cursorless
  • Change commands in knausj
  • Convert these commands to use an action, and redefine the action from cursorless

cc/ @AndreasArvidsson @knausj85 have I missed any conflicts?

Discussed in https://github.com/pokey/cursorless-vscode/discussions/314

Originally posted by codecat555 November 6, 2021 Loving cursorless!

I just ran into a knausj_talon compatibility issue with cursorless, and @pokey invited me to share it here. I'd be interested in hearing about any other tweaks people have made to avoid conflicts.

Cursorless placed an uncolored marker above the number 8 in my text and I wanted to clear that word, so I said 'clear 8'. Then, vscode jumped to line 8 (not the target line) and erased it - not what I expected.

I found this command and just changed it so the '[line]' part is not optional - https://github.com/knausj85/knausj_talon/blob/65ccd94b8fe97056a34b858b2f1f261cc5269c3f/text/line_commands.talon#L16 .

@codecat555 fwiw we fixed the specific issue you raised by changing the default term for "clear" to "change", but that's certainly not the only knausj conflict, so let's leave this discussion open.

pokey avatar Jan 05 '22 13:01 pokey

I'm finding this type of thing increasingly jarring now that I'm using cursorless in neovim because the cursorless commands (at least for now) don't work or manipulating text on the actual command line, just whatever is in the rest of the buffer. But I'm constantly trying to use the same cursorless terminology there especially chuck, paint, token, etc.

I recall andreas maybe has an existing fallback mechanism so that if a command doesn't actually do anything on cursorless side it falls back to an action? seems like this in combination with proposed solution 3 would solve a lot of these problems? I'm not sure what the status of doing something in community is, or maybe it already exists and I missed it.

I'll probably start slowly poking at solving this on my repo/community, but wanted to see what the state of things is already.

fidgetingbits avatar Jul 13 '24 08:07 fidgetingbits

The fallback mechanism is already in Cursorless proper. You(The neovim implementation) just need to provide the command server interface which gives Cursorless the focused element type.

https://github.com/cursorless-dev/cursorless/blob/14291901a8d3a778e2dee47f2648fae4a69de068/packages/common/src/types/CommandServerApi.ts#L5

https://github.com/cursorless-dev/cursorless/blob/14291901a8d3a778e2dee47f2648fae4a69de068/cursorless-talon/src/fallback.py

AndreasArvidsson avatar Jul 13 '24 09:07 AndreasArvidsson