File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -61,15 +61,15 @@ function getLineAndColumn (offset) {
61
61
function pastInput ( { offset } ) {
62
62
const start = Math . max ( 0 , offset - 20 )
63
63
const previous = inputSource . substr ( start , offset - start )
64
- return ( offset > 20 ? '...' : '' ) + previous . replace ( / \n / g, '' )
64
+ return ( offset > 20 ? '...' : '' ) + previous . replace ( / \r ? \ n/ g, '' )
65
65
}
66
66
67
67
function upcomingInput ( { offset } ) {
68
68
let start = Math . max ( 0 , offset - 20 )
69
69
start += offset - start
70
70
const rest = inputSource . length - start
71
71
const next = inputSource . substr ( start , Math . min ( 20 , rest ) )
72
- return next . replace ( / \n / g, '' ) + ( rest > 20 ? '...' : '' )
72
+ return next . replace ( / \r ? \ n/ g, '' ) + ( rest > 20 ? '...' : '' )
73
73
}
74
74
75
75
function showPosition ( { offset } ) {
You can’t perform that action at this time.
0 commit comments