Sublime Forum

Open file in edit mode from sidebar



I was unable to find an option to open files directly in edit mode when clicking on the sidebar in ST4.

Right now, I find it quite annoying to click a file and when trying to comment a line by pressing Ctrl+K nothing happens. Ctrl+K will only work if I already manually edited the file.



Files opened via sidebar can be directly edited without any extra action by default. They open in semi-transient state and directly switch to normal mode when start editing.

I am not aware of ctrl+k to be bound to commenting files. Hitting that binding twice truncates a line though.

You may try to run ST in SAFE MODE to check wheter the behavior you see is caused by a plugin.



Sorry, my fault, it’s Ctrl+# which I mapped to “toggle_comment” as I’m working with a german keyboard layout.

{ "keys": ["ctrl+#"], "command": "toggle_comment", "args": { "block": false } },

I click on a file in the sidebar of my project, navigate to a line, press Ctrl+# and nothing happens. The file also isn’t listed under “Open Files” in the sidebar.

After changing something in the file (e.g. pressing “space”) the file appears under “Open Files” in the sidebar and Ctrl+# works.



The file also isn’t listed under “Open Files” in the sidebar.

That’s normal as clicking a file once opens it in semi-transient mode. It means the tab will be re-used to display the next clicked file.

Any command which manipuates content should immediately convert it to a “normal tab”. Commenting in/out blocks of code belongs to that category of commands.

Maybe a setting or plugin is causing your issue. Maybe view looses focus? It would cause key bindings not to effect it.

Hence, please try to start ST in SAFE MODE (without any plugins active).

If the issue persists you might want to file a bug report at with details about your ST build, OS, etc.

Otherwise the behavior might be caused by a plugin or setting, so checking the list of installed ones and disabling them one by one to find the culprit might be needed.



Maybe you are faced with following bug?




thanks for all your help and advices. It must have something to do with opening files from the sidebar and looks indeed as a bug.

As keyboard bindings in safe mode are reset on every start, I renamed my ST profile to start with a new one and only added the line for toggle_comment.

When doing a drag & drop of a file to the editor and press Ctrl+#, the line is changed to a comment as expected.

When I open a project, click on a file in the “FOLDERS” list, select a line and press Ctrl+# nothing happens. Only when I change (add / remove) something, and the file gets listed under “OPEN FILES” Ctrl+# works.

After doing this with any file, when clicking on another file under “FOLDERS”, Ctrl+# works as expected, “comment” is toggled and the file is listed under “OPEN FILES”.

Using click / double click doesn’t seem to change this behaviour.