Bug that prevent to see errors in editor with double click fixed
authorgreg
Tue, 09 Jun 2009 10:22:20 +0200
changeset 369 b506dea7a103
parent 368 591ba4003d74
child 370 23af12b5a9fb
Bug that prevent to see errors in editor with double click fixed
PLCControler.py
--- a/PLCControler.py	Wed Jun 03 16:59:29 2009 +0200
+++ b/PLCControler.py	Tue Jun 09 10:22:20 2009 +0200
@@ -184,6 +184,7 @@
         self.FilePath = ""
         self.FileName = ""
         self.ProgramChunks = []
+        self.ProgramOffset = 0
         self.NextCompiledProject = None
         self.CurrentCompiledProject = None
         self.PluginTypes = []
@@ -217,6 +218,7 @@
         # Initialize the project buffer
         self.CreateProjectBuffer(False)
         self.ProgramChunks = []
+        self.ProgramOffset = 0
         self.NextCompiledProject = self.Copy(self.Project)
         self.CurrentCompiledProject = None
         self.Buffering = False
@@ -524,7 +526,8 @@
         self.CurrentCompiledProject = self.NextCompiledProject
 
     def GetChunkInfos(self, from_location, to_location):
-        row = col = 1
+        row = self.ProgramOffset + 1
+        col = 1
         infos = []
         for chunk, chunk_infos in self.ProgramChunks:
             lines = chunk.split("\n")
@@ -2651,6 +2654,7 @@
                 self.Project.RefreshCustomBlockTypes()
                 self.CreateProjectBuffer(True)
                 self.ProgramChunks = []
+                self.ProgramOffset = 0
                 self.NextCompiledProject = self.Copy(self.Project)
                 self.CurrentCompiledProject = None
                 self.Buffering = False