Index: Source/devtools/front_end/CodeMirrorUtils.js |
diff --git a/Source/devtools/front_end/CodeMirrorUtils.js b/Source/devtools/front_end/CodeMirrorUtils.js |
index 7db1f686515d59a8af64b382d2bb7b617f40b862..ccc569347f220f8aff0f6a39c9ee8f52c48c5c50 100644 |
--- a/Source/devtools/front_end/CodeMirrorUtils.js |
+++ b/Source/devtools/front_end/CodeMirrorUtils.js |
@@ -37,6 +37,29 @@ WebInspector.CodeMirrorUtils = function() |
WebInspector.InplaceEditor.call(this); |
} |
+/** |
+ * @param {!WebInspector.TextRange} range |
+ * @return {!{start: !CodeMirror.Pos, end: !CodeMirror.Pos}} |
+ */ |
+WebInspector.CodeMirrorUtils.toPos = function(range) |
+{ |
+ return { |
+ start: new CodeMirror.Pos(range.startLine, range.startColumn), |
+ end: new CodeMirror.Pos(range.endLine, range.endColumn) |
+ } |
+}, |
+ |
+/** |
+ * @param {!CodeMirror.Pos} start |
+ * @param {!CodeMirror.Pos} end |
+ * @return {!WebInspector.TextRange} |
+ */ |
+WebInspector.CodeMirrorUtils.toRange = function(start, end) |
+{ |
+ return new WebInspector.TextRange(start.line, start.ch, end.line, end.ch); |
+}, |
+ |
+ |
WebInspector.CodeMirrorUtils.prototype = { |
/** |
* @return {string} |