Skip to content
Permalink
Browse files

show 20 error line, add resize stretch option on code-area

  • Loading branch information...
sandeshsoni committed Apr 11, 2019
1 parent 4d10ad3 commit 6b6d2f18196fc4cb11d1aaf1f3434e0f95b78e4c
Showing with 4 additions and 2 deletions.
  1. +2 −2 lib/plug/debugger.ex
  2. +2 −0 lib/plug/templates/debugger.html.eex
@@ -397,12 +397,12 @@ defmodule Plug.Debugger do
|> h
end

@radius 5
@radius 10

defp get_snippet(file, line) do
if File.regular?(file) and is_integer(line) do
to_discard = max(line - @radius - 1, 0)
lines = File.stream!(file) |> Stream.take(line + 5) |> Stream.drop(to_discard)
lines = File.stream!(file) |> Stream.take(line + @radius) |> Stream.drop(to_discard)

{first_five, lines} = Enum.split(lines, line - to_discard - 1)
first_five = with_line_number(first_five, to_discard + 1, false)
@@ -341,6 +341,8 @@
font-size: <%= :math.pow(1.2, -1) %>em;
line-height: 1.4;
white-space: normal;
height: 200px;
resize: both;
}
.code-block > .line {

0 comments on commit 6b6d2f1

Please sign in to comment.
You can’t perform that action at this time.