Skip to content

Commit 6ed96c1

Browse files
author
zesani
committed
fix unseenLines and marker is undefined
1 parent 955d5fe commit 6ed96c1

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

codemirror.vue

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
_this.$emit('input', _this.content)
8686
}
8787
})
88-
this.gutterMarkers()
88+
this.unseenLineMarkers()
8989
},
9090
watch: {
9191
'code': function(newVal, oldVal) {
@@ -96,7 +96,7 @@
9696
this.content = newVal
9797
this.editor.scrollTo(scrollInfo.left, scrollInfo.top)
9898
}
99-
this.gutterMarkers()
99+
this.unseenLineMarkers()
100100
},
101101
'value': function(newVal, oldVal) {
102102
const editor_value = this.editor.getValue()
@@ -106,15 +106,18 @@
106106
this.content = newVal
107107
this.editor.scrollTo(scrollInfo.left, scrollInfo.top)
108108
}
109+
this.unseenLineMarkers()
109110
}
110111
},
111112
methods: {
112-
gutterMarkers: function () {
113+
unseenLineMarkers: function () {
113114
var _this = this
114-
_this.unseenLines.forEach(line => {
115-
var info = _this.editor.lineInfo(line)
116-
_this.editor.setGutterMarker(line, "breakpoints", info.gutterMarkers ? null : _this.marker())
117-
})
115+
if (_this.unseenLines !== undefined && _this.marker !== undefined) {
116+
_this.unseenLines.forEach(line => {
117+
var info = _this.editor.lineInfo(line)
118+
_this.editor.setGutterMarker(line, "breakpoints", info.gutterMarkers ? null : _this.marker())
119+
})
120+
}
118121
}
119122
}
120123
}

0 commit comments

Comments
 (0)