From 27ffc9559ff37d6ebd006c39a2c4cf27add42111 Mon Sep 17 00:00:00 2001 From: Cubexed Date: Sat, 23 Aug 2014 01:30:06 +0200 Subject: [PATCH 1/2] -Added dont_launch_on_stop -Added ignore_length_check --- Xdebug.sublime-settings | 6 ++++++ main.py | 2 +- xdebug/protocol.py | 7 ++++++- xdebug/settings.py | 4 ++++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Xdebug.sublime-settings b/Xdebug.sublime-settings index e983b00..d29b11f 100644 --- a/Xdebug.sublime-settings +++ b/Xdebug.sublime-settings @@ -83,6 +83,12 @@ // Note: This will only work if you have the 'url' setting configured. "launch_browser": false, + // Don't launch browser when session stops + "dont_launch_on_stop": false, + + // Ignore length size errors + "ignore_length_check": false, + // When launching browser on session stop do not execute script. // By using parameter XDEBUG_SESSION_STOP_NO_EXEC instead of XDEBUG_SESSION_STOP. "browser_no_execute": false, diff --git a/main.py b/main.py index ee8553f..d32d5e1 100644 --- a/main.py +++ b/main.py @@ -335,7 +335,7 @@ def run(self, close_windows=False, launch_browser=False, restart=False): self.window.active_view().run_command('xdebug_breakpoint', {'rows': [S.BREAKPOINT_RUN['lineno']], 'filename': S.BREAKPOINT_RUN['filename']}) S.BREAKPOINT_RUN = None # Launch browser - if launch_browser or (config.get_value(S.KEY_LAUNCH_BROWSER) and not restart): + if launch_browser or (config.get_value(S.KEY_LAUNCH_BROWSER) and not config.get_value(S.KEY_DONT_LAUNCH_ON_STOP) and not restart): util.launch_browser() # Close or reset debug layout if close_windows or config.get_value(S.KEY_CLOSE_ON_STOP): diff --git a/xdebug/protocol.py b/xdebug/protocol.py index 1b8c1a2..097ad29 100644 --- a/xdebug/protocol.py +++ b/xdebug/protocol.py @@ -164,7 +164,12 @@ def read_data(self): if int(length) == len(message): return message else: - raise ProtocolException("Length mismatch encountered while reading the Xdebug message") + error = "Length mismatch encountered while reading the Xdebug message %s:%s" % (length, message) + if get_value(S.KEY_IGNORE_LENGTH_CHECK): + print(error) + return message + else: + raise ProtocolException(error) def read(self, return_string=False): """ diff --git a/xdebug/settings.py b/xdebug/settings.py index dd73f88..1be178f 100644 --- a/xdebug/settings.py +++ b/xdebug/settings.py @@ -29,6 +29,8 @@ KEY_BROWSER_NO_EXECUTE = "browser_no_execute" KEY_DISABLE_LAYOUT = "disable_layout" KEY_DEBUG_LAYOUT = "debug_layout" +KEY_DONT_LAUNCH_ON_STOP = "dont_launch_on_stop" +KEY_IGNORE_LENGTH_CHECK = "ignore_length_check" KEY_BREAKPOINT_GROUP = "breakpoint_group" KEY_BREAKPOINT_INDEX = "breakpoint_index" @@ -119,4 +121,6 @@ KEY_CURRENT_LINE, KEY_PYTHON_PATH, KEY_DEBUG + KEY_DONT_LAUNCH_ON_STOP, + KEY_IGNORE_LENGTH_CHECK, ] \ No newline at end of file From c89441296458df5e14cc42d83ce2c552db658deb Mon Sep 17 00:00:00 2001 From: Cubexed Date: Sat, 23 Aug 2014 05:31:56 +0200 Subject: [PATCH 2/2] -Fixed a little mistake --- xdebug/settings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xdebug/settings.py b/xdebug/settings.py index 1be178f..5471043 100644 --- a/xdebug/settings.py +++ b/xdebug/settings.py @@ -120,7 +120,7 @@ KEY_BREAKPOINT_ENABLED, KEY_CURRENT_LINE, KEY_PYTHON_PATH, - KEY_DEBUG + KEY_DEBUG, KEY_DONT_LAUNCH_ON_STOP, - KEY_IGNORE_LENGTH_CHECK, + KEY_IGNORE_LENGTH_CHECK ] \ No newline at end of file