Sublime Forum

Build 4107 on Mac - keyboard problems, mainly TAB

#3

I do. It contains one file: Preferences.sublime-settings

0 Likes

#4

I’m seeing this too.

Same with the File Browser, Cmd + P: currently have to use Right arrow + Esc to “quickly” move to a file, rather than just pressing Enter.

@bschaaf is there supposed to be something specific to look for in the Default folder? I seem to have 88 files in there.

This is on 10.14.6

0 Likes

#5

If you use Preferences: Browse Packages and see a Default folder in there, pretty much every file inside of it is suspect. Unless you know why those files are there (and since you’re asking about it, chances are you don’t) your best bet would be to move that folder away to somewhere safe like your Desktop and then restart Sublime.

Having files in that folder override the similarly named files that ship in Sublime’s Default package (safely stored elsewhere). So what you essentially have is a shiny new Sublime Text 4 installation that is still trying to use resource files from a much older version of Sublime, and that mismatch is going to cause you issues.

The reason you want to just move the folder away is a safety backup because you’re going to revert the default functionality of Sublime back to the true defaults that way, and you may have things like custom key modifications or such that you have previously made that you will want to refer to.

The appropriate place for customizations is in your User package, which apply on top of the defaults instead of wholesale replacing them, so that on updates your customizations are applies on top of the new functionality, if that makes sense.

2 Likes

#6

Yep, definitely don’t know why those files are there! Nothing I can think of, and they all have a “Date Modified” stamp going back to Jan 2018.

Moving the Default folder has solved this problem for me.

0 Likes

#7

Bah. Yes, there was one file in Defaults and I’ve moved that away and restarted. Still TAB doesn’t do as expected, and RETURN after a CTRL-G doesn’t work. However, I’ve found that pressing ALT-RETURN does work and also ALT-TAB inserts a TAB as expected.

Any further clues anyone?

0 Likes

#8

I have the same issue with “TAB” not working, and I don’t have a “Default” folder in my Packages folder…

at least ALT+TAB helps for now, but seems like uncessary extra keys for a tab. It’s quite counterintuitive. It would be great to know what to change to get the function to what it was before.

I tried some tab preferences and key bindings, but no luck.

1 Like

#9

Same situation as unaiaia.

0 Likes

#10

Check your user keybindings for a binding on the tab key for a command named insert_best_completion; that command no longer exists in ST4, so if you have a binding for it, it won’t do anything.

0 Likes

Tabbing Doesn't Work in some syntaxes
#11

