Is it possible to fold a block just from placing your cursor over it and hitting a hotkey? (is there a command yet for that?)
Currently I can only do that by clicking on the icon:
Is it possible to fold a block just from placing your cursor over it and hitting a hotkey? (is there a command yet for that?)
Currently I can only do that by clicking on the icon:
Go to Edit > Code Folding. It will list all the coding options and keyboard shortcuts.
I just tried those, but it won’t work unless I select code.
What I want is to actually just fold whatever block the cursor is on.
The key bindings listed in the Edit / Code Folding menu will fold the block the caret is on if no text is selected, or if there’s a selection, they’ll fold the selected text.
I can get the second option to work ( select text + folding command )
But the first one is not working, at least not as expected.
I think this is a bug.
I have the following code:
.pagination {
@include pagination;
}
I’m expecting that placing the cursor anywhere near those 3 lines and doing fold, will actually fold that given block. However it won’t work if I place the cursor anywhere on the first or third line, it’ll only work on the second line.
I’m also trying to make the fold / unfold hotkeys work with one single key with a plugin sublimator wrote for me, but it seems it won’t work the same way:
import sublime_plugin
[code]class ToggleFold(sublime_plugin.TextCommand):
‘{“keys”: “f1”], “command”: “toggle_fold”}’
def run(self, edit):
view = self.view
if any(not view.fold(sel) for sel in view.sel()):
map(view.unfold, view.sel())[/code]