Skip to content

Instantly share code, notes, and snippets.

@clarkbw
Created August 26, 2016 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clarkbw/d6e46ff7fb94d308f6e9cb99639bfe7d to your computer and use it in GitHub Desktop.
Save clarkbw/d6e46ff7fb94d308f6e9cb99639bfe7d to your computer and use it in GitHub Desktop.
Uses addLineWidget in the debugger.html CodeMirror editor
diff --git a/public/js/components/Editor.css b/public/js/components/Editor.css
index ff6160c..3986f92 100644
--- a/public/js/components/Editor.css
+++ b/public/js/components/Editor.css
@@ -52,6 +52,10 @@
z-index: 0;
}
+.new-breakpoint .CodeMirror-linewidget .helpful-message {
+ background-color: yellow;
+}
+
.debug-line .CodeMirror-line {
background-color: var(--breakpoint-active-color) !important;
}
diff --git a/public/js/components/EditorBreakpoint.js b/public/js/components/EditorBreakpoint.js
index 750b289..ea4bc68 100644
--- a/public/js/components/EditorBreakpoint.js
+++ b/public/js/components/EditorBreakpoint.js
@@ -39,6 +39,10 @@ const Breakpoint = React.createClass({
makeMarker(bp.disabled)
);
this.props.editor.addLineClass(line, "line", "new-breakpoint");
+ let node = document.createElement("div");
+ node.textContent = "This is the helpful message below a breakpoint";
+ node.className = "helpful-message";
+ this.props.editor.addLineWidget(line, node, { });
},
shouldComponentUpdate(nextProps) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment