From 67b5606a6e76e1b80c689875da12bdf4108571a2 Mon Sep 17 00:00:00 2001 From: Lewis Christie Date: Tue, 2 Jul 2013 15:03:40 +1200 Subject: [PATCH] adds support for filepaths containing spaces filepaths are now quoted and unquoted using urllib tested on Ubuntu 12.10 --- Xdebug.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Xdebug.py b/Xdebug.py index 5bf9fe8..761f5ff 100644 --- a/Xdebug.py +++ b/Xdebug.py @@ -8,6 +8,7 @@ import json import webbrowser from xml.dom.minidom import parseString +import urllib xdebug_current = None @@ -219,7 +220,7 @@ def breakpoint_clear(self): self.del_breakpoint(row) def uri(self): - return 'file://' + os.path.realpath(self.view.file_name()) + return 'file://' + urllib.quote(os.path.realpath(self.view.file_name())) def lines(self, data=None): lines = [] @@ -656,6 +657,7 @@ def show_file(window, uri): transport, filename = uri.split(':///', 1) # scheme:///C:/path/file => scheme, C:/path/file else: transport, filename = uri.split('://', 1) # scheme:///path/file => scheme, /path/file + filename = urllib.unquote(filename) if transport == 'file' and os.path.exists(filename): window = sublime.active_window() views = window.views()