debugger refactor

This commit is contained in:
kepler155c@gmail.com
2020-05-30 20:06:30 -06:00
parent 6394a48766
commit d203510527
7 changed files with 58 additions and 22 deletions

View File

@@ -1,6 +1,5 @@
local Array = require('opus.array')
local Config = require('opus.config')
local fuzzy = require('opus.fuzzy')
local UI = require('opus.ui')
local Util = require('opus.util')
@@ -492,7 +491,7 @@ local page = UI.Page {
UI.Window.resize(self)
w, h = self.width, self.height
actions.set_cursor(x, y)
actions.set_cursor()
actions.dirty_all()
actions.redraw()
end,
@@ -940,7 +939,7 @@ actions = {
local routine = {
focused = true,
title = fs.getName(fileInfo.path),
chainExit = function(_, result)
onExit = function(_, result)
-- display results of process before closing window
if result then -- clean exit
-- any errors will be picked up by multishells
@@ -1467,12 +1466,19 @@ actions = {
end,
}
local args = { ... }
local args, options = Util.parse( ... )
local filename = args[1] and shell.resolve(args[1])
if not (actions.load(filename) or actions.load(config.filename) or actions.load('untitled.lua')) then
error('Error opening file')
end
if tonumber(options.line) then
scrollY = math.max(0, tonumber(options.line) - math.floor(h / 2))
actions.go_to(1, tonumber(options.line))
actions.set_cursor()
actions.dirty_all()
end
UI:setPage(page)
local s, m = pcall(function() UI:start() end)
if not s then

View File

@@ -78,4 +78,9 @@
category = "Apps",
run = "write",
},
[ "c543ece81605c7d202121c62080a0db4020fc2c75bfac35d101d7f3e93c93949" ] = {
category = "Apps",
run = "ascii",
title = "Ascii",
},
}

View File

@@ -3,5 +3,4 @@ packages/common/hexedit.lua urlfs https://pastebin.com/raw/Ds9ajsp4
packages/common/colors.lua urlfs https://raw.githubusercontent.com/kepler155c/opus-apps/develop-1.8/ignore/colors.lua
packages/common/cowsay.lua urlfs https://pastebin.com/raw/n00VQJsw
packages/common/calc.lua urlfs https://pastebin.com/raw/nAinUn1h
packages/common/write.lua urlfs https://pastebin.com/raw/RSyhCjqv
packages/common/apis/debugger.lua urlfs https://raw.githubusercontent.com/slembcke/debugger.lua/master/debugger.lua
packages/common/write.lua urlfs https://pastebin.com/raw/RSyhCjqv