mirror of
https://github.com/atom/atom.git
synced 2026-02-07 21:25:05 -05:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user