Skip to content

Commit 4bbd0d1

Browse files
committed
more code comments
1 parent 5e48a37 commit 4bbd0d1

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/tensors/blockiterator.jl

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,13 @@ end
4747

4848
function show_blocks(io, mime::MIME"text/plain", iter)
4949
numlinesleft, numcols = get(io, :displaysize, displaysize(io))
50-
numlinesleft -= 2
51-
# lines of headers should already have been subtracted, but not the 2 spare lines for old and new prompts
52-
minlinesperblock = 7
50+
numlinesleft -= 2 # lines of headers have already been subtracted, but not the 2 spare lines for old and new prompts
51+
minlinesperblock = 7 # aim to have at least this many lines per printed block (= 5 lines for the actual matrix)
5352
minnumberofblocks = min(3, length(iter)) # aim to show at least this many blocks
5453
truncateblocks = sum(cb->min(size(cb[2], 1) + 2, minlinesperblock), iter; init = 0) > numlinesleft
5554
maxnumlinesperblock = max(div(numlinesleft - 2 * truncateblocks, minnumberofblocks), minlinesperblock)
56-
# aim to show at least 3 blocks, but not if this means that there
57-
# would be less than 7 lines per block (= 5 lines for the actual matrix)
58-
# we deduct a line for a truncation message depending on truncateblocks
55+
# aim to show at least minnumberofblocks, but not if this means that there would be less than minlinesperblock
56+
# deduct two lines for a truncation message (and newline) if needed
5957
for (n, (c, b)) in enumerate(iter)
6058
n == 1 || print(io, "\n\n")
6159
if get(io, :limit, false)

0 commit comments

Comments
 (0)