Browse files

Read extensions as UTF

  • Loading branch information...
1 parent c422293 commit 81b047df8093aa7145e206cc7786118edf8fcf2b @sergeche sergeche committed Feb 23, 2013
View
BIN Contents/MacOS/Emmet
Binary file not shown.
View
4 Contents/Resources/emmet-app.js
@@ -12870,10 +12870,12 @@ emmet.define('bootstrap', function(require, _) {
loadExtensions: function(fileList) {
var file = require('file');
var payload = {};
+ var utils = require('utils');
+ var userSnippets = null;
var that = this;
var reader = _.bind(file.readText || file.read, file);
-
+
var next = function() {
if (fileList.length) {
var f = fileList.shift();
View
35 Contents/Resources/file-interface.js
@@ -5,19 +5,32 @@ emmet.define('file', function(require, _) {
context = ctx;
},
- read: function(path, size, callback) {
- var args = _.rest(arguments);
- callback = _.last(args);
+ _parseParams: function(args) {
+ var params = {
+ path: args[0],
+ size: -1
+ };
+
+ args = _.rest(args);
+ params.callback = _.last(args);
args = _.initial(args);
- if (!args.length) {
- size = 0;
- }
- var content = context.read_ofSize(path, 0);
- if (content) {
- callback(null, String(content));
- } else {
- callback('ObjC error');
+ if (args.length) {
+ params.size = args[0];
}
+
+ return params;
+ },
+
+ read: function(path, size, callback) {
+ var params = this._parseParams(arguments);
+ var content = context.read_ofSize(params.path, 0);
+ params.callback(content ? null : 'ObjC error', content);
+ },
+
+ readText: function(path, size, callback) {
+ var params = this._parseParams(arguments);
+ var content = context.readText(params.path);
+ params.callback(content ? null : 'ObjC error', String(content || ''));
},
locateFile: function(baseFile, fileName) {
View
6 Contents/Resources/objc-zeneditor-wrap.js
@@ -255,4 +255,8 @@ function objcExtractTabstopsOnInsert(text) {
function objcSetPreference(name, value) {
require('preferences').set(objcToString(name), value + '');
-}
+}
+
+emmet.log = function(message) {
+ NSLog(message);
+};

0 comments on commit 81b047d

Please sign in to comment.