mirror of
https://github.com/atom/atom.git
synced 2026-02-18 02:21:43 -05:00
21 lines
510 B
CoffeeScript
21 lines
510 B
CoffeeScript
{bindKey} = require 'keybinder'
|
|
|
|
module.exports =
|
|
class Pane
|
|
keymap: {}
|
|
|
|
constructor: (options={}) ->
|
|
for option, value of options
|
|
@[option] = value
|
|
|
|
for shortcut, method of @keymap then do (shortcut, method) =>
|
|
bindKey method, shortcut, (args...) =>
|
|
console.log "#{shortcut}: #{method}"
|
|
if @[method]
|
|
@[method]()
|
|
else
|
|
console.error "keymap: no '#{method}' method found"
|
|
@initialize options
|
|
|
|
# Override in your subclass
|
|
initialize: -> |