Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some SendKeystrokes Keyboard Shortcuts Ending in a Space Character Type Out A Space #19181

Open
1 task done
biblicabeebli opened this issue Oct 14, 2024 · 5 comments · May be fixed by #19414
Open
1 task done

Some SendKeystrokes Keyboard Shortcuts Ending in a Space Character Type Out A Space #19181

biblicabeebli opened this issue Oct 14, 2024 · 5 comments · May be fixed by #19414
Labels
defect [core label] good first issue Issue suitable for first-time contributors keymap / key binding Feedback for keyboard shortcuts, key mapping, etc

Comments

@biblicabeebli
Copy link

biblicabeebli commented Oct 14, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

I believe this is an oversight, not intentional behavior.

Goal: (typeable!) whitespace characters in keystrokes sequences and keyboard shortcuts should require their canonical name be entered, and (typeable!) leading, trailing, and repeated whitespace characters should be coalesced and elided.

Issue:

  • ["workspace::SendKeystrokes", "shift-up"] types just a shift-up.
  • ["workspace::SendKeystrokes", " shift-up"] types just a shift-up.
  • ["workspace::SendKeystrokes", "shift-up "] types a shift-up and then a space. <<-- this one, this one is the bug.

Details of current behavior:

All of these work as expected

  • ["workspace::SendKeystrokes", "a a"] types aa with no spaces.
  • ["workspace::SendKeystrokes", "a \ "], does not appear to be validly parsed. An error jsonc: Invalid escape character in string. is yielded and the keystroke of the command appears to be passed through
    • (I was doing alt-n, it typed n).
  • ["workspace::SendKeystrokes", "a a a a a a a a a a a a a a a a a a a a a a a a a a a a "] types aaaaaaaaaaaaaaaaaaaaaaaaaaaa with no spaces.
  • All of the following print aaaaaaaaaaaaaaaaaaaaaaaaaaaa with no leading, trailing, or interstitial spaces:
    • ["workspace::SendKeystrokes", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa"]
      ["workspace::SendKeystrokes", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa "]
      ["workspace::SendKeystrokes",  " aaaaaaaaaaaaaaaaaaaaaaaaaaaa "]
      ["workspace::SendKeystrokes",  " aaaaaaaaaaaaaaaaaaaaaaaaaaaa"]
      ["workspace::SendKeystrokes",  " aaaaaa aaaaaaaaa aaaaaaa aaaaaa"]
      ["workspace::SendKeystrokes",  "aaaaaa aaaaaaaaa aaaaaaa aaaaaa"]
      ["workspace::SendKeystrokes",  "aaaaaa aaaaaaaaa aaaaaaa aaaaaa "]
      ["workspace::SendKeystrokes",  " aaaaaa aaaaaaaaa aaaaaaa aaaaaa "]
      

Click here to reveal the extremely normal keyboard shortcut that lead me to discover this.
"shift-pageup": [
  "workspace::SendKeystrokes",
  "shift-up shift-up shift-up shift-up shift-up shift-up shift-up shift-up shift-up shift-up shift-up shift-up shift-up shift-up shift-up "
],

Environment

Zed: v0.156.1 (Zed)
OS: Linux X11 ubuntu 24.04
Memory: 30.6 GiB
Architecture: x86_64
GPU: Intel(R) UHD Graphics 630 (CFL GT2) || Intel open-source Mesa driver || Mesa 24.0.9-0ubuntu0.2

@biblicabeebli biblicabeebli added admin read Pending admin review defect [core label] triage Maintainer needs to classify the issue labels Oct 14, 2024
@CharlesChen0823

This comment was marked as outdated.

@biblicabeebli

This comment was marked as outdated.

@htor

This comment was marked as outdated.

@biblicabeebli
Copy link
Author

The bug is bolded in the description -- it was not very visibly bold, especially on dark mode. I will .... add a marker...

This is the bug:

["workspace::SendKeystrokes", "shift-up "] types a shift-up and then a space.

"shift-up " with the trailing space character inside the quotation mark is not correctly stripping out the trailing space character.

All the other details here are to indicate that the behavior for every other case I could think of trims trailing (and leading) whitespace.

(I have not tested other "shift-up"-like combined keystrokes.)

@notpeter
Copy link
Member

Thanks for reporting @biblicabeebli.
I've reordered your description so the incorrect behavior comes first.

@notpeter notpeter added keymap / key binding Feedback for keyboard shortcuts, key mapping, etc good first issue Issue suitable for first-time contributors and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Oct 16, 2024
@brunocalza brunocalza linked a pull request Oct 18, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect [core label] good first issue Issue suitable for first-time contributors keymap / key binding Feedback for keyboard shortcuts, key mapping, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants