You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
letcreate:Highlighter =fun searchTerm ->letregex= searchTerm |> SearchTerm.toRegex
fun s ->match s |> String.length with|0->[]|> FormattedText
|_->seq{letms= regex.Matches(s)if ms.Count =0thenyield(TextSpan.normal s)elif ms.[0].Index >0thenyield TextSpan.normal (s.Substring(0, ms.[0].Index))for i in0.. ms.Count -1doyield TextSpan.highlight ms.[i].Value
letregStart= ms.[i].Index + ms.[i].Length
if i < ms.Count -1thenyield TextSpan.normal (s.Substring(regStart, ms.[i +1].Index - regStart))elif regStart < s.Length
thenyield TextSpan.normal (s.Substring(regStart))}|> List.ofSeq
|> FormattedText.fromList
Result
letcreate:Highlighter =fun searchTerm ->letregex= searchTerm |> SearchTerm.toRegex
fun s ->match s |> String.length with|0->[]|> FormattedText
|_->seq{letms= regex.Matches(s)if ms.Count =0thenyield(TextSpan.normal s)elif ms.[0].Index >0thenyield TextSpan.normal (s.Substring(0, ms.[0].Index))for i in0.. ms.Count -1doyield TextSpan.highlight ms.[i].Value
letregStart= ms.[i].Index + ms.[i].Length
if i < ms.Count -1thenyield TextSpan.normal (s.Substring(regStart, ms.[i +1].Index - regStart))elif regStart < s.Length
thenyield TextSpan.normal (s.Substring(regStart))}|> List.ofSeq
|> FormattedText.fromList
Problem description
See the extra new lines in the input? If that is the source file and you press Ctrl K D another new line gets added each time. To simulate this in the online formatter, I kept copying the output into the input box and pressing Format and another line gets added. But if you just press Format a few times nothing changes.
Extra information
The formatted result breaks by code.
The formatted result gives compiler warnings.
I or my company would be willing to help fix this.
Issue created from fantomas-online
Code
Result
Problem description
See the extra new lines in the input? If that is the source file and you press Ctrl K D another new line gets added each time. To simulate this in the online formatter, I kept copying the output into the input box and pressing Format and another line gets added. But if you just press Format a few times nothing changes.
Extra information
Options
Fantomas Master at 09/13/2020 16:11:22 - c6faad7
Default Fantomas configuration
The text was updated successfully, but these errors were encountered: