It seems that the order of the shortcuts in Shortcuts.json changes every time the application is launched. This means that if you check the config file into Git, new changes are generated every time you start Spectacle.
I'm using Spectacle 1.2 (672) on OSX 10.12.2.
Steps to reproduce:
cp ~/Library/Application\ Support/Spectacle/Shortcuts.json ~/Desktop/Shortcuts.json.1cp ~/Library/Application\ Support/Spectacle/Shortcuts.json ~/Desktop/Shortcuts.json.2diff ~/Desktop/Shortcuts.json.1 ~/Desktop/Shortcuts.json.2 -- example output:11,12c11,12
< "shortcut_key_binding" : "ctrl+shift+cmd+right",
< "shortcut_name" : "MoveToLowerRight"
---
> "shortcut_key_binding" : "ctrl+alt+left",
> "shortcut_name" : "MoveToPreviousThird"
67,68c67,68
< "shortcut_key_binding" : "ctrl+cmd+left",
< "shortcut_name" : "MoveToUpperLeft"
---
> "shortcut_key_binding" : "ctrl+shift+cmd+right",
> "shortcut_name" : "MoveToLowerRight"
71,72c71,72
< "shortcut_key_binding" : "ctrl+alt+left",
< "shortcut_name" : "MoveToPreviousThird"
---
> "shortcut_key_binding" : "ctrl+cmd+left",
> "shortcut_name" : "MoveToUpperLeft"
As you can see, the order of the shortcuts changed, but the bindings are identical. If you repeat this process multiple times, you will continue to see new orderings being written to Shortcuts.json.
Interesting issue! I'll spend some time investigating. I can totally see how this could be an issue if you keep your configuration files in source control. Thanks for reporting.
Hello. Any timeline for the fix?
Okay so on initial inspection it looks like the issue is that when the shortcut array is written to JSON here it isn't sorted:
I guess the easiest way to fix would be to sort the NSMutableArray<NSDictionary *> *jsonArray = [NSMutableArray new]; by key after filling it. This SO answer might be helpful.
@gibfahn FYI this issue is fixed in #810 It's waiting to be merged.
Most helpful comment
Interesting issue! I'll spend some time investigating. I can totally see how this could be an issue if you keep your configuration files in source control. Thanks for reporting.