Sublime Forum

Resolved: Bug in unfold_all not shifting screen to cursor and ™ inserting in ST4

#1

My hotkeys
{ “keys”: [“alt+1”], “command”: “fold_by_level”, “args”: {“level”: 1} },
{ “keys”: [“alt+2”], “command”: “unfold_all”},

SUBLIME 4 - Problems
1.In sublime 4 the cursor not shifting to cursor when unfold_all,
2. When after that pressing again alt+2 unfold_all it giving me you can see it in last part of giff.

SUBLIME 3 - no problems at all

mac os Mojave 10.14.5
U.S keyboard
Version sublime 4 4146
Version sublime 3 3211

0 Likes

#2

In sublime 3 are more commands in Packages/Default/fold.py

to make it work like in sublime 3 (to scroll to cursor when unfolded all) you mast add this code to Packages/Default/fold.py

class UnfoldAllCommand(sublime_plugin.TextCommand):
    def run(self, edit):
        self.view.unfold(sublime.Region(0, self.view.size()))
        self.view.show(self.view.sel())

or you can create file with extention py
unfoldallcursor.py and put on user folder
with code

import sublime
import sublime_plugin

class UnfoldAllCursorCommand(sublime_plugin.TextCommand):
    def run(self, edit):
        self.view.unfold(sublime.Region(0, self.view.size()))
        self.view.show(self.view.sel())

now you have unfold_all_cursor command

the kay code would be
{ “keys”: [“alt+2”], “command”: “unfold_all_cursor”},

and bug with:
inserting symbol after pressing key alt+2 again after command is gone!!!

0 Likes