logic: sublime plugin fix
* implemted checking if file really exists before letting sublime jump there.
This commit is contained in:
@@ -3,7 +3,7 @@ import sublime_plugin
|
|||||||
import SocketServer
|
import SocketServer
|
||||||
import threading
|
import threading
|
||||||
import socket
|
import socket
|
||||||
|
import os.path
|
||||||
|
|
||||||
MESSAGE_SPLIT_STRING = ">>"
|
MESSAGE_SPLIT_STRING = ">>"
|
||||||
|
|
||||||
@@ -11,7 +11,10 @@ MESSAGE_SPLIT_STRING = ">>"
|
|||||||
# Handling Coati to Sublime communication
|
# Handling Coati to Sublime communication
|
||||||
|
|
||||||
def setCursorPosition(filePath, row, col):
|
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
|
class ConnectionHandler(SocketServer.BaseRequestHandler): # This class is instantiated once per connection to the server
|
||||||
|
|||||||
Reference in New Issue
Block a user