Skip to content

Commit 1017db8

Browse files
committed
better on small screens
1 parent e098325 commit 1017db8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/methods/rule_based/rules_loader.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ function load_rules(rules_paths)
77
global IDENTIFIERS
88

99
tot = length(rules_paths)
10+
length_load_bar = 40 # displaysize(stdout) doesnt work here
11+
print("\n\n")
1012
for (i, file) in enumerate(rules_paths)
1113
# cool print
12-
n_of_equals = round(Int, (i-1) / tot * 60)
13-
if i > 1
14-
print("\e[2A") # Move cursor up 2 lines
15-
end
14+
n_of_equals = round(Int, (i-1) / tot * length_load_bar)
15+
print("\e[2A") # Move cursor up 2 lines
1616
print("\e[2K") # Clear current line
1717
printstyled(" $(i-1)/$tot files"; color = :light_green, bold = true)
18-
print(" [" * "="^n_of_equals *">"* " "^(60 - n_of_equals) * "] ")
18+
print(" [" * "="^n_of_equals *">"* " "^(length_load_bar - n_of_equals) * "] ")
1919
printstyled("$(length(RULES)) rules\n"; color = :light_green, bold = true)
2020
print("\e[2K") # Clear current line
2121
printstyled(" Loading file: ", split(file,"/")[end], "\n"; color = :light_black)

0 commit comments

Comments
 (0)