show source better

still wip
This commit is contained in:
Torsten Ruger 2018-04-06 13:03:39 +03:00
parent 4c342d064d
commit 509aff9552
4 changed files with 11 additions and 10 deletions

View File

@ -25,7 +25,7 @@ class DebugServer < Opal::Server
end
end
run Opal::Server.new { |s|
run Opal::Sprockets::Server.new { |s|
s.main = 'debugger.js.rb'
s.append_path 'lib'
s.append_path 'assets'

View File

@ -36,7 +36,8 @@ class InstructionView < ListView
def instruction_text
return "" unless @interpreter.instruction
@interpreter.instruction.to_s
text = @interpreter.instruction.to_s
text.split("(").first
end
end

View File

@ -45,7 +45,7 @@ class ObjectView < ListView
end
def content_elements
fields = [ConstantView.new("li" , "----------------------------------")]
fields = [ConstantView.new("li" , "---------------------------------")]
object = @object
if object and ! object.is_a?(String)
object.get_instance_variables.each do |variable|

View File

@ -20,13 +20,13 @@ class SourceView < ElementView
update_method
case i.source
when Mom::Instruction
id = i.source.object_id.to_s(16)
if e = @text.at_css("#i#{id}")
if (old = @text.at_css(".fade_in"))
old.remove_class("fade_in")
end
e.add_class "fade_in"
end
@ticker.text = i.source.class.name
# if e = @text.at_css("#i#{id}")
# if (old = @text.at_css(".fade_in"))
# old.remove_class("fade_in")
# end
# e.add_class "fade_in"
# end
when String
@ticker.text = i.source
when Risc::Instruction