From e8c8a4ca50ab024009f10853eaa5ba78709f9955 Mon Sep 17 00:00:00 2001 From: malte_langkabel Date: Fri, 30 Oct 2015 10:54:56 +0100 Subject: [PATCH] logic: sublime plugin fix * implemted checking if file really exists before letting sublime jump there. --- .../sublime_text/CoatiCommunicator/CoatiCommunicator.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ide_plugins/sublime_text/CoatiCommunicator/CoatiCommunicator.py b/ide_plugins/sublime_text/CoatiCommunicator/CoatiCommunicator.py index a02f6a70..6484c8a3 100644 --- a/ide_plugins/sublime_text/CoatiCommunicator/CoatiCommunicator.py +++ b/ide_plugins/sublime_text/CoatiCommunicator/CoatiCommunicator.py @@ -3,7 +3,7 @@ import sublime_plugin import SocketServer import threading import socket - +import os.path MESSAGE_SPLIT_STRING = ">>" @@ -11,7 +11,10 @@ MESSAGE_SPLIT_STRING = ">>" # Handling Coati to Sublime communication def setCursorPosition(filePath, row, col): - sublime.active_window().open_file(filePath + ":" + str(row) + ":" + str(col), sublime.ENCODED_POSITION) + if (os.path.exists(filePath)): + sublime.active_window().open_file(filePath + ":" + str(row) + ":" + str(col), sublime.ENCODED_POSITION) + else: + sublime.error_message("Coati is trying to jump to a file that does not exist: " + filePath) class ConnectionHandler(SocketServer.BaseRequestHandler): # This class is instantiated once per connection to the server