   end
 
   @doc false
-  @spec text_diff_format(String.t(), String.t(), keyword()) :: iolist()
-  def text_diff_format(code, code, opts \\ default_opts())
+  @spec text_diff_format(String.t(), String.t()) :: iolist()
+  def text_diff_format(old, new, opts \\ [])
 
   def text_diff_format(code, code, _opts), do: []
 
   def text_diff_format(old, new, opts) do
-    opts = Keyword.merge(@default_opts, opts)
-
+    opts = Keyword.validate!(opts, after: 2, before: 2, color: IO.ANSI.enabled?(), line: 1)
     crs? = String.contains?(old, "\r") || String.contains?(new, "\r")
 
     old = String.split(old, "\n")

    end)
  end

  defp colorize(str, kind, space, opts) do
    case Keyword.fetch!(opts, :color) && Keyword.has_key?(@colors, kind) do
      false ->
        str

      true ->
        color = Keyword.fetch!(@colors, kind)

        case space do
          false ->
            IO.ANSI.format([color[:text], str])

          true ->
            str
            |> String.split(~r/[\t\s]+/, include_captures: true)
            |> Enum.map(fn
              <<start::binary-size(1), _::binary>> = str when start in ["\t", "\s"] ->
                IO.ANSI.format([color[:space], str])

              str ->
                IO.ANSI.format([color[:text], str])
            end)
        end
    end
  end


  @colors [
    del: [text: :red, space: :red_background],
    ins: [text: :green, space: :green_background]
  ]

  @doc """
