OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 this._level = null; | 852 this._level = null; |
853 } | 853 } |
854 | 854 |
855 WebInspector.SourceFrame.RowMessageBucket.prototype = { | 855 WebInspector.SourceFrame.RowMessageBucket.prototype = { |
856 /** | 856 /** |
857 * @param {number} lineNumber | 857 * @param {number} lineNumber |
858 * @param {number} columnNumber | 858 * @param {number} columnNumber |
859 */ | 859 */ |
860 _updateWavePosition: function(lineNumber, columnNumber) | 860 _updateWavePosition: function(lineNumber, columnNumber) |
861 { | 861 { |
| 862 lineNumber = Math.min(lineNumber, this._textEditor.linesCount - 1); |
862 var lineText = this._textEditor.line(lineNumber); | 863 var lineText = this._textEditor.line(lineNumber); |
| 864 columnNumber = Math.min(columnNumber, lineText.length); |
863 var lineIndent = WebInspector.TextUtils.lineIndent(lineText).length; | 865 var lineIndent = WebInspector.TextUtils.lineIndent(lineText).length; |
864 var base = this._textEditor.cursorPositionToCoordinates(lineNumber, 0); | 866 var base = this._textEditor.cursorPositionToCoordinates(lineNumber, 0); |
865 | 867 |
866 var start = this._textEditor.cursorPositionToCoordinates(lineNumber, Mat
h.max(columnNumber - 1, lineIndent)); | 868 var start = this._textEditor.cursorPositionToCoordinates(lineNumber, Mat
h.max(columnNumber - 1, lineIndent)); |
867 var end = this._textEditor.cursorPositionToCoordinates(lineNumber, lineT
ext.length); | 869 var end = this._textEditor.cursorPositionToCoordinates(lineNumber, lineT
ext.length); |
868 /** @const */ | 870 /** @const */ |
869 var codeMirrorLinesLeftPadding = 4; | 871 var codeMirrorLinesLeftPadding = 4; |
870 this._wave.style.left = (start.x - base.x + codeMirrorLinesLeftPadding)
+ "px"; | 872 this._wave.style.left = (start.x - base.x + codeMirrorLinesLeftPadding)
+ "px"; |
871 this._wave.style.width = (end.x - start.x) + "px"; | 873 this._wave.style.width = (end.x - start.x) + "px"; |
872 }, | 874 }, |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 | 1050 |
1049 /** | 1051 /** |
1050 * @param {!WebInspector.SourceFrameMessage} a | 1052 * @param {!WebInspector.SourceFrameMessage} a |
1051 * @param {!WebInspector.SourceFrameMessage} b | 1053 * @param {!WebInspector.SourceFrameMessage} b |
1052 * @return {number} | 1054 * @return {number} |
1053 */ | 1055 */ |
1054 WebInspector.SourceFrameMessage.messageLevelComparator = function(a, b) | 1056 WebInspector.SourceFrameMessage.messageLevelComparator = function(a, b) |
1055 { | 1057 { |
1056 return WebInspector.SourceFrameMessage._messageLevelPriority[a.level()] - We
bInspector.SourceFrameMessage._messageLevelPriority[b.level()]; | 1058 return WebInspector.SourceFrameMessage._messageLevelPriority[a.level()] - We
bInspector.SourceFrameMessage._messageLevelPriority[b.level()]; |
1057 } | 1059 } |
OLD | NEW |