Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix extra whitespace in text rendering of indented empty lines #2101

Merged
merged 1 commit into from
May 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Commands/Dev/Geb/Repl/Format.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ instance HasAnsiBackend ReplMessageDoc where

instance HasTextBackend ReplMessageDoc where
toTextDoc (ReplMessageDoc o) = unAnnotate o
toTextStream (ReplMessageDoc o) = unAnnotateS (layoutPretty defaultLayoutOptions o)
toTextStream (ReplMessageDoc o) = layoutPretty defaultLayoutOptions (unAnnotate o)

stylize :: ReplStyle -> AnsiStyle
stylize = \case
Expand Down
2 changes: 1 addition & 1 deletion src/Juvix/Data/PPOutput.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ instance HasAnsiBackend PPOutput where

instance HasTextBackend PPOutput where
toTextDoc (PPOutput o) = unAnnotate o
toTextStream (PPOutput o) = unAnnotateS (layoutPretty defaultLayoutOptions o)
toTextStream (PPOutput o) = layoutPretty defaultLayoutOptions (unAnnotate o)

ppOutput :: Doc Ann -> AnsiText
ppOutput = AnsiText . PPOutput
2 changes: 1 addition & 1 deletion src/Juvix/Prelude/Pretty.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ instance HasAnsiBackend AnsiText where

instance HasTextBackend (Doc a) where
toTextDoc = unAnnotate
toTextStream = unAnnotateS . layoutPretty defaultLayoutOptions
toTextStream = layoutPretty defaultLayoutOptions . unAnnotate

instance HasAnsiBackend (Doc Ansi.AnsiStyle) where
toAnsiDoc = id
Expand Down
2 changes: 1 addition & 1 deletion tests/positive/Format.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ module Patterns;
infixr 4 ,;
type × (A : Type) (B : Type) :=
| , : A → B → A × B;

f : Nat × Nat × Nat × Nat -> Nat;
f (a, b, c, d) := a;
end;
Expand Down