Sublime Forum

Bug: linux, new folder, rename, new file Enter doesn't work

#1

On the sidebar click “New Folder” and enter folder name in field below. Then press Enter and it produces line break in the field (not creating the folder). And the same for New File, and Rename.

Arch Linux, KDE, Wayland.

0 Likes

#2

works fine here in build 4115 (although with Linux Mint, Cinammon and X11). Try safe mode - likely in your config there is a keybinding or plugin overriding the behavior

0 Likes

#3

4116 doesn’t work. Plugins set was not changed, only ST build version. Plugins don’t have an access to these functions, as I thunk.

0 Likes

#4

Hm. In the safe mode it works ok…

0 Likes

#5

But, anyway, it’s a bug. The bug was delivered at v4. The field to enter a file name should not affect a plugin. I don’t want to debug plugins and modify them to get it worked ok back. I think it’s obviously ST4 bug and the “try safe mode” means nothing.

0 Likes

#6

I am not satisfied.

0 Likes

#7

It’s not obviously a but in ST; plugins also receive updates, especially so with ST4. If you want to find the culprit you can narrow down which plugin is causing the behavior using the "ignored_packages" setting.

0 Likes

#8

And then?

>>> sublime.log_commands()
command: rename_path {"paths": ["/back/auth/internal/auth/model/pg/pg.go"]}
command: move_to {"extend": false, "to": "eol"}
command: insert {"characters": "\n"}

Something inserts \n in the input field (the rename file field). May be I can found it and turn off. Obviously, it affects text/code field too. And I will got this problem from other side.

0 Likes

#9

The fact that it works in Safe Mode shows that it’s not a core Sublime issue and it caused by something else.

I would use Preferences > Browse Packages and look for a folder named Default ; if it exists and there are any sublime-keymap files, move them out of the way.

2 Likes

#10

Not really. Wired side effects of the something else is a core sublime issue. Key bindings in special fields. I think there is no developer documentation about it (one more issue).

0 Likes

#11

You or some package you installed specifically creating a key binding which triggers in situations it’s not supposed to and blocking functionality is not a side effect or a Sublime issue; it’s Sublime doing exactly what it’s being told to do.

We can agree to disagree though; the source of your problem is an errant key binding that’s specifically responding to the enter key by executing insert with an argument of \n to insert a newline. The solution to your problem is to find the binding and remove it.

0 Likes

#12

I’ve tried to remove this line

	{ "keys": ["enter"], "command": "insert", "args": {"characters": "\n"} },

from Default (Linux).sublime-keymap and then Enter stops to work at all.

All plugins have no ‘enter’ bindings.


Re-reading the thread, and trying everything, I found

I would use Preferences > Browse Packages and look for a folder named Default ; if it exists and there are any sublime-keymap files, move them out of the way.

this works. Everything as it was – charm, fine, ok, great. Sorry I didn’t pay enough attention to this at first. It’s just a bit unexpected.

Than you very much @OdatNurd. Thanks all.

2 Likes

#13

Note that anything in the Default folder will supplant the defaults in Sublime Text. If any of those files change with an update you’ll need to keep whatever patch you made up to date otherwise you will get unexpected behaviour at some point. I suggest never overriding defaults unless you use a package called OverrideAudit that keeps track of that stuff for you.

0 Likes