diff --git a/server/wxLdb/wxLdbController.lua b/server/wxLdb/wxLdbController.lua index 514d68a..2745cff 100644 --- a/server/wxLdb/wxLdbController.lua +++ b/server/wxLdb/wxLdbController.lua @@ -427,7 +427,7 @@ end function meta.__index:refreshScrollPosition_() local config = self:getActiveClientConfig_() - + for source, sp in pairs( config.scrollPositions ) do local page = self.window:getSourcePage( source ) if page ~= nil then @@ -815,11 +815,26 @@ function meta.__index:loadConfig_( name ) file:close() clientConfig.mappings = config.mappings clientConfig.breakOnConnection = config.breakOnConnection + + if config.scrollPositions ~= nil then + for source, sp in pairs( config.scrollPositions ) do + clientConfig.scrollPositions[source] = sp + end + end + for _, file in ipairs( config.openFiles ) do - self.window:getSourcePage( file ) + local page = self.window:getSourcePage( file ) + if page ~= nil then + local sp = clientConfig.scrollPositions[file] + print("scroll to", sp) + if sp ~= nil then + page:SetScrollPos(sp) + end + end end - if config.breakpoints ~= nil then - for source, bp in pairs( config.breakpoints ) do + + if clientConfig.breakpoints ~= nil then + for source, bp in pairs( clientConfig.breakpoints ) do if clientConfig.breakpoints[source] == nil then clientConfig.breakpoints[source] = {} end @@ -828,12 +843,6 @@ function meta.__index:loadConfig_( name ) end end end - - if config.scrollPositions ~= nil then - for source, sp in pairs( config.scrollPositions ) do - clientConfig.scrollPositions[source] = sp - end - end end if clientConfig.breakOnConnection == nil then clientConfig.breakOnConnection = true