Skip to content

Commit

Permalink
hyper_click -> HyperClick + settings command
Browse files Browse the repository at this point in the history
For everything user-facing, the package is called HyperClick and the
settings files etc. should match. This is also consistent with other
packages in the eco system. Also, renaming the settings file prevents
confusion and gives users a clean slate.
  • Loading branch information
braver committed Sep 15, 2020
1 parent 12e81f3 commit 34842ae
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 15 deletions.
14 changes: 14 additions & 0 deletions HyperClick.sublime-commands
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"caption": "HyperClick: Goto File",
"command": "hyper_click_jump"
},
{
"caption": "Preferences: HyperClick Settings",
"command": "edit_settings", "args":
{
"base_file": "${packages}/HyperClick/HyperClick.sublime-settings",
"default": "// HyperClick Settings - User\n{\n\t$0\n}\n"
}
}
]
4 changes: 2 additions & 2 deletions hyper_click.sublime-settings → HyperClick.sublime-settings
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
// Enable and tweak the inline annotations
"annotation_found_text": "",
"annotation_not_found_text": "",
"annotation_found_text": "",
"annotation_not_found_text": "×",
"annotations_enabled": true,

// HyperClick is enabled when the current scope matches this selector
Expand Down
4 changes: 2 additions & 2 deletions Main.sublime-menu
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
{
"command": "edit_settings",
"args": {
"base_file": "${packages}/HyperClick/hyper_click.sublime-settings",
"default": "// HyperClick Preferences – User\n// ====================================================\n\n{\n\t$0\n}\n"
"base_file": "${packages}/HyperClick/HyperClick.sublime-settings",
"default": "// HyperClick Settings - User\n{\n\t$0\n}\n"
},
"caption": "Settings"
},
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ HyperClick extends the use of the <kbd>F12</kbd> (`Go to definition`) shortcut,

## Settings
You can customize HyperClick settings by going to
`Preferences > Package Settings > HyperClick > Settings`
`Preferences > Package Settings > HyperClick > Settings`, or calling `Preferences: HyperClick Settings` from the command palette.

### Project settings

You can use [project settings](https://www.sublimetext.com/docs/3/projects.html) to configure HyperClick to look for files at specific dirs, through the settings `"lookup_paths"` and `"aliases"`.

To open the project settings file, go to `Project > Settings`. If the `Settings` option is grayed out, choose the option `Save Project As...` (right above it) to save it to disk. The `Settings` option can now be clicked.
To open the project settings file, go to `Project > Settings`. If the `Settings` option is grayed out, choose the option `Save Project As...` (right above it) to save it to disk. The `Settings` option can now be selected.

#### Example

Expand All @@ -60,7 +60,7 @@ To open the project settings file, go to `Project > Settings`. If the `Settings`
}
],
"settings": {
"hyper_click": {
"HyperClick": {
"scopes": {
"source.sass": {
"lookup_paths": [
Expand All @@ -81,9 +81,12 @@ To open the project settings file, go to `Project > Settings`. If the `Settings`

### Upgrading settings for 2.0

In 2.0 the settings structure was inverted, and no longer relies on syntax filename mapping.
In 2.0 the language-specific settings no longer rely on syntax filename mapping.
Each language is supported via an entry in the "scopes" object, by the language ["scope"](https://www.sublimetext.com/docs/3/scope_naming.html) name.

To prevent conflicting settings (and for consistency), the settings file has been renamed to [HyperClick.sublime-settings](https://github.com/aziz/SublimeHyperClick/blob/master/HyperClick.sublime-settings). If you have any old settings, they're in `Packages/User/hyper_click.sublime-settings` (where `Packages` can be found via Preferences > Browse Packages).
Project settings have been moved from the `hyper_click`

To upgrade your settings, the first step is to rearrange the settings to this new structure. Then:

- Remove now unused settings "supported_syntaxes", "default_filenames".
Expand Down
6 changes: 0 additions & 6 deletions hyper_click.sublime-commands

This file was deleted.

2 changes: 1 addition & 1 deletion hyper_click_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class HyperClickJumpCommand(sublime_plugin.TextCommand):
def __init__(self, view):
self.current_line = (-1, -1)
self.view = view
self.settings = sublime.load_settings('hyper_click.sublime-settings')
self.settings = sublime.load_settings('HyperClick.sublime-settings')
self.window = view.window()

def want_event(self):
Expand Down

0 comments on commit 34842ae

Please sign in to comment.