Skip to content

Commit 097e67b

Browse files
committed
Only remove -spec/-type from first line
Before this change a spec looking like this: ``` -spec foo(integer()) -> ok; (atom()) -> ok. ``` would be transformed to: ``` -spec foo(integer()) -> ok; (atom()) -> ok. ``` that is the second clause would be indented incorrectly.
1 parent 7f8e971 commit 097e67b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lib/ex_doc/language/erlang.ex

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -728,10 +728,6 @@ defmodule ExDoc.Language.Erlang do
728728
defp trim_offset(binary, offset) do
729729
binary
730730
|> String.trim()
731-
|> String.split("\n")
732-
|> Enum.map(fn line ->
733-
binary_part(line, offset, byte_size(line) - offset)
734-
end)
735-
|> Enum.join("\n")
731+
|> then(&(binary_part(&1, offset, byte_size(&1) - offset)))
736732
end
737733
end

0 commit comments

Comments
 (0)