vscode-blockman icon indicating copy to clipboard operation
vscode-blockman copied to clipboard

N04 Sub05 adds extra whitespace to end of line inside inner block

Open kc9jud opened this issue 3 years ago • 1 comments

I noticed that the new option for adding padding on the right also introduces a significant amount of padding inside the inner-most block.

Code:

# hello
for i in range(10):
    for j in range(20):
        print("Hello world, from ({},{})".format(i,j))
        # expand block
        count += 1

N04 Sub05 -> 0: image

N04 Sub05 -> 4: image

I think it might be interacting poorly with N24: image image image

kc9jud avatar Feb 02 '22 04:02 kc9jud

That's because the calculation formula for N04 Sub05 is like this:

rightPaddingIncrement = (maxDepth - currDepth) * minDistanceBetweenRightEdges

It is a fast formula, performance is more optimized with it. If we want more precise formula, then I guess we need to make much more complex and CPU heavy calculations. I think current formula is good enough. I hope it's ok for you.

You mentioned N24, and yeah, it will make some effect on the formula because if you enable round brackets and maybe also square brackets, it means you are creating more blocks. More blocks often means some changes in depth indexes, so it will effect the formula.

leodevbro avatar Feb 02 '22 07:02 leodevbro