ospfranco / sol

MacOS launcher & command palette
MIT License
1.92k stars 89 forks source link

Command+Shift+V keyboard binding conflicts with expected OS "Paste and Match Style" behaviour #42

Closed sublimal closed 2 years ago

sublimal commented 2 years ago

This is a fairly common keyboard shortcut (Command+Shift+V) to paste without style. Sol hooking this hotkey is overriding the expected OS behaviour even without sol being open.

https://github.com/ospfranco/sol/blob/acbb1ad50e1106824e1b1a73913d1fb2eef457e1/macos/sol-macOS/AppDelegate.swift#L27

As there is currently no way to disable or customise keybindings in sol can this shortcut be changed to something that doesn't conflict with the OS defaults? Command+Option+V may be a viable alternative - this to me reads intuitively as 'prompt me for options to paste'

ospfranco commented 2 years ago

Currently there is no option to customize this behavior, but your are right, I'll add it later

ospfranco commented 2 years ago

There is a new release (1.1.27), you can now choose command + option + v as a shortcut for the clipboard manager

sublimal commented 2 years ago

I've initiated an upgrade and restarted the app.

Pressing the keyboard combination now results in Sol crashing. Logs from console:

error   19:46:45.302571+1000    sol     Invariant Violation: scrollToIndex out of range: item length 0 but minimum is 1

This error is located at:
    in s
    in s
    in mge
    in RCTView
    in Unknown
    in RCTView
    in Unknown
    in kb

default 19:46:45.366628+1000    sol     *** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: Invariant Violation: scrollToIndex out of range: item length 0 but minimum is 1

I also don't see an option in settings.

sublimal commented 2 years ago

I've done some further testing and was unable to replicate the crash. I did notice is 3-4 times but haven't been able to do it again. I'll report back if I can make a repro.

I still don't see an option in settings though: image image

ospfranco commented 2 years ago

Hmm that settings view looks broken, let me take a look

ospfranco commented 2 years ago

That crash usually happens when you have no items in your clipboard (something with auto-scroll), should be fixed now. The settings should now be fixed as well. Latest version is 1.1.28.