Skip to content

Commit 0d108d0

Browse files
committed
folds end on the same line support
1 parent 9e06d9a commit 0d108d0

File tree

2 files changed

+26
-12
lines changed

2 files changed

+26
-12
lines changed

HTMLVisualizer.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,17 @@ def printPage(self, file, destination):
353353

354354
if fold and cfold['end'] == (index + 1):
355355
sufix = "</div>"
356-
# remove fold from stack
357-
del(fold_stack[-1])
356+
while True:
357+
# remove fold from stack
358+
del(fold_stack[-1])
359+
if fold_stack and fold_stack[-1]['end'] == (index + 1):
360+
sufix = sufix + "</div>"
361+
cfold = fold_stack[-1]
362+
continue
363+
else:
364+
break
358365

359-
fd.write("%s%s %s%s\n" % (prefix, ln, out_line, sufix))
366+
fd.write("%s%s %s%s\n" % (prefix, ln, out_line, sufix))
360367

361368
fd.write("</body>\n")
362369
fd.write("</html>\n")

TODO

+16-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
1-
[OK] - add keywords coloring
2-
[OK] - add block folding
3-
[OK] - add multilevel block folding
4-
[OK] - add autofold from *.vis file
5-
[OK] - add database of keywords description
1+
[ ] - support for fold's start on the same line
62
[ ] - make a search in db more efficient
7-
[OK] - support for multiple commands for single line (nonconflicting commands)
83
[ ] - support for multiline comments on a single line (flowing div)
94
[ ] - make a call graph for every module (use existing tools)
105
[ ] - ignore comments (+color them)
116
[ ] - for each folded block show start and end line number
12-
[OK] - find a suitable dir for keyword file
13-
[OK] - install css and js files into dest directory
147
[ ] - highlight (silver?) all functions body
158
[ ] - make a configuration file (language, colors, function highlighting, conflicts, ...)
169
[ ] - add links for keywords (to its function definition for example or a line, ...)
@@ -25,10 +18,24 @@
2518
[ ] - if I move over { sign, highlight the entire {'s block
2619
[ ] - specify for each fold its input and output vars (optionally of course)
2720
[ ] - add a command to specify global variables used in functions (to know what is needed and what can be changed => side effects)
28-
[OK] - do not mark keywords in literals or comments
2921
[ ] - add mustnotmiss command for very important invocations, ... The entire line must flash or be unoverlookable!!!
3022
[ ] - add something like "the last unfinished source code page" to continue when finished the last time
3123
[ ] - if possible link to main function in the file (maybe some content at the begging of the page or floating div
3224
[ ] - automatic code indenting (commands after { has +1 \t character, ...)
3325
[ ] - add support for \t character (multiples of 8?)
3426
[ ] - if a fold contains needinfo, label the fold with needinfo flag
27+
[ ] - concept of compact subgraphs (show only necesary parts of the code, or its subparts)
28+
[ ] - callgrind, kcachegrind
29+
[ ] - plugin for devassistant
30+
31+
====finished tasks====
32+
[OK] - add keywords coloring
33+
[OK] - add block folding
34+
[OK] - add multilevel block folding
35+
[OK] - add autofold from *.vis file
36+
[OK] - add database of keywords description
37+
[OK] - support for multiple commands for single line (nonconflicting commands)
38+
[OK] - find a suitable dir for keyword file
39+
[OK] - install css and js files into dest directory
40+
[OK] - do not mark keywords in literals or comments
41+

0 commit comments

Comments
 (0)