Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Bugfix: GotoAgent did not work with paths containing spaces (like "Brackets Sprint 14") #1748

Merged
merged 2 commits into from
Oct 3, 2012
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/LiveDevelopment/Agents/GotoAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ define(function GotoAgent(require, exports, module) {
url = _urlWithoutQueryString(url);
// Extract the path, also strip the third slash when on Windows
var path = url.slice(brackets.platform === "win" ? 8 : 7);
// URL-decode the path ('%20' => ' ')
path = decodeURIComponent(path);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When decoding an entire URL, you should use decodeURI(). decodeURIComponent is used when decoding individual pieces (i.e. components) of a URI .

var promise = DocumentManager.getDocumentForPath(path);
promise.done(function onDone(doc) {
DocumentManager.setCurrentDocument(doc);
Expand Down