Aerilius / sketchup-console-plus

A better Ruby Console and IDE for integrated development in SketchUp.
MIT License
42 stars 17 forks source link

Repeated output no longer displayed after console clear #20

Closed MichaelSchardt closed 7 years ago

MichaelSchardt commented 7 years ago

Instead of displaying consecutive identical output lines multiple times (in a new line each), RubyConsole+ diplays a count number on the righthand side, saving space. If the console is cleared, repeated output is not displayed anymore.

Demonstration-tool outputting text on mousemove:

class RepeatedOutput
  def onMouseMove(flags, x, y, view)
    puts "repeating myself..."
  end
end

activate the tool with: Sketchup.active_model.select_tool(RepeatedOutput.new)

Now, with the mouse cursor over the SketchUp window, the output counter for "repeating myself..." in the console goes up with each movement. After pressing the clear button in the console window, nothing is displayed anymore - even though the tool is still active.

Without looking into the sources, i guess the last output is cached internally. If the next output line happens to be exactly the same, it's not displayed but the counter is increased instead. Clearing the cache and counter together with the console should then fix the issue.

Aerilius commented 7 years ago

Thanks for reporting!