fix issue reported by @stew

This commit is contained in:
Paul Chiusano 2023-07-19 21:08:38 -04:00
parent b39fbc8e0a
commit 087157ad24
3 changed files with 71 additions and 1 deletions

View File

@ -287,7 +287,7 @@ pretty0
App' x (Constructor' (ConstructorReference DD.UnitRef 0)) -> do
px <- pretty0 (ac (if isBlock x then 0 else 10) Normal im doc) x
pure . paren (p >= 11 || isBlock x && p >= 3) $
fmt S.DelayForceChar (l "!") <> px
fmt S.DelayForceChar (l "!") <> PP.indentNAfterNewline 1 px
Delay' x
| isLet x || p < 0 -> do
let (im', uses) = calcImports im x

View File

@ -800,3 +800,26 @@ UUID.randomUUIDBytes = do
.> undo
```
# Weirdness reported by Stew with super long lines
```unison:hide roundtrip.u
blah x =
u = 92393
x
thunk x = do x
test = do
blah !(thunk "This has to laksdjf alsdkfj alskdjf asdf be a long enough string to force a line break")
```
```ucm:hide
.> add
```
```ucm
.> edit test
.> load roundtrip.u
```
```ucm:hide
.> undo
```

View File

@ -2124,3 +2124,50 @@ UUID.randomUUIDBytes = do
file has been previously added to the codebase.
```
# Weirdness reported by Stew
```unison
---
title: roundtrip.u
---
blah x =
u = 92393
x
thunk x = do x
test = do
blah !(thunk "This has to laksdjf alsdkfj alskdjf asdf be a long enough string to force a line break")
```
```ucm
.> edit test
☝️
I added these definitions to the top of
/Users/pchiusano/unison/roundtrip.u
test : 'Text
test =
do
blah
!(thunk
"This has to laksdjf alsdkfj alskdjf asdf be a long enough string to force a line break")
You can edit them there, then do `update` to replace the
definitions currently in this namespace.
.> load roundtrip.u
I found and typechecked these definitions in roundtrip.u. If
you do an `add` or `update`, here's how your codebase would
change:
⍟ These names already exist. You can `update` them to your
new definition:
test : 'Text
```