Skip to content

Commit 8d3df3e

Browse files
author
zesani
committed
add gutterMarker unseenline
1 parent 47359c8 commit 8d3df3e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

codemirror.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
props: {
1717
code: String,
1818
value: String,
19+
unseenLines: Array,
20+
marker: Function,
1921
options: {
2022
type: Object,
2123
default: function() {
@@ -83,16 +85,19 @@
8385
_this.$emit('input', _this.content)
8486
}
8587
})
88+
this.gutterMarkers()
8689
},
8790
watch: {
8891
'code': function(newVal, oldVal) {
92+
var _this = this
8993
const editor_value = this.editor.getValue()
9094
if (newVal !== editor_value) {
9195
let scrollInfo = this.editor.getScrollInfo()
9296
this.editor.setValue(newVal)
9397
this.content = newVal
9498
this.editor.scrollTo(scrollInfo.left, scrollInfo.top)
9599
}
100+
this.gutterMarkers()
96101
},
97102
'value': function(newVal, oldVal) {
98103
const editor_value = this.editor.getValue()
@@ -103,6 +108,15 @@
103108
this.editor.scrollTo(scrollInfo.left, scrollInfo.top)
104109
}
105110
}
111+
},
112+
methods: {
113+
gutterMarkers: function () {
114+
var _this = this
115+
_this.unseenLines.forEach(line => {
116+
var info = _this.editor.lineInfo(line)
117+
_this.editor.setGutterMarker(line, "breakpoints", info.gutterMarkers ? null : _this.marker())
118+
})
119+
}
106120
}
107121
}
108122
</script>
@@ -111,5 +125,6 @@
111125
.CodeMirror,
112126
.CodeMirror pre {
113127
font-family: Menlo, Monaco, Consolas, "Courier New", monospace!important;
128+
padding: 0 20px !important; /* Horizontal padding of content */
114129
}
115130
</style>

0 commit comments

Comments
 (0)