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

Side by Side Diff: Source/devtools/front_end/TextRange.js

Issue 23474010: DevTools: "Jump between editing locations" experiment (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaseline this patch Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/TextEditor.js ('k') | Source/devtools/front_end/UISourceCodeFrame.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 if (this.startLine < other.startLine) 147 if (this.startLine < other.startLine)
148 return -1; 148 return -1;
149 if (this.startColumn > other.startColumn) 149 if (this.startColumn > other.startColumn)
150 return 1; 150 return 1;
151 if (this.startColumn < other.startColumn) 151 if (this.startColumn < other.startColumn)
152 return -1; 152 return -1;
153 return 0; 153 return 0;
154 }, 154 },
155 155
156 /** 156 /**
157 * @param {!WebInspector.TextRange} other
158 * @return {boolean}
159 */
160 equal: function(other)
161 {
162 return this.startLine === other.startLine && this.endLine === other.endL ine &&
163 this.startColumn === other.startColumn && this.endColumn === other.e ndColumn;
164 },
165
166 /**
157 * @param {number} lineOffset 167 * @param {number} lineOffset
158 * @return {!WebInspector.TextRange} 168 * @return {!WebInspector.TextRange}
159 */ 169 */
160 shift: function(lineOffset) 170 shift: function(lineOffset)
161 { 171 {
162 return new WebInspector.TextRange(this.startLine + lineOffset, this.star tColumn, this.endLine + lineOffset, this.endColumn); 172 return new WebInspector.TextRange(this.startLine + lineOffset, this.star tColumn, this.endLine + lineOffset, this.endColumn);
163 }, 173 },
164 174
165 /** 175 /**
166 * @return {string} 176 * @return {string}
167 */ 177 */
168 toString: function() 178 toString: function()
169 { 179 {
170 return JSON.stringify(this); 180 return JSON.stringify(this);
171 } 181 }
172 } 182 }
173 183
174 /** 184 /**
175 * @constructor 185 * @constructor
176 * @param {number} offset 186 * @param {number} offset
177 * @param {number} length 187 * @param {number} length
178 */ 188 */
179 WebInspector.SourceRange = function(offset, length) 189 WebInspector.SourceRange = function(offset, length)
180 { 190 {
181 this.offset = offset; 191 this.offset = offset;
182 this.length = length; 192 this.length = length;
183 } 193 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/TextEditor.js ('k') | Source/devtools/front_end/UISourceCodeFrame.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698