Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1013)

Unified Diff: Source/devtools/front_end/CodeMirrorUtils.js

Issue 235933007: DevTools: [CodeMirror] collapse single selection on esc key (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: simplify code Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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}

Powered by Google App Engine
This is Rietveld 408576698