Only show events w/ descriptions in EventPalette

Also, auto-generate human readable event name in editor. This is a good example of how we could do this automatically for some kind of `onCommand`, `command`, `onInteractiveEvent` method that combines the event name, documentation string, and handler in one shot.
This commit is contained in:
Corey Johnson & Nathan Sobo
2012-10-19 11:24:40 -06:00
parent 2b8c946a65
commit de3bbce29f
8 changed files with 61 additions and 32 deletions

View File

@@ -155,10 +155,14 @@ class Editor extends View
'editor:toggle-line-comments': @toggleLineCommentsInSelection
'editor:log-cursor-scope': @logCursorScope
documentation = {}
for name, method of editorBindings
documentation[name] = _.humanizeEventName(name)
do (name, method) =>
@on name, => method.call(this); false
@document(documentation)
getCursor: (index) -> @activeEditSession.getCursor(index)
getCursors: -> @activeEditSession.getCursors()
getLastCursor: -> @activeEditSession.getLastCursor()