Skip to content

Commit 68823b2

Browse files
committed
Improve window data handling
1 parent 034ca38 commit 68823b2

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/debug/local.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,17 +231,18 @@ def puts line = ""
231231
end
232232

233233
def draw(data)
234-
data = data[name] || "No content"
234+
window_data = data[name]
235+
return unless window_data
235236

236-
case data
237+
case window_data
237238
when String
238-
puts(data)
239+
puts(window_data)
239240
when Array
240-
data.each do |d|
241+
window_data.each do |d|
241242
puts(d)
242243
end
243244
else
244-
raise "unsupported top frame data type: #{data.class} (#{data})"
245+
raise "unsupported window data type for window [#{name}]: #{data.class} (#{data})"
245246
end
246247
end
247248

lib/debug/thread_client.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,9 @@ def << req
190190
def generate_tui_data(metadata)
191191
metadata.each_with_object({}) do |(tui_name, options), result|
192192
tui_method = "generate_tui_#{tui_name}"
193+
193194
if respond_to?(tui_method)
194195
result[tui_name] = send(tui_method, options)
195-
else
196-
result[tui_name] = []
197196
end
198197
end
199198
end

0 commit comments

Comments
 (0)