File tree 2 files changed +21
-1
lines changed 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -963,6 +963,7 @@ function indentation(s::String)
963
963
end
964
964
965
965
function unindent (s:: String , indent:: Int )
966
+ indent == 0 && return s
966
967
buf = IOBuffer (Array (Uint8,endof (s)), true , true )
967
968
truncate (buf,0 )
968
969
a = i = start (s)
@@ -973,7 +974,9 @@ function unindent(s::String, indent::Int)
973
974
if cutting && isblank (c)
974
975
a = i_
975
976
cut += blank_width (c)
976
- if cut > indent
977
+ if cut == indent
978
+ cutting = false
979
+ elseif cut > indent
977
980
cutting = false
978
981
for _ = (indent+ 1 ): cut write (buf, ' ' ) end
979
982
end
Original file line number Diff line number Diff line change @@ -806,6 +806,23 @@ s = " p"
806
806
@test """
807
807
$s
808
808
""" == " $s$(nl) "
809
+ @test """ \t """ == " \t "
810
+ @test """
811
+ \t """ == " "
812
+ @test """
813
+ foo
814
+ \t bar""" == " foo\n\t bar"
815
+ @test """
816
+ foo
817
+ \t bar
818
+ """ == " foo\n\t bar\n "
819
+ @test """
820
+ foo
821
+ bar\t """ == " foo\n bar\t "
822
+ @test """
823
+ foo
824
+ \t bar
825
+ """ == " foo\n bar\n "
809
826
810
827
# bytes2hex and hex2bytes
811
828
hex_str = " d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592"
You can’t perform that action at this time.
0 commit comments