From 6ed0684eed0c8eef8c1d8a0ab84e8c11da2f6c2b Mon Sep 17 00:00:00 2001 From: Corey Johnson & Nathan Sobo Date: Tue, 10 Jan 2012 11:36:15 -0800 Subject: [PATCH] Fix Project.getFilePaths spec. It returns relative paths. --- spec/atom/project-spec.coffee | 2 +- src/atom/project.coffee | 3 +-- vendor/ace/keyboard/textinput.js | 18 +++++++++--------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/spec/atom/project-spec.coffee b/spec/atom/project-spec.coffee index 9d50de015..6550de079 100644 --- a/spec/atom/project-spec.coffee +++ b/spec/atom/project-spec.coffee @@ -8,7 +8,7 @@ describe "Project", -> describe ".getFilePaths()", -> it "returns a promise which resolves to a list of all file urls in the project, recursively", -> - expectedPaths = (url for url in fs.list(project.url, true) when fs.isFile url) + expectedPaths = (url.replace(project.url, '') for url in fs.list(project.url, true) when fs.isFile url) waitsForPromise -> project.getFilePaths().done (result) -> diff --git a/src/atom/project.coffee b/src/atom/project.coffee index 08d1c0790..df49ea120 100644 --- a/src/atom/project.coffee +++ b/src/atom/project.coffee @@ -12,8 +12,7 @@ class Project getFilePaths: -> projectUrl = @url fs.async.listFiles(@url, true).pipe (urls) -> - urls = (url.replace(projectUrl, "") for url in urls when fs.isFile(url)) - urls + url.replace(projectUrl, "") for url in urls open: (filePath) -> filePath = @resolve filePath diff --git a/vendor/ace/keyboard/textinput.js b/vendor/ace/keyboard/textinput.js index b828dcf65..3a2a5bbf7 100644 --- a/vendor/ace/keyboard/textinput.js +++ b/vendor/ace/keyboard/textinput.js @@ -48,7 +48,7 @@ var TextInput = function(parentNode, host) { var text = dom.createElement("textarea"); if (useragent.isTouchPad) text.setAttribute("x-palm-disable-auto-cap", true); - + text.style.left = "-10000px"; parentNode.appendChild(text); @@ -97,10 +97,10 @@ var TextInput = function(parentNode, host) { var onTextInput = function(e) { setTimeout(function () { if (!inCompostion) - sendText(e.data); + sendText(e.data); }, 0); }; - + var onPropertyChange = function(e) { if (useragent.isOldIE && text.value.charCodeAt(0) > 128) return; setTimeout(function() { @@ -137,7 +137,7 @@ var TextInput = function(parentNode, host) { sendText(); }, 0); }; - + var onCut = function(e) { copied = true; var copyText = host.getCopyText(); @@ -164,12 +164,12 @@ var TextInput = function(parentNode, host) { inCompostion ? onCompositionUpdate() : onCompositionStart(); }); } - + if ("onpropertychange" in text && !("oninput" in text)) event.addListener(text, "propertychange", onPropertyChange); else event.addListener(text, "input", onTextInput); - + event.addListener(text, "paste", function(e) { // Mark that the next input text comes from past. pasted = true; @@ -178,7 +178,7 @@ var TextInput = function(parentNode, host) { if (e.clipboardData && e.clipboardData.getData) { sendText(e.clipboardData.getData("text/plain")); e.preventDefault(); - } + } else { // If a browser doesn't support any of the things above, use the regular // method to detect the pasted input. @@ -251,8 +251,8 @@ var TextInput = function(parentNode, host) { if (mousePos) { if (!tempStyle) tempStyle = text.style.cssText; - - text.style.cssText = + + text.style.cssText = 'position:fixed; z-index:1000;' + 'left:' + (mousePos.x - 2) + 'px; top:' + (mousePos.y - 2) + 'px;';