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()
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

Loading…
Cancel
Save