Cleanup.
This commit is contained in:
parent
20d3155eb1
commit
9a4cae695c
12
ldt.lua
12
ldt.lua
@ -1,9 +1,8 @@
|
|||||||
local C = require("curses")
|
local C = require("curses")
|
||||||
local re = require('re')
|
local re = require('re')
|
||||||
local repr = require('repr')
|
local repr = require('repr')
|
||||||
local ldb, stdscr
|
local ldb
|
||||||
local AUTO = { }
|
local AUTO = { }
|
||||||
local log = io.open("output.log", "w")
|
|
||||||
local callstack_range
|
local callstack_range
|
||||||
callstack_range = function()
|
callstack_range = function()
|
||||||
local min, max = 0, -1
|
local min, max = 0, -1
|
||||||
@ -250,7 +249,6 @@ do
|
|||||||
table.insert(self.colors, color_fn)
|
table.insert(self.colors, color_fn)
|
||||||
end
|
end
|
||||||
self:configure_size(height, width)
|
self:configure_size(height, width)
|
||||||
log:write("New pad: " .. tostring(self.height) .. "," .. tostring(self.width) .. " " .. tostring(self._height) .. "," .. tostring(self._width) .. "\n")
|
|
||||||
self._frame = C.newwin(self.height, self.width, self.y, self.x)
|
self._frame = C.newwin(self.height, self.width, self.y, self.x)
|
||||||
self._frame:immedok(true)
|
self._frame:immedok(true)
|
||||||
self._pad = C.newpad(self._height, self._width)
|
self._pad = C.newpad(self._height, self._width)
|
||||||
@ -376,8 +374,8 @@ err_hand = function(err)
|
|||||||
end
|
end
|
||||||
ldb = {
|
ldb = {
|
||||||
run_debugger = function(err_msg)
|
run_debugger = function(err_msg)
|
||||||
stdscr = C.initscr()
|
local stdscr = C.initscr()
|
||||||
SCREEN_H, SCREEN_W = stdscr:getmaxyx()
|
local SCREEN_H, SCREEN_W = stdscr:getmaxyx()
|
||||||
C.cbreak()
|
C.cbreak()
|
||||||
C.echo(false)
|
C.echo(false)
|
||||||
C.nl(false)
|
C.nl(false)
|
||||||
@ -708,11 +706,13 @@ ldb = {
|
|||||||
pad:refresh()
|
pad:refresh()
|
||||||
end
|
end
|
||||||
elseif C.KEY_RESIZE == _exp_0 then
|
elseif C.KEY_RESIZE == _exp_0 then
|
||||||
|
SCREEN_H, SCREEN_W = stdscr:getmaxyx()
|
||||||
stdscr:clear()
|
stdscr:clear()
|
||||||
stdscr:refresh()
|
stdscr:refresh()
|
||||||
for _, pad in pairs(pads) do
|
for _, pad in pairs(pads) do
|
||||||
pad:refresh()
|
pad:refresh(true)
|
||||||
end
|
end
|
||||||
|
C.doupdate()
|
||||||
elseif ('q'):byte() == _exp_0 or ("Q"):byte() == _exp_0 then
|
elseif ('q'):byte() == _exp_0 or ("Q"):byte() == _exp_0 then
|
||||||
pads = { }
|
pads = { }
|
||||||
C.endwin()
|
C.endwin()
|
||||||
|
11
ldt.moon
11
ldt.moon
@ -1,9 +1,8 @@
|
|||||||
C = require "curses"
|
C = require "curses"
|
||||||
re = require 're'
|
re = require 're'
|
||||||
repr = require 'repr'
|
repr = require 'repr'
|
||||||
local ldb, stdscr
|
local ldb
|
||||||
AUTO = {}
|
AUTO = {} -- Singleton
|
||||||
log = io.open("output.log", "w")
|
|
||||||
|
|
||||||
-- Return the callstack index of the code that actually caused an error and the max index
|
-- Return the callstack index of the code that actually caused an error and the max index
|
||||||
callstack_range = ->
|
callstack_range = ->
|
||||||
@ -88,7 +87,6 @@ class Pad
|
|||||||
table.insert(@colors, color_fn)
|
table.insert(@colors, color_fn)
|
||||||
|
|
||||||
@configure_size height, width
|
@configure_size height, width
|
||||||
log\write("New pad: #{@height},#{@width} #{@_height},#{@_width}\n")
|
|
||||||
@_frame = C.newwin(@height, @width, @y, @x)
|
@_frame = C.newwin(@height, @width, @y, @x)
|
||||||
@_frame\immedok(true)
|
@_frame\immedok(true)
|
||||||
@_pad = C.newpad(@_height, @_width)
|
@_pad = C.newpad(@_height, @_width)
|
||||||
@ -241,7 +239,6 @@ err_hand = (err)->
|
|||||||
|
|
||||||
ldb = {
|
ldb = {
|
||||||
run_debugger: (err_msg)->
|
run_debugger: (err_msg)->
|
||||||
export stdscr, SCREEN_H, SCREEN_W
|
|
||||||
stdscr = C.initscr!
|
stdscr = C.initscr!
|
||||||
SCREEN_H, SCREEN_W = stdscr\getmaxyx!
|
SCREEN_H, SCREEN_W = stdscr\getmaxyx!
|
||||||
|
|
||||||
@ -517,9 +514,11 @@ ldb = {
|
|||||||
for _,pad in pairs(pads) do pad\refresh!
|
for _,pad in pairs(pads) do pad\refresh!
|
||||||
|
|
||||||
when C.KEY_RESIZE
|
when C.KEY_RESIZE
|
||||||
|
SCREEN_H, SCREEN_W = stdscr\getmaxyx!
|
||||||
stdscr\clear!
|
stdscr\clear!
|
||||||
stdscr\refresh!
|
stdscr\refresh!
|
||||||
for _,pad in pairs(pads) do pad\refresh!
|
for _,pad in pairs(pads) do pad\refresh(true)
|
||||||
|
C.doupdate!
|
||||||
|
|
||||||
when ('q')\byte!, ("Q")\byte!
|
when ('q')\byte!, ("Q")\byte!
|
||||||
pads = {}
|
pads = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user