Skip to content
This repository was archived by the owner on Oct 5, 2022. It is now read-only.

Commit c70a305

Browse files
committed
Moved the handling of newlines in ghc-mod browse
1 parent 7a3b118 commit c70a305

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/util-ghc-mod.coffee

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ run = ({onMessage, onComplete, onFailure, cmd, args, cwd}) ->
2929
onFailure?()
3030

3131
stdout = (onMessage, line) ->
32-
line.split('\n').filter((l)->0 != l.length).map onMessage
32+
line.split(/\r?\n|\r/).filter((l)->0 != l.length).map onMessage
3333

3434

3535
# ghc-mod check
@@ -165,7 +165,7 @@ browse = ({fileName, moduleName, onResult, onComplete, onFailure, onDone}) ->
165165
args: ['-d', moduleName]
166166
cwd: path.dirname(fileName)
167167
onMessage: (line) ->
168-
if matches = /^([A-Za-z0-9_']+)(\s::\s(.+))?$/m.exec(line)
168+
if matches = /^([A-Za-z0-9_']+)(\s::\s(.+))?$/.exec(line)
169169
[_, expr, _, type] = matches
170170
onResult?({expr, type})
171171
else

0 commit comments

Comments
 (0)