Merge branch 'dev' into user-prefs

This commit is contained in:
Justin Palmer
2013-01-31 08:25:43 -08:00
9 changed files with 67 additions and 25 deletions

View File

@@ -141,6 +141,8 @@ bool AtomCefClient::OnKeyEvent(CefRefPtr<CefBrowser> browser,
ToggleDevTools(browser);
} else if (event.modifiers == EVENTFLAG_COMMAND_DOWN && event.unmodified_character == '`') {
FocusNextWindow();
} else if (event.modifiers == (EVENTFLAG_COMMAND_DOWN | EVENTFLAG_SHIFT_DOWN) && event.unmodified_character == '~') {
FocusPreviousWindow();
}
else {
return false;

View File

@@ -105,6 +105,7 @@ class AtomCefClient : public CefClient,
bool m_HandlePasteboardCommands = false;
void FocusNextWindow();
void FocusPreviousWindow();
void Open(std::string path);
void Open();
void OpenUnstable(std::string path);

View File

@@ -23,6 +23,24 @@ void AtomCefClient::FocusNextWindow() {
}
}
void AtomCefClient::FocusPreviousWindow() {
NSArray *windows = [NSApp windows];
int count = [windows count];
int start = [windows indexOfObject:[NSApp keyWindow]];
int i = start;
while (true) {
i = i - 1;
if (i == 0) i = count -1;
if (i == start) break;
NSWindow *window = [windows objectAtIndex:i];
if ([window isVisible] && ![window isExcludedFromWindowsMenu]) {
[window makeKeyAndOrderFront:nil];
break;
}
}
}
void AtomCefClient::Open(std::string path) {
NSString *pathString = [NSString stringWithCString:path.c_str() encoding:NSUTF8StringEncoding];
[(AtomApplication *)[AtomApplication sharedApplication] open:pathString];

17
script/fix-author Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
usage() {
echo "usage: $0 sha name email"
exit 1
}
if [ ! $3 ]; then
usage
fi
git filter-branch -f --env-filter "
export GIT_AUTHOR_NAME='$2'
export GIT_AUTHOR_EMAIL='$3'
export GIT_COMMITTER_NAME='$2'
export GIT_COMMITTER_EMAIL='$3'
" -- $1..HEAD

View File

@@ -20,7 +20,7 @@ class Editor extends View
autosave: false
autoIndent: true
autoIndentOnPaste: false
nonWordCharacters: "./\\()\"-_:,.;<>~!@#$%^&*|+=[]{}`~?"
nonWordCharacters: "./\\()\"'-_:,.;<>~!@#$%^&*|+=[]{}`~?"
@content: (params) ->
@div class: @classes(params), tabindex: -1, =>

View File

@@ -1,4 +1,5 @@
DeferredAtomPackage = require 'deferred-atom-package'
$ = require 'jquery'
module.exports =
class CommandLogger extends DeferredAtomPackage
@@ -7,4 +8,25 @@ class CommandLogger extends DeferredAtomPackage
instanceClass: 'command-logger/src/command-logger-view'
onLoadEvent: (event, instance) -> instance.toggle()
activate: (rootView, state={})->
super
@eventLog = state.eventLog ? {}
rootView.command 'command-logger:clear-data', => @eventLog = {}
registerTriggeredEvent = (eventName) =>
eventNameLog = @eventLog[eventName]
unless eventNameLog
eventNameLog =
count: 0
name: eventName
@eventLog[eventName] = eventNameLog
eventNameLog.count++
eventNameLog.lastRun = new Date().getTime()
originalTrigger = $.fn.trigger
$.fn.trigger = (eventName) ->
eventName = eventName.type if eventName.type
registerTriggeredEvent(eventName) if $(this).events()[eventName]
originalTrigger.apply(this, arguments)
onLoadEvent: (event, instance) -> instance.toggle(@eventLog)

View File

@@ -1,12 +1,11 @@
{$$$} = require 'space-pen'
ScrollView = require 'scroll-view'
$ = require 'jquery'
_ = require 'underscore'
module.exports =
class CommandLoggerView extends ScrollView
@activate: (rootView, state) ->
@instance = new CommandLoggerView(rootView, state?.eventLog)
@instance = new CommandLoggerView(rootView)
@content: (rootView) ->
@div class: 'command-logger', tabindex: -1, =>
@@ -31,29 +30,12 @@ class CommandLoggerView extends ScrollView
'tree-view:directory-modified'
]
initialize: (@rootView, @eventLog={}) ->
initialize: (@rootView) ->
super
@rootView.command 'command-logger:clear-data', => @eventLog = {}
@command 'core:cancel', => @detach()
registerEvent = (eventName) =>
eventNameLog = @eventLog[eventName]
unless eventNameLog
eventNameLog =
count: 0
name: eventName
@eventLog[eventName] = eventNameLog
eventNameLog.count++
eventNameLog.lastRun = new Date().getTime()
originalTrigger = $.fn.trigger
$.fn.trigger = (eventName) ->
eventName = eventName.type if eventName.type
registerEvent(eventName) if $(this).events()[eventName]
originalTrigger.apply(this, arguments)
toggle: ->
toggle: (@eventLog={}) ->
if @hasParent()
@detach()
else

View File

@@ -1,2 +1,2 @@
window.keymap.bindKeys '.editor'
'.editor':
'tab': 'snippets:expand'

View File

@@ -1,6 +1,6 @@
# it's critical that these bindings be loaded after those snippets-1 so they
# are later in the cascade, hence breaking the keymap into 2 files
window.keymap.bindKeys '.editor'
'.editor':
'tab': 'snippets:next-tab-stop'
'shift-tab': 'snippets:previous-tab-stop'