set window title with filename

Esse commit está contido em:
Chris Wanstrath
2011-08-18 23:28:14 -07:00
commit eb75345142
3 arquivos alterados com 6 adições e 1 exclusões
+1
Ver Arquivo
@@ -28,6 +28,7 @@
// https://github.com/parmanoir/jscocoa#readme
JSCocoa* jsc = [[JSCocoa alloc] initWithGlobalContext:[[webView mainFrame] globalContext]];
[jsc setObject:self withName:@"App"];
}
@end
+3 -1
Ver Arquivo
@@ -16,6 +16,7 @@ saveAs = ->
return null
if file = panel.filenames.lastObject
filename = file
App.window.title = _.last filename.split('/')
save()
canon = require 'pilot/canon'
@@ -37,6 +38,7 @@ bindKey 'open', 'Command-O', (env, args, request) ->
if file = panel.filenames.lastObject
filename = file
App.window.title = _.last filename.split('/')
code = OSX.NSString.stringWithContentsOfFile file
env.editor.getSession().setValue code
@@ -53,4 +55,4 @@ bindKey 'togglecomment', 'Command-/', (env) ->
env.editor.toggleCommentLines()
bindKey 'fullscreen', 'Command-Return', (env) ->
OSX.NSLog 'coming soon'
OSX.NSLog 'coming soon'
+2
Ver Arquivo
@@ -19,6 +19,7 @@
}
if (file = panel.filenames.lastObject) {
filename = file;
App.window.title = _.last(filename.split('/'));
return save();
}
};
@@ -42,6 +43,7 @@
}
if (file = panel.filenames.lastObject) {
filename = file;
App.window.title = _.last(filename.split('/'));
code = OSX.NSString.stringWithContentsOfFile(file);
return env.editor.getSession().setValue(code);
}