Browse Source

restoring scroll positions when loading a client config

master
Youen Toupin 8 years ago
parent
commit
fae5d84e91
  1. 27
      server/wxLdb/wxLdbController.lua

27
server/wxLdb/wxLdbController.lua

@ -815,11 +815,26 @@ function meta.__index:loadConfig_( name )
file:close() file:close()
clientConfig.mappings = config.mappings clientConfig.mappings = config.mappings
clientConfig.breakOnConnection = config.breakOnConnection 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 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
if config.breakpoints ~= nil then end
for source, bp in pairs( config.breakpoints ) do end
if clientConfig.breakpoints ~= nil then
for source, bp in pairs( clientConfig.breakpoints ) do
if clientConfig.breakpoints[source] == nil then if clientConfig.breakpoints[source] == nil then
clientConfig.breakpoints[source] = {} clientConfig.breakpoints[source] = {}
end end
@ -828,12 +843,6 @@ function meta.__index:loadConfig_( name )
end end
end end
end end
if config.scrollPositions ~= nil then
for source, sp in pairs( config.scrollPositions ) do
clientConfig.scrollPositions[source] = sp
end
end
end end
if clientConfig.breakOnConnection == nil then if clientConfig.breakOnConnection == nil then
clientConfig.breakOnConnection = true clientConfig.breakOnConnection = true

Loading…
Cancel
Save