summary refs log tree commit diff stats
path: root/doc/pydoc/ranger.fsobject.directory.html
blob: ee87c5bb17b56c53dae631a3813c25f2d00ad9da (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module ranger.fsobject.directory</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="ranger.html"><font color="#ffffff">ranger</font></a>.<a href="ranger.fsobject.html"><font color="#ffffff">fsobject</font></a>.directory</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/hut/work/ranger/ranger/fsobject/directory.py">/home/hut/work/ranger/ranger/fsobject/directory.py</a></font></td></tr></table>
    <p></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="ranger.html">ranger</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="builtins.html#Exception">builtins.Exception</a>(<a href="builtins.html#BaseException">builtins.BaseException</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="ranger.fsobject.directory.html#NoDirectoryGiven">NoDirectoryGiven</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="ranger.ext.accumulator.html#Accumulator">ranger.ext.accumulator.Accumulator</a>(<a href="builtins.html#object">builtins.object</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="ranger.fsobject.directory.html#Directory">Directory</a>(<a href="ranger.fsobject.fsobject.html#FileSystemObject">ranger.fsobject.fsobject.FileSystemObject</a>, <a href="ranger.ext.accumulator.html#Accumulator">ranger.ext.accumulator.Accumulator</a>, <a href="ranger.shared.settings.html#SettingsAware">ranger.shared.settings.SettingsAware</a>)
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="ranger.fsobject.fsobject.html#FileSystemObject">ranger.fsobject.fsobject.FileSystemObject</a>(<a href="ranger.shared.mimetype.html#MimeTypeAware">ranger.shared.mimetype.MimeTypeAware</a>, <a href="ranger.shared.html#FileManagerAware">ranger.shared.FileManagerAware</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="ranger.fsobject.directory.html#Directory">Directory</a>(<a href="ranger.fsobject.fsobject.html#FileSystemObject">ranger.fsobject.fsobject.FileSystemObject</a>, <a href="ranger.ext.accumulator.html#Accumulator">ranger.ext.accumulator.Accumulator</a>, <a href="ranger.shared.settings.html#SettingsAware">ranger.shared.settings.SettingsAware</a>)
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="ranger.shared.settings.html#SettingsAware">ranger.shared.settings.SettingsAware</a>(<a href="builtins.html#object">builtins.object</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="ranger.fsobject.directory.html#Directory">Directory</a>(<a href="ranger.fsobject.fsobject.html#FileSystemObject">ranger.fsobject.fsobject.FileSystemObject</a>, <a href="ranger.ext.accumulator.html#Accumulator">ranger.ext.accumulator.Accumulator</a>, <a href="ranger.shared.settings.html#SettingsAware">ranger.shared.settings.SettingsAware</a>)
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Directory">class <strong>Directory</strong></a>(<a href="ranger.fsobject.fsobject.html#FileSystemObject">ranger.fsobject.fsobject.FileSystemObject</a>, <a href="ranger.ext.accumulator.html#Accumulator">ranger.ext.accumulator.Accumulator</a>, <a href="ranger.shared.settings.html#SettingsAware">ranger.shared.settings.SettingsAware</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="ranger.fsobject.directory.html#Directory">Directory</a></dd>
<dd><a href="ranger.fsobject.fsobject.html#FileSystemObject">ranger.fsobject.fsobject.FileSystemObject</a></dd>
<dd><a href="ranger.shared.mimetype.html#MimeTypeAware">ranger.shared.mimetype.MimeTypeAware</a></dd>
<dd><a href="ranger.shared.html#FileManagerAware">ranger.shared.FileManagerAware</a></dd>
<dd><a href="ranger.shared.html#Awareness">ranger.shared.Awareness</a></dd>
<dd><a href="ranger.ext.accumulator.html#Accumulator">ranger.ext.accumulator.Accumulator</a></dd>
<dd><a href="ranger.shared.settings.html#SettingsAware">ranger.shared.settings.SettingsAware</a></dd>
<dd><a href="builtins.html#object">builtins.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="Directory-__eq__"><strong>__eq__</strong></a>(self, other)</dt><dd><tt>Check&nbsp;for&nbsp;equality&nbsp;of&nbsp;the&nbsp;directories&nbsp;paths</tt></dd></dl>

<dl><dt><a name="Directory-__getitem__"><strong>__getitem__</strong></a>(self, key)</dt><dd><tt>Get&nbsp;the&nbsp;file&nbsp;by&nbsp;its&nbsp;index</tt></dd></dl>

<dl><dt><a name="Directory-__hash__"><strong>__hash__</strong></a>(self)</dt></dl>

<dl><dt><a name="Directory-__init__"><strong>__init__</strong></a>(self, path)</dt></dl>

<dl><dt><a name="Directory-__len__"><strong>__len__</strong></a>(self)</dt><dd><tt>The&nbsp;number&nbsp;of&nbsp;containing&nbsp;files</tt></dd></dl>

<dl><dt><a name="Directory-__neq__"><strong>__neq__</strong></a>(self, other)</dt><dd><tt>Check&nbsp;for&nbsp;inequality&nbsp;of&nbsp;the&nbsp;directories&nbsp;paths</tt></dd></dl>

<dl><dt><a name="Directory-__nonzero__"><strong>__nonzero__</strong></a>(self)</dt><dd><tt>Always&nbsp;True</tt></dd></dl>

<dl><dt><a name="Directory-correct_pointer"><strong>correct_pointer</strong></a>(self)</dt><dd><tt>Make&nbsp;sure&nbsp;the&nbsp;pointer&nbsp;is&nbsp;in&nbsp;the&nbsp;valid&nbsp;range</tt></dd></dl>

<dl><dt><a name="Directory-empty"><strong>empty</strong></a>(self)</dt><dd><tt>Is&nbsp;the&nbsp;directory&nbsp;empty?</tt></dd></dl>

<dl><dt><a name="Directory-get_list"><strong>get_list</strong></a>(self)</dt></dl>

<dl><dt><a name="Directory-get_selection"><strong>get_selection</strong></a>(self)</dt><dd><tt>READ&nbsp;ONLY</tt></dd></dl>

<dl><dt><a name="Directory-load_bit_by_bit"><strong>load_bit_by_bit</strong></a>(self)</dt><dd><tt>Returns&nbsp;a&nbsp;generator&nbsp;which&nbsp;load&nbsp;a&nbsp;part&nbsp;of&nbsp;the&nbsp;directory<br>
in&nbsp;each&nbsp;iteration.</tt></dd></dl>

<dl><dt><a name="Directory-load_content"><strong>load_content</strong></a>(self, schedule<font color="#909090">=None</font>)</dt><dd><tt>Loads&nbsp;the&nbsp;contents&nbsp;of&nbsp;the&nbsp;directory.&nbsp;Use&nbsp;this&nbsp;sparingly&nbsp;since<br>
it&nbsp;takes&nbsp;rather&nbsp;long.</tt></dd></dl>

<dl><dt><a name="Directory-load_content_if_outdated"><strong>load_content_if_outdated</strong></a>(self, *a, **k)</dt><dd><tt>Load&nbsp;the&nbsp;contents&nbsp;of&nbsp;the&nbsp;directory&nbsp;if&nbsp;it's<br>
outdated&nbsp;or&nbsp;not&nbsp;done&nbsp;yet</tt></dd></dl>

<dl><dt><a name="Directory-load_content_once"><strong>load_content_once</strong></a>(self, *a, **k)</dt><dd><tt>Load&nbsp;the&nbsp;contents&nbsp;of&nbsp;the&nbsp;directory&nbsp;if&nbsp;not&nbsp;done&nbsp;yet</tt></dd></dl>

<dl><dt><a name="Directory-mark_all"><strong>mark_all</strong></a>(self, val)</dt></dl>

<dl><dt><a name="Directory-mark_item"><strong>mark_item</strong></a>(self, item, val)</dt></dl>

<dl><dt><a name="Directory-move_to_obj"><strong>move_to_obj</strong></a>(self, arg)</dt></dl>

<dl><dt><a name="Directory-search"><strong>search</strong></a>(self, arg, direction<font color="#909090">=1</font>)</dt><dd><tt>Search&nbsp;for&nbsp;a&nbsp;regular&nbsp;expression</tt></dd></dl>

<dl><dt><a name="Directory-sort"><strong>sort</strong></a>(self)</dt><dd><tt>Sort&nbsp;the&nbsp;containing&nbsp;files</tt></dd></dl>

<dl><dt><a name="Directory-sort_if_outdated"><strong>sort_if_outdated</strong></a>(self)</dt><dd><tt>Sort&nbsp;the&nbsp;containing&nbsp;files&nbsp;if&nbsp;they&nbsp;are&nbsp;outdated</tt></dd></dl>

<dl><dt><a name="Directory-toggle_all_marks"><strong>toggle_all_marks</strong></a>(self)</dt></dl>

<dl><dt><a name="Directory-toggle_mark"><strong>toggle_mark</strong></a>(self, item)</dt></dl>

<dl><dt><a name="Directory-unload"><strong>unload</strong></a>(self)</dt></dl>

<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>enterable</strong> = False</dl>

<dl><dt><strong>filenames</strong> = None</dl>

<dl><dt><strong>files</strong> = None</dl>

<dl><dt><strong>filter</strong> = None</dl>

<dl><dt><strong>load_generator</strong> = None</dl>

<dl><dt><strong>loading</strong> = False</dl>

<dl><dt><strong>marked_items</strong> = None</dl>

<dl><dt><strong>old_directories_first</strong> = None</dl>

<dl><dt><strong>old_reverse</strong> = None</dl>

<dl><dt><strong>old_show_hidden</strong> = None</dl>

<dl><dt><strong>old_sort</strong> = None</dl>

<dl><dt><strong>scroll_begin</strong> = 0</dl>

<dl><dt><strong>scroll_offset</strong> = 0</dl>

<dl><dt><strong>sort_dict</strong> = {'basename': &lt;function sort_by_basename at 0x154a408&gt;, 'mtime': &lt;function &lt;lambda&gt; at 0x1569518&gt;, 'size': &lt;function &lt;lambda&gt; at 0x1569490&gt;, 'type': &lt;function &lt;lambda&gt; at 0x15695a0&gt;}</dl>

<hr>
Methods inherited from <a href="ranger.fsobject.fsobject.html#FileSystemObject">ranger.fsobject.fsobject.FileSystemObject</a>:<br>
<dl><dt><a name="Directory-__str__"><strong>__str__</strong></a>(self)</dt><dd><tt>returns&nbsp;a&nbsp;string&nbsp;containing&nbsp;the&nbsp;absolute&nbsp;path</tt></dd></dl>

<dl><dt><a name="Directory-get_description"><strong>get_description</strong></a>(self)</dt></dl>

<dl><dt><a name="Directory-get_permission_string"><strong>get_permission_string</strong></a>(self)</dt></dl>

<dl><dt><a name="Directory-go"><strong>go</strong></a>(self)</dt><dd><tt>enter&nbsp;the&nbsp;directory&nbsp;if&nbsp;the&nbsp;filemanager&nbsp;is&nbsp;running</tt></dd></dl>

<dl><dt><a name="Directory-is_older_than"><strong>is_older_than</strong></a>(self, seconds)</dt><dd><tt>returns&nbsp;whether&nbsp;this&nbsp;object&nbsp;wasn't&nbsp;<a href="#Directory-use">use</a>()d&nbsp;in&nbsp;the&nbsp;last&nbsp;n&nbsp;seconds</tt></dd></dl>

<dl><dt><a name="Directory-load"><strong>load</strong></a>(self)</dt><dd><tt>reads&nbsp;useful&nbsp;information&nbsp;about&nbsp;the&nbsp;filesystem-object&nbsp;from&nbsp;the<br>
filesystem&nbsp;and&nbsp;caches&nbsp;it&nbsp;for&nbsp;later&nbsp;use</tt></dd></dl>

<dl><dt><a name="Directory-load_if_outdated"><strong>load_if_outdated</strong></a>(self)</dt><dd><tt>Calls&nbsp;<a href="#Directory-load">load</a>()&nbsp;if&nbsp;the&nbsp;currently&nbsp;cached&nbsp;information&nbsp;is&nbsp;outdated<br>
or&nbsp;nonexistant.</tt></dd></dl>

<dl><dt><a name="Directory-load_once"><strong>load_once</strong></a>(self)</dt><dd><tt>calls&nbsp;<a href="#Directory-load">load</a>()&nbsp;if&nbsp;it&nbsp;has&nbsp;not&nbsp;been&nbsp;called&nbsp;at&nbsp;least&nbsp;once&nbsp;yet</tt></dd></dl>

<dl><dt><a name="Directory-mark"><strong>mark</strong></a>(self, boolean)</dt></dl>

<dl><dt><a name="Directory-set_mimetype"><strong>set_mimetype</strong></a>(self)</dt><dd><tt>assign&nbsp;attributes&nbsp;such&nbsp;as&nbsp;self.<strong>video</strong>&nbsp;according&nbsp;to&nbsp;the&nbsp;mimetype</tt></dd></dl>

<dl><dt><a name="Directory-use"><strong>use</strong></a>(self)</dt><dd><tt>mark&nbsp;the&nbsp;filesystem-object&nbsp;as&nbsp;used&nbsp;at&nbsp;the&nbsp;current&nbsp;time</tt></dd></dl>

<hr>
Data and other attributes inherited from <a href="ranger.fsobject.fsobject.html#FileSystemObject">ranger.fsobject.fsobject.FileSystemObject</a>:<br>
<dl><dt><strong>accessible</strong> = False</dl>

<dl><dt><strong>audio</strong> = False</dl>

<dl><dt><strong>basename</strong> = None</dl>

<dl><dt><strong>basename_lower</strong> = None</dl>

<dl><dt><strong>container</strong> = False</dl>

<dl><dt><strong>content_loaded</strong> = False</dl>

<dl><dt><strong>dirname</strong> = None</dl>

<dl><dt><strong>document</strong> = False</dl>

<dl><dt><strong>exists</strong> = False</dl>

<dl><dt><strong>extension</strong> = None</dl>

<dl><dt><strong>force_load</strong> = False</dl>

<dl><dt><strong>image</strong> = False</dl>

<dl><dt><strong>infostring</strong> = None</dl>

<dl><dt><strong>islink</strong> = False</dl>

<dl><dt><strong>last_used</strong> = None</dl>

<dl><dt><strong>loaded</strong> = False</dl>

<dl><dt><strong>marked</strong> = False</dl>

<dl><dt><strong>media</strong> = False</dl>

<dl><dt><strong>mimetype_tuple</strong> = ()</dl>

<dl><dt><strong>path</strong> = None</dl>

<dl><dt><strong>permissions</strong> = None</dl>

<dl><dt><strong>readlink</strong> = None</dl>

<dl><dt><strong>runnable</strong> = False</dl>

<dl><dt><strong>size</strong> = 0</dl>

<dl><dt><strong>stat</strong> = None</dl>

<dl><dt><strong>stopped</strong> = False</dl>

<dl><dt><strong>tagged</strong> = False</dl>

<dl><dt><strong>type</strong> = 'unknown'</dl>

<dl><dt><strong>video</strong> = False</dl>

<hr>
Data descriptors inherited from <a href="ranger.shared.mimetype.html#MimeTypeAware">ranger.shared.mimetype.MimeTypeAware</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<hr>
Data and other attributes inherited from <a href="ranger.shared.mimetype.html#MimeTypeAware">ranger.shared.mimetype.MimeTypeAware</a>:<br>
<dl><dt><strong>mimetypes</strong> = {}</dl>

<hr>
Data and other attributes inherited from <a href="ranger.shared.html#FileManagerAware">ranger.shared.FileManagerAware</a>:<br>
<dl><dt><strong>fm</strong> = None</dl>

<hr>
Methods inherited from <a href="ranger.ext.accumulator.html#Accumulator">ranger.ext.accumulator.Accumulator</a>:<br>
<dl><dt><a name="Directory-move"><strong>move</strong></a>(self, relative<font color="#909090">=0</font>, absolute<font color="#909090">=None</font>)</dt></dl>

<dl><dt><a name="Directory-pointer_is_synced"><strong>pointer_is_synced</strong></a>(self)</dt></dl>

<dl><dt><a name="Directory-sync_index"><strong>sync_index</strong></a>(self, **kw)</dt></dl>

<hr>
Data and other attributes inherited from <a href="ranger.shared.settings.html#SettingsAware">ranger.shared.settings.SettingsAware</a>:<br>
<dl><dt><strong>settings</strong> = &lt;ranger.ext.openstruct.OpenStruct object at 0x154e450&gt;</dl>

</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="NoDirectoryGiven">class <strong>NoDirectoryGiven</strong></a>(<a href="builtins.html#Exception">builtins.Exception</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="ranger.fsobject.directory.html#NoDirectoryGiven">NoDirectoryGiven</a></dd>
<dd><a href="builtins.html#Exception">builtins.Exception</a></dd>
<dd><a href="builtins.html#BaseException">builtins.BaseException</a></dd>
<dd><a href="builtins.html#object">builtins.object</a></dd>
</dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<hr>
Methods inherited from <a href="builtins.html#Exception">builtins.Exception</a>:<br>
<dl><dt><a name="NoDirectoryGiven-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#NoDirectoryGiven-__init__">__init__</a>(...)&nbsp;initializes&nbsp;x;&nbsp;see&nbsp;x.__class__.__doc__&nbsp;for&nbsp;signature</tt></dd></dl>

<hr>
Data and other attributes inherited from <a href="builtins.html#Exception">builtins.Exception</a>:<br>
<dl><dt><strong>__new__</strong> = &lt;built-in method __new__ of type object at 0x7f327d94a120&gt;<dd><tt>T.<a href="#NoDirectoryGiven-__new__">__new__</a>(S,&nbsp;...)&nbsp;-&gt;&nbsp;a&nbsp;new&nbsp;object&nbsp;with&nbsp;type&nbsp;S,&nbsp;a&nbsp;subtype&nbsp;of&nbsp;T</tt></dl>

<hr>
Methods inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br>
<dl><dt><a name="NoDirectoryGiven-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#NoDirectoryGiven-__delattr__">__delattr__</a>('name')&nbsp;&lt;==&gt;&nbsp;del&nbsp;x.name</tt></dd></dl>

<dl><dt><a name="NoDirectoryGiven-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#NoDirectoryGiven-__getattribute__">__getattribute__</a>('name')&nbsp;&lt;==&gt;&nbsp;x.name</tt></dd></dl>

<dl><dt><a name="NoDirectoryGiven-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>

<dl><dt><a name="NoDirectoryGiven-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#NoDirectoryGiven-__repr__">__repr__</a>()&nbsp;&lt;==&gt;&nbsp;repr(x)</tt></dd></dl>

<dl><dt><a name="NoDirectoryGiven-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#NoDirectoryGiven-__setattr__">__setattr__</a>('name',&nbsp;value)&nbsp;&lt;==&gt;&nbsp;x.name&nbsp;=&nbsp;value</tt></dd></dl>

<dl><dt><a name="NoDirectoryGiven-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>

<dl><dt><a name="NoDirectoryGiven-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#NoDirectoryGiven-__str__">__str__</a>()&nbsp;&lt;==&gt;&nbsp;str(x)</tt></dd></dl>

<dl><dt><a name="NoDirectoryGiven-with_traceback"><strong>with_traceback</strong></a>(...)</dt><dd><tt><a href="builtins.html#Exception">Exception</a>.<a href="#NoDirectoryGiven-with_traceback">with_traceback</a>(tb)&nbsp;--<br>
set&nbsp;self.<strong>__traceback__</strong>&nbsp;to&nbsp;tb&nbsp;and&nbsp;return&nbsp;self.</tt></dd></dl>

<hr>
Data descriptors inherited from <a href="builtins.html#BaseException">builtins.BaseException</a>:<br>
<dl><dt><strong>__cause__</strong></dt>
<dd><tt>exception&nbsp;cause</tt></dd>
</dl>
<dl><dt><strong>__context__</strong></dt>
<dd><tt>exception&nbsp;context</tt></dd>
</dl>
<dl><dt><strong>__dict__</strong></dt>
</dl>
<dl><dt><strong>__traceback__</strong></dt>
</dl>
<dl><dt><strong>args</strong></dt>
</dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
    
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-sort_by_basename"><strong>sort_by_basename</strong></a>(path)</dt><dd><tt>returns&nbsp;path.basename&nbsp;(for&nbsp;sorting)</tt></dd></dl>
 <dl><dt><a name="-sort_by_directory"><strong>sort_by_directory</strong></a>(path)</dt><dd><tt>returns&nbsp;0&nbsp;if&nbsp;path&nbsp;is&nbsp;a&nbsp;directory,&nbsp;otherwise&nbsp;1&nbsp;(for&nbsp;sorting)</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>BAD_INFO</strong> = None</td></tr></table>
</body></html>
v">curr/ecx: (addr trace-line) <- index candidates, curr-offset var match?/eax: boolean <- trace-lines-equal? curr, _line compare match?, 0/false break-if-= var line/eax: (addr trace-line) <- copy _line var dest/eax: (addr boolean) <- get line, visible? copy-to *dest, 1/true return 1/true } i <- increment loop } var line/eax: (addr trace-line) <- copy _line var dest/eax: (addr boolean) <- get line, visible? copy-to *dest, 0/false return 0/false } # this is probably super-inefficient, string comparing every trace line # against every visible line on every render fn trace-lines-equal? _a: (addr trace-line), _b: (addr trace-line) -> _/eax: boolean { var a/esi: (addr trace-line) <- copy _a var b/edi: (addr trace-line) <- copy _b var a-depth/ecx: (addr int) <- get a, depth var b-depth/edx: (addr int) <- get b, depth var benchmark/eax: int <- copy *b-depth compare *a-depth, benchmark { break-if-= return 0/false } var a-label-ah/eax: (addr handle array byte) <- get a, label var _a-label/eax: (addr array byte) <- lookup *a-label-ah var a-label/ecx: (addr array byte) <- copy _a-label var b-label-ah/ebx: (addr handle array byte) <- get b, label var b-label/eax: (addr array byte) <- lookup *b-label-ah var label-match?/eax: boolean <- string-equal? a-label, b-label { compare label-match?, 0/false break-if-!= return 0/false } var a-data-ah/eax: (addr handle array byte) <- get a, data var _a-data/eax: (addr array byte) <- lookup *a-data-ah var a-data/ecx: (addr array byte) <- copy _a-data var b-data-ah/ebx: (addr handle array byte) <- get b, data var b-data/eax: (addr array byte) <- lookup *b-data-ah var data-match?/eax: boolean <- string-equal? a-data, b-data return data-match? } fn clamp-cursor-to-top _self: (addr trace), _y: int { var y/ecx: int <- copy _y var self/esi: (addr trace) <- copy _self var cursor-y/eax: (addr int) <- get self, cursor-y compare *cursor-y, y break-if->= copy-to *cursor-y, y } # extremely hacky; consider deleting test-render-trace-empty-3 when you clean this up fn clamp-cursor-to-bottom _self: (addr trace), _y: int, screen: (addr screen), xmin: int, ymin: int, xmax: int, ymax: int { var y/ebx: int <- copy _y compare y, ymin { break-if-> return } y <- decrement var self/esi: (addr trace) <- copy _self var cursor-y/eax: (addr int) <- get self, cursor-y compare *cursor-y, y break-if-<= copy-to *cursor-y, y # redraw cursor-line # TODO: ugly duplication var trace-ah/eax: (addr handle array trace-line) <- get self, data var trace/eax: (addr array trace-line) <- lookup *trace-ah var cursor-line-index-addr/ecx: (addr int) <- get self, cursor-line-index var cursor-line-index/ecx: int <- copy *cursor-line-index-addr var first-free/edx: (addr int) <- get self, first-free compare cursor-line-index, *first-free { break-if-< return } var cursor-offset/ecx: (offset trace-line) <- compute-offset trace, cursor-line-index var cursor-line/ecx: (addr trace-line) <- index trace, cursor-offset var display?/eax: boolean <- should-render? self, cursor-line { compare display?, 0/false break-if-= var dummy/ecx: int <- render-trace-line screen, cursor-line, xmin, y, xmax, ymax, 9/fg=blue, 7/cursor-line-bg return } var dummy1/eax: int <- copy 0 var dummy2/ecx: int <- copy 0 dummy1, dummy2 <- draw-text-wrapping-right-then-down screen, "...", xmin, ymin, xmax, ymax, xmin, y, 9/fg=trace, 7/cursor-line-bg } fn test-render-trace-empty { var t-storage: trace var t/esi: (addr trace) <- address t-storage initialize-trace t, 0x10, 0x10 # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack initialize-screen screen, 5/width, 4/height # var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 5/xmax, 4/ymax, 0/no-cursor # check-ints-equal y, 0, "F - test-render-trace-empty/cursor" check-screen-row screen, 0/y, " ", "F - test-render-trace-empty" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-render-trace-empty/bg" } fn test-render-trace-empty-2 { var t-storage: trace var t/esi: (addr trace) <- address t-storage initialize-trace t, 0x10, 0x10 # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack initialize-screen screen, 5/width, 4/height # var y/ecx: int <- render-trace screen, t, 0/xmin, 2/ymin, 5/xmax, 4/ymax, 0/no-cursor # cursor below top row # check-ints-equal y, 2, "F - test-render-trace-empty-2/cursor" check-screen-row screen, 2/y, " ", "F - test-render-trace-empty-2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-render-trace-empty-2/bg" } fn test-render-trace-empty-3 { var t-storage: trace var t/esi: (addr trace) <- address t-storage initialize-trace t, 0x10, 0x10 # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack initialize-screen screen, 5/width, 4/height # var y/ecx: int <- render-trace screen, t, 0/xmin, 2/ymin, 5/xmax, 4/ymax, 1/show-cursor # try show cursor # still no cursor to show check-ints-equal y, 2, "F - test-render-trace-empty-3/cursor" check-screen-row screen, 1/y, " ", "F - test-render-trace-empty-3/line-above-cursor" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-render-trace-empty-3/bg-for-line-above-cursor" check-screen-row screen, 2/y, " ", "F - test-render-trace-empty-3" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-render-trace-empty-3/bg" } fn test-render-trace-collapsed-by-default { var t-storage: trace var t/esi: (addr trace) <- address t-storage initialize-trace t, 0x10, 0x10 trace-text t, "l", "data" # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack initialize-screen screen, 5/width, 4/height # var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 5/xmax, 4/ymax, 0/no-cursor # check-ints-equal y, 1, "F - test-render-trace-collapsed-by-default/cursor" check-screen-row screen, 0/y, "... ", "F - test-render-trace-collapsed-by-default" } fn test-render-trace-error { var t-storage: trace var t/esi: (addr trace) <- address t-storage initialize-trace t, 0x10, 0x10 error t, "error" # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack initialize-screen screen, 0xa/width, 4/height # var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 0/no-cursor # check-ints-equal y, 1, "F - test-render-trace-error/cursor" check-screen-row screen, 0/y, "error", "F - test-render-trace-error" } fn test-render-trace-error-at-start { var t-storage: trace var t/esi: (addr trace) <- address t-storage initialize-trace t, 0x10, 0x10 # error t, "error" trace-text t, "l", "data" # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack initialize-screen screen, 0xa/width, 4/height # var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 0/no-cursor # check-ints-equal y, 2, "F - test-render-trace-error-at-start/cursor" check-screen-row screen, 0/y, "error", "F - test-render-trace-error-at-start/0" check-screen-row screen, 1/y, "... ", "F - test-render-trace-error-at-start/1" } fn test-render-trace-error-at-end { var t-storage: trace var t/esi: (addr trace) <- address t-storage initialize-trace t, 0x10, 0x10 # trace-text t, "l", "data" error t, "error" # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack initialize-screen screen, 0xa/width, 4/height # var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 0/no-cursor # check-ints-equal y, 2, "F - test-render-trace-error-at-end/cursor" check-screen-row screen, 0/y, "... ", "F - test-render-trace-error-at-end/0" check-screen-row screen, 1/y, "error", "F - test-render-trace-error-at-end/1" } fn test-render-trace-error-in-the-middle { var t-storage: trace var t/esi: (addr trace) <- address t-storage initialize-trace t, 0x10, 0x10 # trace-text t, "l", "line 1" error t, "error" trace-text t, "l", "line 3" # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack initialize-screen screen, 0xa/width, 4/height # var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 0/no-cursor # check-ints-equal y, 3, "F - test-render-trace-error-in-the-middle/cursor" check-screen-row screen, 0/y, "... ", "F - test-render-trace-error-in-the-middle/0" check-screen-row screen, 1/y, "error", "F - test-render-trace-error-in-the-middle/1" check-screen-row screen, 2/y, "... ", "F - test-render-trace-error-in-the-middle/2" } fn test-render-trace-cursor-in-single-line { var t-storage: trace var t/esi: (addr trace) <- address t-storage initialize-trace t, 0x10, 0x10 # trace-text t, "l", "line 1" error t, "error" trace-text t, "l", "line 3" # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack initialize-screen screen, 0xa/width, 4/height # var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "... ", "F - test-render-trace-cursor-in-single-line/0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-render-trace-cursor-in-single-line/0/cursor" check-screen-row screen, 1/y, "error ", "F - test-render-trace-cursor-in-single-line/1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-render-trace-cursor-in-single-line/1/cursor" check-screen-row screen, 2/y, "... ", "F - test-render-trace-cursor-in-single-line/2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-render-trace-cursor-in-single-line/2/cursor" } fn render-trace-menu screen: (addr screen) { var width/eax: int <- copy 0 var height/ecx: int <- copy 0 width, height <- screen-size screen var y/ecx: int <- copy height y <- decrement set-cursor-position screen, 0/x, y draw-text-rightward-from-cursor screen, " ctrl-s ", width, 0/fg, 7/bg=grey draw-text-rightward-from-cursor screen, " run sandbox ", width, 7/fg, 0/bg draw-text-rightward-from-cursor screen, " ctrl-d ", width, 0/fg, 7/bg=grey draw-text-rightward-from-cursor screen, " cursor down ", width, 7/fg, 0/bg draw-text-rightward-from-cursor screen, " ctrl-u ", width, 0/fg, 7/bg=grey draw-text-rightward-from-cursor screen, " cursor up ", width, 7/fg, 0/bg draw-text-rightward-from-cursor screen, " tab ", width, 0/fg, 3/bg=cyan draw-text-rightward-from-cursor screen, " move to sandbox ", width, 7/fg, 0/bg draw-text-rightward-from-cursor screen, " enter ", width, 0/fg, 7/bg=grey draw-text-rightward-from-cursor screen, " expand ", width, 7/fg, 0/bg draw-text-rightward-from-cursor screen, " backspace ", width, 0/fg, 7/bg=grey draw-text-rightward-from-cursor screen, " collapse ", width, 7/fg, 0/bg } fn edit-trace _self: (addr trace), key: grapheme { var self/esi: (addr trace) <- copy _self # cursor down { compare key, 4/ctrl-d break-if-!= var cursor-y/eax: (addr int) <- get self, cursor-y increment *cursor-y return } # cursor up { compare key, 0x15/ctrl-u break-if-!= var cursor-y/eax: (addr int) <- get self, cursor-y decrement *cursor-y return } # enter = expand { compare key, 0xa/newline break-if-!= expand self return } # backspace = collapse { compare key, 8/backspace break-if-!= collapse self return } } fn expand _self: (addr trace) { var self/esi: (addr trace) <- copy _self var trace-ah/eax: (addr handle array trace-line) <- get self, data var _trace/eax: (addr array trace-line) <- lookup *trace-ah var trace/edi: (addr array trace-line) <- copy _trace var cursor-line-index-addr/ecx: (addr int) <- get self, cursor-line-index var cursor-line-index/ecx: int <- copy *cursor-line-index-addr var cursor-line-offset/eax: (offset trace-line) <- compute-offset trace, cursor-line-index var cursor-line/edx: (addr trace-line) <- index trace, cursor-line-offset var cursor-line-visible?/eax: (addr boolean) <- get cursor-line, visible? var cursor-line-depth/ebx: (addr int) <- get cursor-line, depth var target-depth/ebx: int <- copy *cursor-line-depth # if cursor-line is already visible, increment target-depth compare *cursor-line-visible?, 0/false { break-if-= target-depth <- increment } # reveal the run of lines starting at cursor-line-index with depth target-depth var i/ecx: int <- copy cursor-line-index var max/edx: (addr int) <- get self, first-free { compare i, *max break-if->= var curr-line-offset/eax: (offset trace-line) <- compute-offset trace, i var curr-line/edx: (addr trace-line) <- index trace, curr-line-offset var curr-line-depth/eax: (addr int) <- get curr-line, depth compare *curr-line-depth, target-depth break-if-< { break-if-!= var curr-line-visible?/eax: (addr boolean) <- get curr-line, visible? copy-to *curr-line-visible?, 1/true reveal-trace-line self, curr-line } i <- increment loop } } fn collapse _self: (addr trace) { var self/esi: (addr trace) <- copy _self var trace-ah/eax: (addr handle array trace-line) <- get self, data var _trace/eax: (addr array trace-line) <- lookup *trace-ah var trace/edi: (addr array trace-line) <- copy _trace var cursor-line-index-addr/ecx: (addr int) <- get self, cursor-line-index var cursor-line-index/ecx: int <- copy *cursor-line-index-addr var cursor-line-offset/eax: (offset trace-line) <- compute-offset trace, cursor-line-index var cursor-line/edx: (addr trace-line) <- index trace, cursor-line-offset var cursor-line-visible?/eax: (addr boolean) <- get cursor-line, visible? # if cursor-line is not visible, do nothing compare *cursor-line-visible?, 0/false { break-if-!= return } # hide all lines between previous and next line with a lower depth var cursor-line-depth/ebx: (addr int) <- get cursor-line, depth var cursor-y/edx: (addr int) <- get self, cursor-y var target-depth/ebx: int <- copy *cursor-line-depth var i/ecx: int <- copy cursor-line-index { compare i, 0 break-if-< var curr-line-offset/eax: (offset trace-line) <- compute-offset trace, i var curr-line/eax: (addr trace-line) <- index trace, curr-line-offset # if cursor-line is visible, decrement cursor-y { var curr-line-visible?/eax: (addr boolean) <- get curr-line, visible? compare *curr-line-visible?, 0/false break-if-= decrement *cursor-y } var curr-line-depth/eax: (addr int) <- get curr-line, depth compare *curr-line-depth, target-depth break-if-< i <- decrement loop } i <- increment var max/edx: (addr int) <- get self, first-free { compare i, *max break-if->= var curr-line-offset/eax: (offset trace-line) <- compute-offset trace, i var curr-line/edx: (addr trace-line) <- index trace, curr-line-offset var curr-line-depth/eax: (addr int) <- get curr-line, depth compare *curr-line-depth, target-depth break-if-< { hide-trace-line self, curr-line var curr-line-visible?/eax: (addr boolean) <- get curr-line, visible? copy-to *curr-line-visible?, 0/false } i <- increment loop } } # the 'visible' array is not required to be in order # elements can also be deleted out of order # so it can have holes # however, lines in it always have visible? set # we'll use visible? being unset as a sign of emptiness fn reveal-trace-line _self: (addr trace), line: (addr trace-line) { var self/esi: (addr trace) <- copy _self var visible-ah/eax: (addr handle array trace-line) <- get self, visible var visible/eax: (addr array trace-line) <- lookup *visible-ah var i/ecx: int <- copy 0 var len/edx: int <- length visible { compare i, len break-if->= var curr-offset/edx: (offset trace-line) <- compute-offset visible, i var curr/edx: (addr trace-line) <- index visible, curr-offset var curr-visible?/eax: (addr boolean) <- get curr, visible? compare *curr-visible?, 0/false { break-if-!= # empty slot found copy-object line, curr return } i <- increment loop } abort "too many visible lines; increase size of array trace.visible" } fn hide-trace-line _self: (addr trace), line: (addr trace-line) { var self/esi: (addr trace) <- copy _self var visible-ah/eax: (addr handle array trace-line) <- get self, visible var visible/eax: (addr array trace-line) <- lookup *visible-ah var i/ecx: int <- copy 0 var len/edx: int <- length visible { compare i, len break-if->= var curr-offset/edx: (offset trace-line) <- compute-offset visible, i var curr/edx: (addr trace-line) <- index visible, curr-offset var found?/eax: boolean <- trace-lines-equal? curr, line compare found?, 0/false { break-if-= clear-object curr } i <- increment loop } } fn test-cursor-down-and-up-within-trace { var t-storage: trace var t/esi: (addr trace) <- address t-storage initialize-trace t, 0x10, 0x10 # trace-text t, "l", "line 1" error t, "error" trace-text t, "l", "line 3" # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack initialize-screen screen, 0xa/width, 4/height # var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "... ", "F - test-cursor-down-and-up-within-trace/pre-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-cursor-down-and-up-within-trace/pre-0/cursor" check-screen-row screen, 1/y, "error ", "F - test-cursor-down-and-up-within-trace/pre-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-cursor-down-and-up-within-trace/pre-1/cursor" check-screen-row screen, 2/y, "... ", "F - test-cursor-down-and-up-within-trace/pre-2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-cursor-down-and-up-within-trace/pre-2/cursor" # cursor down edit-trace t, 4/ctrl-d var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "... ", "F - test-cursor-down-and-up-within-trace/down-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-cursor-down-and-up-within-trace/down-0/cursor" check-screen-row screen, 1/y, "error ", "F - test-cursor-down-and-up-within-trace/down-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "||||| ", "F - test-cursor-down-and-up-within-trace/down-1/cursor" check-screen-row screen, 2/y, "... ", "F - test-cursor-down-and-up-within-trace/down-2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-cursor-down-and-up-within-trace/down-2/cursor" # cursor up edit-trace t, 0x15/ctrl-u var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "... ", "F - test-cursor-down-and-up-within-trace/up-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-cursor-down-and-up-within-trace/up-0/cursor" check-screen-row screen, 1/y, "error ", "F - test-cursor-down-and-up-within-trace/up-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-cursor-down-and-up-within-trace/up-1/cursor" check-screen-row screen, 2/y, "... ", "F - test-cursor-down-and-up-within-trace/up-2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-cursor-down-and-up-within-trace/up-2/cursor" } fn test-cursor-down-past-bottom-of-trace { var t-storage: trace var t/esi: (addr trace) <- address t-storage initialize-trace t, 0x10, 0x10 # trace-text t, "l", "line 1" error t, "error" trace-text t, "l", "line 3" # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack initialize-screen screen, 0xa/width, 4/height # var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "... ", "F - test-cursor-down-past-bottom-of-trace/pre-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-cursor-down-past-bottom-of-trace/pre-0/cursor" check-screen-row screen, 1/y, "error ", "F - test-cursor-down-past-bottom-of-trace/pre-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-cursor-down-past-bottom-of-trace/pre-1/cursor" check-screen-row screen, 2/y, "... ", "F - test-cursor-down-past-bottom-of-trace/pre-2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-cursor-down-past-bottom-of-trace/pre-2/cursor" # cursor down several times edit-trace t, 4/ctrl-d edit-trace t, 4/ctrl-d edit-trace t, 4/ctrl-d edit-trace t, 4/ctrl-d edit-trace t, 4/ctrl-d # hack: we do need to render to make this test pass; we're mixing state management with rendering var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0xa/xmax, 4/ymax, 1/show-cursor # cursor clamps at bottom check-screen-row screen, 0/y, "... ", "F - test-cursor-down-past-bottom-of-trace/down-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-cursor-down-past-bottom-of-trace/down-0/cursor" check-screen-row screen, 1/y, "error ", "F - test-cursor-down-past-bottom-of-trace/down-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-cursor-down-past-bottom-of-trace/down-1/cursor" check-screen-row screen, 2/y, "... ", "F - test-cursor-down-past-bottom-of-trace/down-2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "||| ", "F - test-cursor-down-past-bottom-of-trace/down-2/cursor" } fn test-expand-within-trace { var t-storage: trace var t/esi: (addr trace) <- address t-storage initialize-trace t, 0x10, 0x10 # trace-text t, "l", "line 1" trace-text t, "l", "line 2" # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack initialize-screen screen, 0x10/width, 4/height # var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "... ", "F - test-expand-within-trace/pre-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-expand-within-trace/pre-0/cursor" check-screen-row screen, 1/y, " ", "F - test-expand-within-trace/pre-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-expand-within-trace/pre-1/cursor" # expand edit-trace t, 0xa/enter var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "0 line 1 ", "F - test-expand-within-trace/expand-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-expand-within-trace/expand-0/cursor" check-screen-row screen, 1/y, "0 line 2 ", "F - test-expand-within-trace/expand-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-expand-within-trace/expand-1/cursor" check-screen-row screen, 2/y, " ", "F - test-expand-within-trace/expand-2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-expand-within-trace/expand-2/cursor" } fn test-trace-expand-skips-lower-depth { var t-storage: trace var t/esi: (addr trace) <- address t-storage initialize-trace t, 0x10, 0x10 # trace-text t, "l", "line 1" trace-lower t trace-text t, "l", "line 2" # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack initialize-screen screen, 0x10/width, 4/height # var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "... ", "F - test-trace-expand-skips-lower-depth/pre-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-expand-skips-lower-depth/pre-0/cursor" check-screen-row screen, 1/y, " ", "F - test-trace-expand-skips-lower-depth/pre-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-expand-skips-lower-depth/pre-1/cursor" # expand edit-trace t, 0xa/enter var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "0 line 1 ", "F - test-trace-expand-skips-lower-depth/expand-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-expand-skips-lower-depth/expand-0/cursor" check-screen-row screen, 1/y, "... ", "F - test-trace-expand-skips-lower-depth/expand-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-expand-skips-lower-depth/expand-1/cursor" check-screen-row screen, 2/y, " ", "F - test-trace-expand-skips-lower-depth/expand-2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-expand-skips-lower-depth/expand-2/cursor" } fn test-trace-expand-continues-past-lower-depth { var t-storage: trace var t/esi: (addr trace) <- address t-storage initialize-trace t, 0x10, 0x10 # trace-text t, "l", "line 1" trace-lower t trace-text t, "l", "line 1.1" trace-higher t trace-text t, "l", "line 2" # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack initialize-screen screen, 0x10/width, 4/height # var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "... ", "F - test-trace-expand-continues-past-lower-depth/pre-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-expand-continues-past-lower-depth/pre-0/cursor" check-screen-row screen, 1/y, " ", "F - test-trace-expand-continues-past-lower-depth/pre-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-expand-continues-past-lower-depth/pre-1/cursor" # expand edit-trace t, 0xa/enter var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "0 line 1 ", "F - test-trace-expand-continues-past-lower-depth/expand-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-expand-continues-past-lower-depth/expand-0/cursor" # TODO: might be too wasteful to show every place where lines are hidden check-screen-row screen, 1/y, "... ", "F - test-trace-expand-continues-past-lower-depth/expand-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-expand-continues-past-lower-depth/expand-1/cursor" check-screen-row screen, 2/y, "0 line 2 ", "F - test-trace-expand-continues-past-lower-depth/expand-2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-expand-continues-past-lower-depth/expand-2/cursor" } fn test-trace-expand-stops-at-higher-depth { var t-storage: trace var t/esi: (addr trace) <- address t-storage initialize-trace t, 0x10, 0x10 # trace-text t, "l", "line 1.1" trace-lower t trace-text t, "l", "line 1.1.1" trace-higher t trace-text t, "l", "line 1.2" trace-higher t trace-text t, "l", "line 2" trace-lower t trace-text t, "l", "line 2.1" # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack initialize-screen screen, 0x10/width, 8/height # var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 8/ymax, 1/show-cursor # check-screen-row screen, 0/y, "... ", "F - test-trace-expand-stops-at-higher-depth/pre-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-expand-stops-at-higher-depth/pre-0/cursor" check-screen-row screen, 1/y, " ", "F - test-trace-expand-stops-at-higher-depth/pre-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-expand-stops-at-higher-depth/pre-1/cursor" # expand edit-trace t, 0xa/enter var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 8/ymax, 1/show-cursor # check-screen-row screen, 0/y, "0 line 1.1 ", "F - test-trace-expand-stops-at-higher-depth/expand-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||||| ", "F - test-trace-expand-stops-at-higher-depth/expand-0/cursor" check-screen-row screen, 1/y, "... ", "F - test-trace-expand-stops-at-higher-depth/expand-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-expand-stops-at-higher-depth/expand-1/cursor" check-screen-row screen, 2/y, "0 line 1.2 ", "F - test-trace-expand-stops-at-higher-depth/expand-2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-expand-stops-at-higher-depth/expand-2/cursor" check-screen-row screen, 3/y, "... ", "F - test-trace-expand-stops-at-higher-depth/expand-3" check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-trace-expand-stops-at-higher-depth/expand-3/cursor" check-screen-row screen, 4/y, " ", "F - test-trace-expand-stops-at-higher-depth/expand-4" check-background-color-in-screen-row screen, 7/bg=cursor, 4/y, " ", "F - test-trace-expand-stops-at-higher-depth/expand-4/cursor" } fn test-trace-expand-twice { var t-storage: trace var t/esi: (addr trace) <- address t-storage initialize-trace t, 0x10, 0x10 # trace-text t, "l", "line 1" trace-lower t trace-text t, "l", "line 1.1" trace-higher t trace-text t, "l", "line 2" # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack initialize-screen screen, 0x10/width, 4/height # var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "... ", "F - test-trace-expand-twice/pre-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-expand-twice/pre-0/cursor" check-screen-row screen, 1/y, " ", "F - test-trace-expand-twice/pre-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-expand-twice/pre-1/cursor" # expand edit-trace t, 0xa/enter var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "0 line 1 ", "F - test-trace-expand-twice/expand-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-expand-twice/expand-0/cursor" check-screen-row screen, 1/y, "... ", "F - test-trace-expand-twice/expand-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-expand-twice/expand-1/cursor" check-screen-row screen, 2/y, "0 line 2 ", "F - test-trace-expand-twice/expand-2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-expand-twice/expand-2/cursor" # cursor down edit-trace t, 4/ctrl-d # hack: we need to render here to make this test pass; we're mixing state management with rendering var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "0 line 1 ", "F - test-trace-expand-twice/down-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-expand-twice/down-0/cursor" check-screen-row screen, 1/y, "... ", "F - test-trace-expand-twice/down-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "||| ", "F - test-trace-expand-twice/down-1/cursor" check-screen-row screen, 2/y, "0 line 2 ", "F - test-trace-expand-twice/down-2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-expand-twice/down-2/cursor" # expand again edit-trace t, 0xa/enter var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "0 line 1 ", "F - test-trace-expand-twice/expand2-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-expand-twice/expand2-0/cursor" check-screen-row screen, 1/y, "1 line 1.1 ", "F - test-trace-expand-twice/expand2-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "|||||||||| ", "F - test-trace-expand-twice/expand2-1/cursor" check-screen-row screen, 2/y, "0 line 2 ", "F - test-trace-expand-twice/expand2-2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-expand-twice/expand2-2/cursor" } fn test-trace-refresh-cursor { var t-storage: trace var t/esi: (addr trace) <- address t-storage initialize-trace t, 0x10, 0x10 # trace-text t, "l", "line 1" trace-text t, "l", "line 2" trace-text t, "l", "line 3" # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack initialize-screen screen, 0x10/width, 4/height # var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "... ", "F - test-trace-refresh-cursor/pre-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-refresh-cursor/pre-0/cursor" check-screen-row screen, 1/y, " ", "F - test-trace-refresh-cursor/pre-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-refresh-cursor/pre-1/cursor" # expand edit-trace t, 0xa/enter var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "0 line 1 ", "F - test-trace-refresh-cursor/expand-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-refresh-cursor/expand-0/cursor" check-screen-row screen, 1/y, "0 line 2 ", "F - test-trace-refresh-cursor/expand-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-refresh-cursor/expand-1/cursor" check-screen-row screen, 2/y, "0 line 3 ", "F - test-trace-refresh-cursor/expand-2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-refresh-cursor/expand-2/cursor" # cursor down edit-trace t, 4/ctrl-d edit-trace t, 4/ctrl-d var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "0 line 1 ", "F - test-trace-refresh-cursor/down-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-refresh-cursor/down-0/cursor" check-screen-row screen, 1/y, "0 line 2 ", "F - test-trace-refresh-cursor/down-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-refresh-cursor/down-1/cursor" check-screen-row screen, 2/y, "0 line 3 ", "F - test-trace-refresh-cursor/down-2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "|||||||| ", "F - test-trace-refresh-cursor/down-2/cursor" # recreate trace clear-trace t trace-text t, "l", "line 1" trace-text t, "l", "line 2" trace-text t, "l", "line 3" var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # cursor remains unchanged check-screen-row screen, 0/y, "0 line 1 ", "F - test-trace-refresh-cursor/refresh-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-refresh-cursor/refresh-0/cursor" check-screen-row screen, 1/y, "0 line 2 ", "F - test-trace-refresh-cursor/refresh-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-refresh-cursor/refresh-1/cursor" check-screen-row screen, 2/y, "0 line 3 ", "F - test-trace-refresh-cursor/refresh-2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "|||||||| ", "F - test-trace-refresh-cursor/refresh-2/cursor" } fn test-trace-preserve-cursor-on-refresh { var t-storage: trace var t/esi: (addr trace) <- address t-storage initialize-trace t, 0x10, 0x10 # trace-text t, "l", "line 1" trace-text t, "l", "line 2" trace-text t, "l", "line 3" # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack initialize-screen screen, 0x10/width, 4/height # var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "... ", "F - test-trace-preserve-cursor-on-refresh/pre-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-preserve-cursor-on-refresh/pre-0/cursor" check-screen-row screen, 1/y, " ", "F - test-trace-preserve-cursor-on-refresh/pre-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-preserve-cursor-on-refresh/pre-1/cursor" # expand edit-trace t, 0xa/enter var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "0 line 1 ", "F - test-trace-preserve-cursor-on-refresh/expand-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-preserve-cursor-on-refresh/expand-0/cursor" check-screen-row screen, 1/y, "0 line 2 ", "F - test-trace-preserve-cursor-on-refresh/expand-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-preserve-cursor-on-refresh/expand-1/cursor" check-screen-row screen, 2/y, "0 line 3 ", "F - test-trace-preserve-cursor-on-refresh/expand-2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-preserve-cursor-on-refresh/expand-2/cursor" # cursor down edit-trace t, 4/ctrl-d edit-trace t, 4/ctrl-d var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "0 line 1 ", "F - test-trace-preserve-cursor-on-refresh/down-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-preserve-cursor-on-refresh/down-0/cursor" check-screen-row screen, 1/y, "0 line 2 ", "F - test-trace-preserve-cursor-on-refresh/down-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-preserve-cursor-on-refresh/down-1/cursor" check-screen-row screen, 2/y, "0 line 3 ", "F - test-trace-preserve-cursor-on-refresh/down-2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "|||||||| ", "F - test-trace-preserve-cursor-on-refresh/down-2/cursor" # recreate trace with slightly different lines clear-trace t trace-text t, "l", "line 4" trace-text t, "l", "line 5" trace-text t, "l", "line 3" # cursor line is unchanged var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # cursor remains unchanged check-screen-row screen, 0/y, "0 line 4 ", "F - test-trace-preserve-cursor-on-refresh/refresh-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-preserve-cursor-on-refresh/refresh-0/cursor" check-screen-row screen, 1/y, "0 line 5 ", "F - test-trace-preserve-cursor-on-refresh/refresh-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-preserve-cursor-on-refresh/refresh-1/cursor" check-screen-row screen, 2/y, "0 line 3 ", "F - test-trace-preserve-cursor-on-refresh/refresh-2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "|||||||| ", "F - test-trace-preserve-cursor-on-refresh/refresh-2/cursor" } fn test-trace-keep-cursor-visible-on-refresh { var t-storage: trace var t/esi: (addr trace) <- address t-storage initialize-trace t, 0x10, 0x10 # trace-text t, "l", "line 1" trace-text t, "l", "line 2" trace-text t, "l", "line 3" # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack initialize-screen screen, 0x10/width, 4/height # var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "... ", "F - test-trace-keep-cursor-visible-on-refresh/pre-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-keep-cursor-visible-on-refresh/pre-0/cursor" check-screen-row screen, 1/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/pre-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/pre-1/cursor" # expand edit-trace t, 0xa/enter var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "0 line 1 ", "F - test-trace-keep-cursor-visible-on-refresh/expand-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-keep-cursor-visible-on-refresh/expand-0/cursor" check-screen-row screen, 1/y, "0 line 2 ", "F - test-trace-keep-cursor-visible-on-refresh/expand-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/expand-1/cursor" check-screen-row screen, 2/y, "0 line 3 ", "F - test-trace-keep-cursor-visible-on-refresh/expand-2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/expand-2/cursor" # cursor down edit-trace t, 4/ctrl-d edit-trace t, 4/ctrl-d var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "0 line 1 ", "F - test-trace-keep-cursor-visible-on-refresh/down-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/down-0/cursor" check-screen-row screen, 1/y, "0 line 2 ", "F - test-trace-keep-cursor-visible-on-refresh/down-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/down-1/cursor" check-screen-row screen, 2/y, "0 line 3 ", "F - test-trace-keep-cursor-visible-on-refresh/down-2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "|||||||| ", "F - test-trace-keep-cursor-visible-on-refresh/down-2/cursor" # recreate trace with entirely different lines clear-trace t trace-text t, "l", "line 4" trace-text t, "l", "line 5" trace-text t, "l", "line 6" mark-lines-dirty t clear-screen screen var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # trace collapses, and cursor bumps up check-screen-row screen, 0/y, "... ", "F - test-trace-keep-cursor-visible-on-refresh/refresh-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-keep-cursor-visible-on-refresh/refresh-0/cursor" check-screen-row screen, 1/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/refresh-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/refresh-1/cursor" check-screen-row screen, 2/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/refresh-2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-keep-cursor-visible-on-refresh/refresh-2/cursor" } fn test-trace-collapse-at-top { var t-storage: trace var t/esi: (addr trace) <- address t-storage initialize-trace t, 0x10, 0x10 # trace-text t, "l", "line 1" trace-lower t trace-text t, "l", "line 1.1" trace-higher t trace-text t, "l", "line 2" # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack initialize-screen screen, 0x10/width, 4/height # var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "... ", "F - test-trace-collapse-at-top/pre-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-collapse-at-top/pre-0/cursor" check-screen-row screen, 1/y, " ", "F - test-trace-collapse-at-top/pre-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-at-top/pre-1/cursor" # expand edit-trace t, 0xa/enter var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "0 line 1 ", "F - test-trace-collapse-at-top/expand-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-collapse-at-top/expand-0/cursor" check-screen-row screen, 1/y, "... ", "F - test-trace-collapse-at-top/expand-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-at-top/expand-1/cursor" check-screen-row screen, 2/y, "0 line 2 ", "F - test-trace-collapse-at-top/expand-2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-collapse-at-top/expand-2/cursor" # collapse edit-trace t, 8/backspace # hack: we need to render here to make this test pass; we're mixing state management with rendering clear-screen screen var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "... ", "F - test-trace-collapse-at-top/post-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-collapse-at-top/post-0/cursor" check-screen-row screen, 1/y, " ", "F - test-trace-collapse-at-top/post-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-at-top/post-1/cursor" } fn test-trace-collapse { var t-storage: trace var t/esi: (addr trace) <- address t-storage initialize-trace t, 0x10, 0x10 # trace-text t, "l", "line 1" trace-text t, "l", "line 2" # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack initialize-screen screen, 0x10/width, 4/height # var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "... ", "F - test-trace-collapse/pre-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-collapse/pre-0/cursor" check-screen-row screen, 1/y, " ", "F - test-trace-collapse/pre-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse/pre-1/cursor" # expand edit-trace t, 0xa/enter var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "0 line 1 ", "F - test-trace-collapse/expand-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-collapse/expand-0/cursor" check-screen-row screen, 1/y, "0 line 2 ", "F - test-trace-collapse/expand-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse/expand-1/cursor" # cursor down edit-trace t, 4/ctrl-d var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # collapse edit-trace t, 8/backspace clear-screen screen var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "... ", "F - test-trace-collapse/post-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-collapse/post-0/cursor" check-screen-row screen, 1/y, " ", "F - test-trace-collapse/post-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse/post-1/cursor" } fn test-trace-collapse-skips-invisible-lines { var t-storage: trace var t/esi: (addr trace) <- address t-storage initialize-trace t, 0x10, 0x10 # trace-text t, "l", "line 1" trace-lower t trace-text t, "l", "line 1.1" trace-higher t trace-text t, "l", "line 2" # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack initialize-screen screen, 0x10/width, 4/height # var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "... ", "F - test-trace-collapse-skips-invisible-lines/pre-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-collapse-skips-invisible-lines/pre-0/cursor" check-screen-row screen, 1/y, " ", "F - test-trace-collapse-skips-invisible-lines/pre-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-skips-invisible-lines/pre-1/cursor" # expand edit-trace t, 0xa/enter var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # two visible lines with an invisible line in between check-screen-row screen, 0/y, "0 line 1 ", "F - test-trace-collapse-skips-invisible-lines/expand-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-collapse-skips-invisible-lines/expand-0/cursor" check-screen-row screen, 1/y, "... ", "F - test-trace-collapse-skips-invisible-lines/expand-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-skips-invisible-lines/expand-1/cursor" check-screen-row screen, 2/y, "0 line 2 ", "F - test-trace-collapse-skips-invisible-lines/expand-2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-collapse-skips-invisible-lines/expand-2/cursor" # cursor down to second visible line edit-trace t, 4/ctrl-d var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor edit-trace t, 4/ctrl-d var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # collapse edit-trace t, 8/backspace clear-screen screen var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-ints-equal y, 1, "F - test-trace-collapse-skips-invisible-lines/post-0/y" var cursor-y/eax: (addr int) <- get t, cursor-y check-ints-equal *cursor-y, 0, "F - test-trace-collapse-skips-invisible-lines/post-0/cursor-y" check-screen-row screen, 0/y, "... ", "F - test-trace-collapse-skips-invisible-lines/post-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-collapse-skips-invisible-lines/post-0/cursor" check-screen-row screen, 1/y, " ", "F - test-trace-collapse-skips-invisible-lines/post-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-skips-invisible-lines/post-1/cursor" } fn test-trace-collapse-two-levels { var t-storage: trace var t/esi: (addr trace) <- address t-storage initialize-trace t, 0x10, 0x10 # trace-text t, "l", "line 1" trace-lower t trace-text t, "l", "line 1.1" trace-higher t trace-text t, "l", "line 2" # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack initialize-screen screen, 0x10/width, 4/height # var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-screen-row screen, 0/y, "... ", "F - test-trace-collapse-two-levels/pre-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-collapse-two-levels/pre-0/cursor" check-screen-row screen, 1/y, " ", "F - test-trace-collapse-two-levels/pre-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-two-levels/pre-1/cursor" # expand edit-trace t, 0xa/enter var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # two visible lines with an invisible line in between check-screen-row screen, 0/y, "0 line 1 ", "F - test-trace-collapse-two-levels/expand-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||| ", "F - test-trace-collapse-two-levels/expand-0/cursor" check-screen-row screen, 1/y, "... ", "F - test-trace-collapse-two-levels/expand-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-two-levels/expand-1/cursor" check-screen-row screen, 2/y, "0 line 2 ", "F - test-trace-collapse-two-levels/expand-2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-collapse-two-levels/expand-2/cursor" # cursor down to ellipses edit-trace t, 4/ctrl-d var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # expand edit-trace t, 0xa/enter var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # two visible lines with an invisible line in between check-screen-row screen, 0/y, "0 line 1 ", "F - test-trace-collapse-two-levels/expand2-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, " ", "F - test-trace-collapse-two-levels/expand2-0/cursor" check-screen-row screen, 1/y, "1 line 1.1 ", "F - test-trace-collapse-two-levels/expand2-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "|||||||||| ", "F - test-trace-collapse-two-levels/expand2-1/cursor" check-screen-row screen, 2/y, "0 line 2 ", "F - test-trace-collapse-two-levels/expand2-2" check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, " ", "F - test-trace-collapse-two-levels/expand2-2/cursor" # cursor down to second visible line edit-trace t, 4/ctrl-d var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # collapse edit-trace t, 8/backspace clear-screen screen var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor # check-ints-equal y, 1, "F - test-trace-collapse-two-levels/post-0/y" var cursor-y/eax: (addr int) <- get t, cursor-y check-ints-equal *cursor-y, 0, "F - test-trace-collapse-two-levels/post-0/cursor-y" check-screen-row screen, 0/y, "... ", "F - test-trace-collapse-two-levels/post-0" check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||| ", "F - test-trace-collapse-two-levels/post-0/cursor" check-screen-row screen, 1/y, " ", "F - test-trace-collapse-two-levels/post-1" check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, " ", "F - test-trace-collapse-two-levels/post-1/cursor" }