Sublime Forum

Shortcut executes wrong action

#1

So this is driving me crazy:

On pressing CMD+SHIFT+F ST3 normally shows the find_in_files-Panel. But in my case it executes the action copy.
(I see it in the bottom bar “Copied X characters” + I saw it in my console by logging the actions)

My default keymap contains the line:

{ "keys": ["super+shift+f"], "command": "show_panel", "args": {"panel": "find_in_files"} },

My user keymap (no error, nothing that could interfere with the broken shortcut):

[
    { "keys": ["ctrl+tab"], "command": "next_view" },
    { "keys": ["ctrl+shift+tab"], "command": "prev_view" },
    { "keys": ["super+shift+r"], "command": "reindent" , "args": {"single_line": false}},
    { "keys": ["shift+command+m"], "command": "goto_definition" },
    { "keys": ["shift+tab"], "command": "unindent" }
]

Also the menu show the correct keybinding next to the option:

screenshot

I’ve searched all installed packages for this shortcut or the action copy. No results.

Must be a setting somewhere, because I downloaded another older build and the behaviour was the same.

Build 3143 (latest) / macOS 10.12

1 Like

#2

You mention that you see the copy action in the console along with the two logging commands active. Could you provide that transcript of the console performing the action with the keybind and the menu? It might be helpful.

0 Likes

#3

It’s just command: copy - check this little screencast: https://cl.ly/06212e0E0C0f

0 Likes

#4

Appears the site is blocked for me unfortunately.

0 Likes

#5

Maybe this direct link could work: https://d26dzxoao6i3hh.cloudfront.net/items/0Y423c0Z3z19233V173Q/Screen%20Recording%202017-11-10%20at%2004.21%20PM.mov

So here is just the console output:

command: copy # pressing CMD+SHIFT+F
command: copy # pressing CMD+SHIFT+F again
command: copy # pressing CMD+SHIFT+F again
command: show_panel {"panel": "find_in_files"} # clicking the menu item
command: hide_panel {"cancel": true} # pressed ESC to close the find_in_files panel
command: show_panel {"panel": "console", "toggle": true} # show console again to copy this output
0 Likes

#6

Try again with running sublime.log_input(True) before and post the output.

0 Likes

#7

The movie worked, though I don’t have audio on this machine (work) so there wasn’t a lot of context for what was going on. Sorry to keep asking for more but I think that’s just the commands logging. Since this is a keybinding issue, it would be helpful to see both the commands and the key capture at the same time. It could be illuminating.

sublime.log_commands(True)
sublime.log_input(True)
0 Likes

#8

Thats really strange:

>>> sublime.log_input(True)
key evt: super+c // I actually really press CMD+SHIFT+F
command: copy
key evt: super+c
command: copy

Other shortcuts work fine:

key evt: shift+super+g
command: find_prev
0 Likes

#9

Well that’s the next clue. Sublime is doing what it ought to given what it’s receiving. Unfortunately here, I’m a bit at a loss. My best guess is that OSX is doing something that captures or eliminates your shift selection, but I don’t know much about OSX anymore and have no idea why it might do that.

0 Likes

#10

And just to be sure, I’ve checked that no other application thats currently running uses this shortcut:
I’m also using BetterTouchTools - also quit the app, didn’t fix.

I could only find this (don’t even know why this shortcut was set like this (I’m pretty sure I didn’t set this))

But it was disabled anyway. - Just to be sure I deleted this option.

So I closed all active apps - even the finder. Sublime still gets super+c

Still? I’m tired - this is like the most dirty workaround - but it actually works with a small delay:

I’ve found a unused shortcut (which is very rare :smile:) in Sublime (super+shift+k) and added it to my user keymap.

{ "keys": ["super+shift+k"], "command": "show_panel", "args": {"panel": "find_in_files"} },

Then I added a new action to BetterTouchTools for Sublime Text that triggers on super+shift+f and actually sends super+shift+k. Hacky but works. No clue why.

As I need this shortcut pretty often, this is the best way to come around without smashing my keyboard into my screen :wink:

0 Likes

#11

Well any port in a storm? :slight_smile: Sorry I don’t have a better answer. Spotlight is an Apple thing that’s baked into the environment at a pretty low level isn’t it? Maybe there’s something the OS is doing even when this feature is disabled that is swallowing the proper super+shift+f chord.

If other OSX experts can weigh in, they may have more domain specific answers that could help.

0 Likes

#12

Thank you very much anyway! Glad you tried to help! On Stack Overflow isn’t a single comment yet.

I have changed the default Spotlight shortcut from CMD+SPACE to ALT+SPACE because I mainly use another App called Alfred on CMD+SPACE.

This works fine for years - The screenshot just shows the Spotlight Service (Don’t really know what the service can do/how this works, never used it) and it was disabled. Sadly I cant remember what actions I did the last few days which could cause this - The only thing I really know was updating ST3 to the current stable build.

Of cause, I have to work! :smile:

0 Likes