Closed dpsanders closed 10 years ago
Can you post a code example? I can try to play around with it.
Here's a silly example: Initially everything was flat (unindented), then applying Edit->Line->Reindent
gives
for i in 1:10
# a useless comment
println(i)
end
for i in 1:10
print(i, " ")
a = 0
# a useless comment
for j in 1:10
a += i
println(a)
end
end
The commented line and everything after it is immediately sent back to 0 indent level until the next block restarts the indenting. Boy is badly-indented code hard to read!
Alright, I don't really know what's going on here, but as far as I can tell this is a sublime issue, not something specific to Sublime-IJulia. Sorry to not be more help.
I was given some unindented (!) Julia code. In principle, Sublime Text can reindent it correctly using the same indentation algorithm. However, it seems to fail if there are commented lines within the blocks that should be indented. (Indentation reverts to 0 on those commented lines.)