Meta-s triggers save event with the new css-based keymap.

This commit is contained in:
Corey Johnson & Nathan Sobo
2012-01-10 17:42:42 -08:00
parent 6a25dc00c5
commit 4e7b1b8979
5 changed files with 12 additions and 9 deletions

View File

@@ -18,6 +18,7 @@ class Editor extends Template
@aceSessions = {}
@buildAceEditor()
@setBuffer(new Buffer)
@on 'save', => @save()
shutdown: ->
@destroy()

View File

@@ -23,9 +23,9 @@ class RootView extends Template
initialize: ({url}) ->
@globalKeymap = new GlobalKeymap
@globalKeymap.bindKeys '*'
'meta+s': 'save'
'meta+w': 'close'
'meta+t': 'find-files'
'meta-s': 'save'
'meta-w': 'close'
'meta-t': 'find-files'
@editor.keyEventHandler = @globalKeymap

View File

@@ -25,7 +25,8 @@ windowAdditions =
$(window).unbind('blur')
bindMenuItems: ->
@bindMenuItem "File > Save", "meta+s", => @rootView.editor.save()
# we want to integrate this better with keybindings
# @bindMenuItem "File > Save", "meta+s", => @rootView.editor.save()
bindMenuItem: (path, pattern, action) ->
@menuItemActions[path] = {action: action, pattern: pattern}