Skip to content

Commit 5c3d16a

Browse files
committed
run formatter
1 parent 8e1d928 commit 5c3d16a

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

lib/scenic/scenes/error.ex

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ defmodule Scenic.Scenes.Error do
1818
import Scenic.Primitives
1919
import Scenic.Components
2020

21-
# import IEx
21+
# import IEx
2222

2323
@size 20
2424
@margin_h 20
@@ -30,38 +30,41 @@ defmodule Scenic.Scenes.Error do
3030
@args_header "Scene Args\n "
3131
@mod_header " crashed during init/2"
3232

33-
@font :roboto_mono
33+
@font :roboto_mono
3434
@error_color :orange_red
3535
@args_color :yellow
3636

3737
# --------------------------------------------------------
3838
def init({{module_msg, err_msg, args_msg, stack_msg}, scene_mod, scene_args}, opts) do
39-
4039
# Get the viewport width
41-
{:ok, %ViewPort.Status{size: {width,_}}} = opts[:viewport]
42-
|> ViewPort.info()
40+
{:ok, %ViewPort.Status{size: {width, _}}} =
41+
opts[:viewport]
42+
|> ViewPort.info()
4343

4444
fm = Scenic.Cache.Static.FontMetrics.get(@font)
4545
wrap_width = width - @margin_h * 2
4646

4747
head_msg = module_msg <> @mod_header
4848

49-
err_msg = @error_header <> err_msg
50-
|> FontMetrics.wrap(wrap_width, @size, fm, indent: 4)
49+
err_msg =
50+
(@error_header <> err_msg)
51+
|> FontMetrics.wrap(wrap_width, @size, fm, indent: 4)
5152

52-
args_msg = @args_header <> args_msg
53-
|> FontMetrics.wrap( wrap_width, @size, fm, indent: 4)
53+
args_msg =
54+
(@args_header <> args_msg)
55+
|> FontMetrics.wrap(wrap_width, @size, fm, indent: 4)
5456

55-
stack_msg = @stack_header <> stack_msg
56-
|> String.replace( " ", " " )
57-
|> FontMetrics.wrap( wrap_width, @size, fm, indent: 4 )
57+
stack_msg =
58+
(@stack_header <> stack_msg)
59+
|> String.replace(" ", " ")
60+
|> FontMetrics.wrap(wrap_width, @size, fm, indent: 4)
5861

5962
head_v = 80
6063
args_v = head_v + msg_height(head_msg, @size) + @v_spacing
6164
err_v = args_v + msg_height(args_msg, @size) + @v_spacing
6265
stack_v = err_v + msg_height(err_msg, @size) + @v_spacing
6366

64-
Graph.build(font: @font, font_size: @size, t: {@margin_h,@margin_v})
67+
Graph.build(font: @font, font_size: @size, t: {@margin_h, @margin_v})
6568
|> button("Try Again", id: :try_again, theme: :warning)
6669
|> button("Reset", id: :restart, translate: {116, 0})
6770
|> text(head_msg, translate: {0, head_v}, font_size: @size + 4)

test/scenic/scenes/error_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ defmodule Scenic.Scenes.ErrorTest do
1616
def init(nil), do: {:ok, nil}
1717

1818
def handle_call(:query_info, _, state) do
19-
{:reply, {:ok, %Scenic.ViewPort.Status{size: {500,400}}}, state}
19+
{:reply, {:ok, %Scenic.ViewPort.Status{size: {500, 400}}}, state}
2020
end
2121
end
2222

0 commit comments

Comments
 (0)