mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Prefix "move-*" events with "core:"
I want to prefix all custom events for better categorization and to distinguish them from built-in webkit events
This commit is contained in:
@@ -91,10 +91,10 @@ class Editor extends View
|
||||
|
||||
bindKeys: ->
|
||||
editorBindings =
|
||||
'move-right': @moveCursorRight
|
||||
'move-left': @moveCursorLeft
|
||||
'move-down': @moveCursorDown
|
||||
'move-up': @moveCursorUp
|
||||
'core:move-right': @moveCursorRight
|
||||
'core:move-left': @moveCursorLeft
|
||||
'core:move-down': @moveCursorDown
|
||||
'core:move-up': @moveCursorUp
|
||||
'move-to-next-word': @moveCursorToNextWord
|
||||
'move-to-previous-word': @moveCursorToPreviousWord
|
||||
'select-right': @selectRight
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
window.keymap.bindKeys '*'
|
||||
'meta-w': 'close'
|
||||
'alt-meta-i': 'toggle-dev-tools'
|
||||
right: 'move-right'
|
||||
left: 'move-left'
|
||||
down: 'move-down'
|
||||
up: 'move-up'
|
||||
right: 'core:move-right'
|
||||
left: 'core:move-left'
|
||||
down: 'core:move-down'
|
||||
up: 'core:move-up'
|
||||
pagedown: 'page-down'
|
||||
pageup: 'page-up'
|
||||
'meta-S': 'save-all'
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
window.keymap.bindKeys '*',
|
||||
'ctrl-f': 'move-right'
|
||||
'ctrl-b': 'move-left'
|
||||
'ctrl-p': 'move-up'
|
||||
'ctrl-n': 'move-down'
|
||||
'ctrl-f': 'core:move-right'
|
||||
'ctrl-b': 'core:move-left'
|
||||
'ctrl-p': 'core:move-up'
|
||||
'ctrl-n': 'core:move-down'
|
||||
|
||||
window.keymap.bindKeys '.editor',
|
||||
'ctrl-F': 'select-right'
|
||||
|
||||
@@ -58,11 +58,11 @@ class Autocomplete extends View
|
||||
@filterMatches()
|
||||
@renderMatchList()
|
||||
|
||||
@miniEditor.preempt 'move-up', =>
|
||||
@miniEditor.preempt 'core:move-up', =>
|
||||
@selectPreviousMatch()
|
||||
false
|
||||
|
||||
@miniEditor.preempt 'move-down', =>
|
||||
@miniEditor.preempt 'core:move-down', =>
|
||||
@selectNextMatch()
|
||||
false
|
||||
|
||||
|
||||
@@ -26,13 +26,13 @@ class FuzzyFinder extends View
|
||||
@rootView.on 'fuzzy-finder:toggle-buffer-finder', => @toggleBufferFinder()
|
||||
|
||||
@on 'fuzzy-finder:cancel', => @detach()
|
||||
@on 'move-up', => @moveUp()
|
||||
@on 'move-down', => @moveDown()
|
||||
@on 'core:move-up', => @moveUp()
|
||||
@on 'core:move-down', => @moveDown()
|
||||
@on 'fuzzy-finder:select-path', => @select()
|
||||
@on 'mousedown', 'li', (e) => @entryClicked(e)
|
||||
|
||||
@miniEditor.getBuffer().on 'change', => @populatePathList() if @hasParent()
|
||||
@miniEditor.off 'move-up move-down'
|
||||
@miniEditor.off 'core:move-up core:move-down'
|
||||
|
||||
toggleFileFinder: ->
|
||||
if @hasParent()
|
||||
|
||||
@@ -32,10 +32,10 @@ class VimMode
|
||||
'i': 'insert'
|
||||
'd': 'delete'
|
||||
'x': 'delete-right'
|
||||
'h': 'move-left'
|
||||
'j': 'move-down'
|
||||
'k': 'move-up'
|
||||
'l': 'move-right'
|
||||
'h': 'core:move-left'
|
||||
'j': 'core:move-down'
|
||||
'k': 'core:move-up'
|
||||
'l': 'core:move-right'
|
||||
'w': 'move-to-next-word'
|
||||
'b': 'move-to-previous-word'
|
||||
'}': 'move-to-next-paragraph'
|
||||
@@ -47,10 +47,10 @@ class VimMode
|
||||
'insert': => @activateInsertMode()
|
||||
'delete': => @delete()
|
||||
'delete-right': => new commands.DeleteRight(@editor)
|
||||
'move-left': => new motions.MoveLeft(@editor)
|
||||
'move-up': => new motions.MoveUp(@editor)
|
||||
'move-down': => new motions.MoveDown @editor
|
||||
'move-right': => new motions.MoveRight @editor
|
||||
'core:move-left': => new motions.MoveLeft(@editor)
|
||||
'core:move-up': => new motions.MoveUp(@editor)
|
||||
'core:move-down': => new motions.MoveDown @editor
|
||||
'core:move-right': => new motions.MoveRight @editor
|
||||
'move-to-next-word': => new motions.MoveToNextWord(@editor)
|
||||
'move-to-previous-word': => new motions.MoveToPreviousWord(@editor)
|
||||
'move-to-next-paragraph': => new motions.MoveToNextParagraph(@editor)
|
||||
|
||||
Reference in New Issue
Block a user