Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to GlobalShortcuts #307

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Spacerat
Copy link
Contributor

@Spacerat Spacerat commented May 7, 2016

This PR:

  • Makes the GlobalShortcuts utility a bit more flexible and clean by leveraging CodeMirror's key-combo logic instead of my half-baked home-grown solution
  • Moves GloalShortcuts into a separate file
  • Changes the FuzzyPrompt to use GlobalShortcuts
  • Gives names to the functions in cm.options.extraKeys

These are enabling changes for the shortcut preview dialog, but they're useful even without it.


Since making this PR I have expanded it, it now contains some bugfixes and new features.

Save-shortcut fixes:

  • If you start cloudpebble and open two files in order, file1.c and file2.c, and then switch back to file1.c and then switch to the compilation pane and use the save shortcut, file2.c would save.
  • Resources behaved in a similar way except they would just throw an exception instead of saving.

I've made it so cmd-s will save the last source file you have/had open, or the current resource you had open, or do nothing

Small Error handling fixes
There are certainly many more changes like this needed, but this goes a small way to helping. In various places, errors are swallowed by error handlers when they are not rethrown in catches and not displayed anywhere, which makes user feedback and development tricker. I added two throw statements, and added the ability for the main cloudpebble loading bar to show an error state.

FuzzyPrompt command subsections

I added a subsection system to the FuzzyPrompt and added the capability to show keyboard shortcut hints, which should make it easier for users to discern what does what and discover keyboard functionality. I added a few file editing commands to this prompt to show off a few of the more obscure functions (e.g. auto-indent, save all, auto-comment); it wouldn't be too hard to add more.

screen shot 2016-09-01 at 20 39 12

When searching, the first section which is shown is the section corresponding to the first search result, the second section which is shown is the section corresponding to the first search result which is not in the first section, and so on. Within each section, items are ordered by search score first and then alphabetically.

screen shot 2016-09-02 at 15 47 38

@pebble-heroku pebble-heroku temporarily deployed to cloudpebble-sp-pr-307 May 7, 2016 00:06 Inactive
@Spacerat Spacerat temporarily deployed to cloudpebble-sp-pr-307 May 9, 2016 17:53 Inactive
@Spacerat Spacerat force-pushed the feature/shortcut-improvements branch from 8ca4147 to 0ebcd7b Compare June 22, 2016 00:31
@Spacerat Spacerat temporarily deployed to cloudpebble-sp-pr-307 June 22, 2016 00:31 Inactive
@Spacerat Spacerat temporarily deployed to cloudpebble-sp-pr-307 September 2, 2016 04:22 Inactive
@Spacerat Spacerat temporarily deployed to cloudpebble-sp-pr-307 September 2, 2016 21:40 Inactive
@Spacerat Spacerat force-pushed the feature/shortcut-improvements branch from 9f1b877 to e49039f Compare September 2, 2016 22:12
@Spacerat Spacerat temporarily deployed to cloudpebble-sp-pr-307 September 2, 2016 22:12 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants