[talk] rebreak newlines after newly inserted break

This commit is contained in:
Anton Dyudin 2016-07-12 16:51:06 -07:00
parent 11f5ec83e4
commit 9c3a6fd304

View File

@ -808,19 +808,22 @@
|= buf/(list @c)
^- (list sole-edit)
?~ buf ~
=+ [inx=0 sap=0 con=0]
=+ [inx=0 sap=0 con=0 new=|]
|^ ^- (list sole-edit)
?: =(i.buf (turf '•'))
?. =(0 con) newline
[[%del inx] ?~(t.buf ~ $(buf t.buf))]
?: =(0 con)
[[%del inx] ?~(t.buf ~ $(buf t.buf))]
?: new
[(fix ' ') $(i.buf `@c`' ')]
newline
?: =(i.buf `@`' ')
?. =(64 con) advance(sap inx)
[(fix (turf '•')) newline]
[(fix (turf '•')) newline(new &)]
?: =(64 con)
=+ dif=(sub inx sap)
?: (lth dif 64)
[(fix(inx sap) (turf '•')) $(con dif)]
[[%ins inx (turf '•')] $(con 0, inx +(inx))]
[(fix(inx sap) (turf '•')) $(con dif, new &)]
[[%ins inx (turf '•')] $(con 0, inx +(inx), new &)]
?: |((lth i.buf 32) (gth i.buf 126))
[(fix '?') advance]
?: &((gte i.buf 'A') (lte i.buf 'Z'))