File tree Expand file tree Collapse file tree 4 files changed +17
-1
lines changed
fixtures/workspaces/heredoc Expand file tree Collapse file tree 4 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ def indent(offset)
1010 heredoc_marker = nil if /^#{ heredoc_marker } \n ?$/ . match? ( line )
1111 line
1212 else
13- heredoc_marker = $1 if line =~ /<<-?(\w +) \n ?$ /
13+ heredoc_marker = $1 if line =~ /<<-?\s * (\w [ \w \d ]*) /
1414 "#{ indentation } #{ line } "
1515 end
1616 end
Original file line number Diff line number Diff line change @@ -14,3 +14,7 @@ also unindented
1414
1515 3 indentations with empty line above
1616also unindented
17+ writing to file:
18+ 0 indentation
19+ 1 indentation
20+ 1 indentation
Original file line number Diff line number Diff line change 1+ 0 indentation
2+ 1 indentation
3+ 1 indentation
Original file line number Diff line number Diff line change @@ -16,3 +16,12 @@ cat <<-SECOND_BLOCK
1616SECOND_BLOCK
1717
1818echo also unindented
19+
20+ echo " writing to file:"
21+ cat << EOF > output.txt
22+ 0 indentation
23+ 1 indentation
24+ 1 indentation
25+ EOF
26+
27+ cat output.txt
You can’t perform that action at this time.
0 commit comments