Skip to content

Commit 1c28c3d

Browse files
committed
Warning for user of the auto_close_empty_groups
It's better than setting an "install update" in messages, because I never bother to read those (so I'm guessing people don't) (idea: the problem is that it's hard to emphasize stuff. There should be a syntax definition to highlight important changes), and because it only affect people who *we know* it is going to affect. It's not a fat disgusting promotion to uninterested programmers who just want to get stuff done. So, the setting is officially removed from FileManager. I'm happy with it :-) Also, I fixed some indentation is the only interesting part of the install message. I probably should fix it up too.
1 parent 2f09f8a commit 1c28c3d

3 files changed

Lines changed: 34 additions & 15 deletions

File tree

FileManager.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,28 @@ def _reload(file):
3636
# auto reload sub files - for dev
3737

3838

39+
def plugin_loaded():
40+
settings = get_settings()
41+
# this use to be a supported setting, but we dropped it. (see #27)
42+
if settings.get("auto_close_empty_groups") is not None:
43+
# we could remove the setting automatically, and install the
44+
# package if it was set to true, but it'd be an extra source
45+
# of bugs, and it doesn't take that much effort (it's a one
46+
# time thing, so it doesn't need to be automated)
47+
sublime.error_message(
48+
"FileManager\n\n"
49+
"auto_close_empty_groups is set, but this setting is no longer "
50+
"supported.\n\n"
51+
"Auto closing empty groups (in the layout) use to be a feature "
52+
"of FileManager, but it has now moved to it's own package.\n\n"
53+
"If you still want this behaviour, you can install "
54+
"AutoCloseEmptyGroup, it's available on package control.\n\n"
55+
"To disable this warning, unset the setting "
56+
"auto_close_empty_groups in FileManager.sublime-settings (search "
57+
"for Preferences: FileManager Settings in the command palette)"
58+
)
59+
60+
3961
class FmDevListener(sublime_plugin.EventListener):
4062
def on_post_save(self, view):
4163
"""Reload FileManager

FileManager.sublime-settings

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@
6969
// will be hidden
7070
"menu_without_distraction": true,
7171

72-
// when you close the last file of a group (ie. there will be no files left
73-
// after this files is closed), FileManager will automatically close the group
74-
"auto_close_empty_groups": false,
75-
7672
// auto refresh the side bar when you run any action that might affect it
7773
// by default, sublime text would do it by itself, but if this is
7874
// set to true, then it will be explicitly refreshed

messages/install.txt

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,18 @@ The ASCII FileManager has been generated using the ASCII Decorator.
5252
https://github.com/viisual/ASCII-Decorator
5353

5454
Tip of the day: You can bind commands to modifiers-free key combination:
55-
{
56-
"keys": ["-", ">"],
57-
"command": "insert_snippet",
58-
"args": {
59-
"contents": "→ "
60-
}
61-
}
6255

63-
Once set, each time you'll type '->', it'll insert this '→ '
56+
{
57+
"keys": ["-", ">"],
58+
"command": "insert_snippet",
59+
"args": {
60+
"contents": "→ "
61+
}
62+
}
6463

65-
If you don't know how to set up shortcuts, don't worry, it's
66-
explained here:
64+
Once set, each time you'll type '->', it'll insert this '→ '
6765

68-
http://docs.sublimetext.info/en/latest/reference/key_bindings.html
66+
If you don't know how to set up shortcuts, don't worry, it's
67+
explained here:
68+
69+
http://docs.sublimetext.info/en/latest/reference/key_bindings.html

0 commit comments

Comments
 (0)