Skip to content

Commit d4e2e5f

Browse files
authored
fix non alignment in printing when line numbers go over an exponent (#79)
1 parent 9432b7a commit d4e2e5f

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

src/printing.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ function print_sourcecode(io::IO, code::String, line::Integer, defline::Integer)
213213

214214
for textline in code
215215
printstyled(io,
216-
string(lineno, " "^(stoplinelength-length(lineno)+1));
216+
string(rpad(lineno, stoplinelength), " ");
217217
color = lineno == current_line ? :yellow : :bold)
218218
println(io, textline)
219219
lineno += 1

test/ui.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ end
5353

5454
function run_terminal_test(frame, commands, validation)
5555
TerminalRegressionTests.automated_test(joinpath(@__DIR__, validation), commands) do emuterm
56+
#TerminalRegressionTests.create_automated_test(joinpath(@__DIR__, validation), commands) do emuterm
5657
repl = REPL.LineEditREPL(emuterm, true)
5758
repl.interface = REPL.setup_interface(repl)
5859
repl.specialdisplay = REPL.REPLDisplay(repl)

test/ui/history_gcd.multiout

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
|7 za = trailing_zeros(a)
3535
|8 zb = trailing_zeros(b)
3636
|9 k = min(za, zb)
37-
|10 u = unsigned(abs(a >> za))
37+
|10 u = unsigned(abs(a >> za))
3838
|
3939
|About to run: (==)(20, 0)
4040
|1|debug>
@@ -54,7 +54,7 @@
5454
|GGGFFFFFFFFFFFFFFFFFFFFFFFFFF
5555
|GGGFFFFFFFFFFFFFFFFFFFFFFFFFF
5656
|GGGFFFFFFFFFFFFFFFFFFF
57-
|GGGGFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
57+
|GGGFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
5858
|
5959
|FFFFFFFFFFFFFFFFFFFFFFFFF
6060
|EEEEEEEEE
@@ -74,7 +74,7 @@
7474
|7 za = trailing_zeros(a)
7575
|8 zb = trailing_zeros(b)
7676
|9 k = min(za, zb)
77-
|10 u = unsigned(abs(a >> za))
77+
|10 u = unsigned(abs(a >> za))
7878
|
7979
|About to run: (==)(20, 0)
8080
|1|julia>
@@ -94,7 +94,7 @@
9494
|GGGFFFFFFFFFFFFFFFFFFFFFFFFFF
9595
|GGGFFFFFFFFFFFFFFFFFFFFFFFFFF
9696
|GGGFFFFFFFFFFFFFFFFFFF
97-
|GGGGFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
97+
|GGGFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
9898
|
9999
|FFFFFFFFFFFFFFFFFFFFFFFFF
100100
|IIIIIIIII
@@ -114,7 +114,7 @@
114114
|7 za = trailing_zeros(a)
115115
|8 zb = trailing_zeros(b)
116116
|9 k = min(za, zb)
117-
|10 u = unsigned(abs(a >> za))
117+
|10 u = unsigned(abs(a >> za))
118118
|
119119
|About to run: (==)(20, 0)
120120
|1|julia> a
@@ -137,7 +137,7 @@
137137
|GGGFFFFFFFFFFFFFFFFFFFFFFFFFF
138138
|GGGFFFFFFFFFFFFFFFFFFFFFFFFFF
139139
|GGGFFFFFFFFFFFFFFFFFFF
140-
|GGGGFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
140+
|GGGFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
141141
|
142142
|FFFFFFFFFFFFFFFFFFFFFFFFF
143143
|IIIIIIIIIF
@@ -160,7 +160,7 @@
160160
|7 za = trailing_zeros(a)
161161
|8 zb = trailing_zeros(b)
162162
|9 k = min(za, zb)
163-
|10 u = unsigned(abs(a >> za))
163+
|10 u = unsigned(abs(a >> za))
164164
|
165165
|About to run: (==)(20, 0)
166166
|1|julia> a
@@ -183,7 +183,7 @@
183183
|GGGFFFFFFFFFFFFFFFFFFFFFFFFFF
184184
|GGGFFFFFFFFFFFFFFFFFFFFFFFFFF
185185
|GGGFFFFFFFFFFFFFFFFFFF
186-
|GGGGFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
186+
|GGGFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
187187
|
188188
|FFFFFFFFFFFFFFFFFFFFFFFFF
189189
|IIIIIIIIIF
@@ -206,7 +206,7 @@
206206
|7 za = trailing_zeros(a)
207207
|8 zb = trailing_zeros(b)
208208
|9 k = min(za, zb)
209-
|10 u = unsigned(abs(a >> za))
209+
|10 u = unsigned(abs(a >> za))
210210
|
211211
|About to run: (==)(20, 0)
212212
|1|julia> a
@@ -229,7 +229,7 @@
229229
|GGGFFFFFFFFFFFFFFFFFFFFFFFFFF
230230
|GGGFFFFFFFFFFFFFFFFFFFFFFFFFF
231231
|GGGFFFFFFFFFFFFFFFFFFF
232-
|GGGGFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
232+
|GGGFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
233233
|
234234
|FFFFFFFFFFFFFFFFFFFFFFFFF
235235
|IIIIIIIIIF
@@ -252,7 +252,7 @@
252252
|7 za = trailing_zeros(a)
253253
|8 zb = trailing_zeros(b)
254254
|9 k = min(za, zb)
255-
|10 u = unsigned(abs(a >> za))
255+
|10 u = unsigned(abs(a >> za))
256256
|
257257
|About to run: (==)(20, 0)
258258
|1|julia> a
@@ -277,7 +277,7 @@
277277
|GGGFFFFFFFFFFFFFFFFFFFFFFFFFF
278278
|GGGFFFFFFFFFFFFFFFFFFFFFFFFFF
279279
|GGGFFFFFFFFFFFFFFFFFFF
280-
|GGGGFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
280+
|GGGFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
281281
|
282282
|FFFFFFFFFFFFFFFFFFFFFFFFF
283283
|IIIIIIIIIF

0 commit comments

Comments
 (0)