Add rulers addon
Allows for vertical rules to be shown.
Change-Id: I4a2cf1bfae15945e0f622045524c56b2cddc16a1
diff --git a/gr-editor/gr-editor.html b/gr-editor/gr-editor.html
index 7b7872f..fd8673e 100644
--- a/gr-editor/gr-editor.html
+++ b/gr-editor/gr-editor.html
@@ -17,6 +17,7 @@
<link rel="import" href="gr-editor-styles.html">
<script src="../bower_components/codemirror-minified/lib/codemirror.js"></script>
+<script src="../bower_components/codemirror-minified/addon/display/rulers.js"></script>
<script src="../bower_components/codemirror-minified/addon/edit/closebrackets.js"></script>
<script src="../bower_components/codemirror-minified/addon/edit/closetag.js"></script>
<script src="../bower_components/codemirror-minified/addon/edit/matchbrackets.js"></script>
@@ -68,6 +69,9 @@
.CodeMirror-linenumber {
color: #757575;
}
+ .CodeMirror-ruler {
+ border-left: 1px solid #ddd;
+ }
.cm-tab:before {
color: #757575;
content: "\2192";
diff --git a/gr-editor/gr-editor.js b/gr-editor/gr-editor.js
index 029082d..bb9233e 100644
--- a/gr-editor/gr-editor.js
+++ b/gr-editor/gr-editor.js
@@ -66,7 +66,6 @@
params.indentWithTabs = prefs.indent_with_tabs;
// TODO(kaspern): Add support for keymaps.
// params.keyMap = prefs.key_map_type.toLowerCase();
- params.lineLength = prefs.line_length;
params.lineNumbers = true;
params.lineWrapping = prefs.line_wrapping;
params.matchBrackets = prefs.match_brackets;
@@ -80,6 +79,7 @@
// TODO(kaspern): Add support for themes.
// params.theme = prefs.theme.toLowerCase();
+ params.rulers = [{column: prefs.line_length}];
if (value && value.includes('\r\n')) {
params.lineSeparator = '\r\n';
}