OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * Copyright (C) 2010 Apple Inc. All rights reserved. | 3 * Copyright (C) 2010 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1422 return null; | 1422 return null; |
1423 var highlight = this._textModel.getAttribute(lineNumber, "highlight"); | 1423 var highlight = this._textModel.getAttribute(lineNumber, "highlight"); |
1424 if (!highlight) | 1424 if (!highlight) |
1425 return this._tokenAtUnhighlightedLine(line, column); | 1425 return this._tokenAtUnhighlightedLine(line, column); |
1426 function compare(value, object) | 1426 function compare(value, object) |
1427 { | 1427 { |
1428 if (value >= object.startColumn && value <= object.endColumn) | 1428 if (value >= object.startColumn && value <= object.endColumn) |
1429 return 0; | 1429 return 0; |
1430 return value - object.startColumn; | 1430 return value - object.startColumn; |
1431 } | 1431 } |
1432 var index = binarySearch(column, highlight.ranges, compare); | 1432 var index = highlight.ranges.binaryIndexOf(column, compare); |
1433 if (index >= 0) { | 1433 if (index >= 0) { |
1434 var range = highlight.ranges[index]; | 1434 var range = highlight.ranges[index]; |
1435 return { | 1435 return { |
1436 startColumn: range.startColumn, | 1436 startColumn: range.startColumn, |
1437 endColumn: range.endColumn, | 1437 endColumn: range.endColumn, |
1438 type: range.token | 1438 type: range.token |
1439 }; | 1439 }; |
1440 } | 1440 } |
1441 return null; | 1441 return null; |
1442 }, | 1442 }, |
(...skipping 2330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3773 var braces = this._braceMatcher.enclosingBraces(lineNumber, column); | 3773 var braces = this._braceMatcher.enclosingBraces(lineNumber, column); |
3774 if (braces && braces.rightBrace.lineNumber === lineNumber && braces.righ
tBrace.column === column) { | 3774 if (braces && braces.rightBrace.lineNumber === lineNumber && braces.righ
tBrace.column === column) { |
3775 this._mainPanel.setSelection(WebInspector.TextRange.createFromLocati
on(lineNumber, column + 1)); | 3775 this._mainPanel.setSelection(WebInspector.TextRange.createFromLocati
on(lineNumber, column + 1)); |
3776 return true; | 3776 return true; |
3777 } else | 3777 } else |
3778 return false; | 3778 return false; |
3779 }, | 3779 }, |
3780 } | 3780 } |
3781 | 3781 |
3782 WebInspector.debugDefaultTextEditor = false; | 3782 WebInspector.debugDefaultTextEditor = false; |
OLD | NEW |