I do not have anything binded to tab in my custom key bindings, but these are all in the default key bindings. Not sure why there are so many things tied to the same command. Does anything in the below stick out to you as wrong/bad?

	{ "keys": ["tab"], "command": "insert", "args": {"characters": "\t"} },
{ "keys": ["tab"], "command": "auto_complete", "args": {"mini": true, "default": "\t"},
	"context":
	[
		{ "key": "auto_complete_visible", "operand": false },
		{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
		{ "key": "setting.tab_completion", "operator": "equal", "operand": true },
		{ "key": "preceding_text", "operator": "regex_match", "operand": ".*\\w", "match_all": true },
	]
},
{ "keys": ["tab"], "command": "expand_snippet", "context":
	[{ "key": "has_snippet" }, ]
},
{ "keys": ["tab"], "command": "reindent", "context":
	[
		{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
		{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
		{ "key": "preceding_text", "operator": "regex_match", "operand": "^$", "match_all": true },
		{ "key": "following_text", "operator": "regex_match", "operand": "^$", "match_all": true }
	]
},
{ "keys": ["tab"], "command": "indent", "context":
	[{ "key": "text", "operator": "regex_contains", "operand": "\n" } ]
},
{ "keys": ["tab"], "command": "move", "args": {"by": "lines", "forward": true}, "context":
	[
		{ "key": "overlay_has_focus", "operator": "equal", "operand": true }
	]
},
{ "keys": ["tab"], "command": "next_field", "context":
	[{ "key": "has_next_field", "operator": "equal", "operand": true }]
},
{ "keys": ["tab"], "command": "commit_completion", "context":
	[{ "key": "auto_complete_visible" }, ]
},
0 Likes

#12

No, nothing seems awry there. As a test, when you use the Preferences: Key Bindings option to open the window with the defaults on the left, you should not be able to make any changes to the left hand file.

If you can, you have an override and that might be causing a problem (in which case, use the advice above, but presumably you’ve already checked that).

Also, did you check if the problem also happens in Safe Mode?

1 Like

#13

Some success, thanks! I have some bindings in the right-hand panel that include “insert_best_completion”. I tried commenting out just the portions that mentioned that command but still had the problem, but commenting out the entire ‘[“tab”]’ entries with all contexts seems to have left me with a working TAB key - yay!

However, I’ve still got the problem that ENTER does nothing on a goto. So, I do this:

CTRL+G 666 ENTER

The ‘ENTER’ does nothing. I can’t see any bindings other than those with a context of ‘find’, ‘replace’, ‘incremental_find’, ‘auto_complete_visible’ and ‘auto_indent’ (and the plain one that inserts a ‘\n’). I’ve tried commenting out these last two but to no effect.

0 Likes

#14

If the Enter key doesn’t allow you to select items in various panels, the most likely cause is that you have an override on the default key bindings. In ST3 enter was hard coded to be the key that selects items, but in ST4 it’s been enhanced so that you can have custom bindings.

The default key bindings from the left hand pane should have various bindings on enter that use the select command; if they’re not present you can’t pick things from panels.

The easiest check for that is to use Preferences > Key Bindings; are you allowed to make changes in the left hand pane? It should be a read-only view. If you can edit files there, you have an override that’s causing you issues.

0 Likes

#15

Nope, can’t edit the left pane.

Lots of mappings for “enter” though (10 matches to “keys”: [“enter”]) so I imagine one of those is over-riding the desired one. Some of the variants actually specify overlay_name=goto in the context, but not the ‘plain’ one in the ‘//Overlay key bindings’ section so I’d expect it to map to ‘select’ for all overlays?

//Overlay key bindings
{ "keys": ["enter"], "command": "select", "context":
	[
		{ "key": "overlay_has_focus", "operator": "equal", "operand": true }
	],
},

Pity there’s no ‘what will the key actually do if I press it now?’ function - or is there…?

Nice looking YouTube channel by the way - I think I’ll spend some time in there!

0 Likes

#16

You can see what keys are triggering by opening the Sublime console (View > Show Console) and entering sublime.log_commands(); then when you press keys, what they’re trying to do will be logged.

You may want to try that along with sublime.log_input() as well; that tells Sublime to log the keys that it sees you pressing, which may be different than you expect. (For example, the enter key on a numeric keypad is not the same as the normal enter key).

1 Like

#17

Aw, cool! Ok, pressing enter in the ‘goto’ box is trying to insert a “\n” where I imagine I’m wanting a ‘select’…

In the ‘User’ sublime-keymap (on the right), I seem to have a mirroring of the left window for all of the “enter” mappings except those in the “Overlay key bindings” section. Perhaps I’d be better off just deleting (moving to /tmp) that file.

0 Likes

#18

Something to note is that like preferences, the key bindings in the left hand window are always in effect and the ones in the right hand window (your User bindings) are added on top of the list on the left.

As such, your own key bindings should only contain bindings for keys that you want to add or change from the default. If you have a mirror of the file on the left on the right hand side, you have a situation similar to the one described above; bindings that are blocking the defaults from working.

0 Likes

#19

I just noticed at the top of the console window it said:

Unable to open /Users/rog/Library/Application Support/Sublime Text 3/Packages/Default/Default (OSX).sublime-keymap

Might explain the problem? Perhaps there’s something in there that’s causing it not to parse properly?

Actually, why is it opening ‘Sublime Text 3’ things when it’s build 4107…?

0 Likes

#20

Noted the something. I’ve never intentionally mirrored the default bindings so perhaps just removing the User file is the best way forward.

Is the Default file a semi-hard-wired figment of Sublime’s imagination? The physical file seems to be absent.

So far, having moved the ‘User’ keybindings out of the way, everything seems to be back to whatever normal was long ago.

So thanks very much for all your help and I hope Gag Halfrunt elevates you above ‘just zis guy’ some day… :slight_smile:

0 Likes

#21

The actual file is stored inside of a sublime-package file and not present on disk at that particular path (unless you have an override on the file as noted above). So that particular error message is harmless. The command to open the file looks first on disk to see if you have an override, and if you don’t it proceeds to open the file from the package instead.

Also, ST4 will use the ST3 configuration area unless you specifically tell it not to, so that on upgrade you keep your configuration. A fresh install when there was no previous copy of ST3 installed would use a folder named Sublime Text instead.

0 Likes

#22

Thanks a bunch, ST4 was working flawlessly on my work laptop, but on my personal I was seeing the same issues here with the Tab and Enter keys. (Usually needing OPT+ENTER, and didn’t have a workaround for Tab)

Anyways the issue was I had the Default folder there, like you mentioned could be problematic. Was probably from old ST3, or even ST2 days. Backed that up/removed it, restarted Sublime Text 4 and those problems went away.

Cheers, thanks!

1 Like