OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 1696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1707 this._anchorBox = this._anchorBoxForPosition(cursor.line, cursor.ch)
; | 1707 this._anchorBox = this._anchorBoxForPosition(cursor.line, cursor.ch)
; |
1708 this._suggestBox.setPosition(this._anchorBox); | 1708 this._suggestBox.setPosition(this._anchorBox); |
1709 } | 1709 } |
1710 }, | 1710 }, |
1711 | 1711 |
1712 _onCursorActivity: function() | 1712 _onCursorActivity: function() |
1713 { | 1713 { |
1714 if (!this._suggestBox) | 1714 if (!this._suggestBox) |
1715 return; | 1715 return; |
1716 var cursor = this._codeMirror.getCursor(); | 1716 var cursor = this._codeMirror.getCursor(); |
1717 if (cursor.line !== this._prefixRange.startLine || cursor.ch > this._pre
fixRange.endColumn || cursor.ch < this._prefixRange.startColumn) | 1717 if (cursor.line !== this._prefixRange.startLine || cursor.ch > this._pre
fixRange.endColumn || cursor.ch <= this._prefixRange.startColumn) |
1718 this.finishAutocomplete(); | 1718 this.finishAutocomplete(); |
1719 }, | 1719 }, |
1720 | 1720 |
1721 /** | 1721 /** |
1722 * @param {number} line | 1722 * @param {number} line |
1723 * @param {number} column | 1723 * @param {number} column |
1724 * @return {?AnchorBox} | 1724 * @return {?AnchorBox} |
1725 */ | 1725 */ |
1726 _anchorBoxForPosition: function(line, column) | 1726 _anchorBoxForPosition: function(line, column) |
1727 { | 1727 { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1771 var backgroundColorRule = backgroundColor ? ".CodeMirror .CodeMirror-selecte
d { background-color: " + backgroundColor + ";}" : ""; | 1771 var backgroundColorRule = backgroundColor ? ".CodeMirror .CodeMirror-selecte
d { background-color: " + backgroundColor + ";}" : ""; |
1772 var foregroundColor = InspectorFrontendHost.getSelectionForegroundColor(); | 1772 var foregroundColor = InspectorFrontendHost.getSelectionForegroundColor(); |
1773 var foregroundColorRule = foregroundColor ? ".CodeMirror .CodeMirror-selecte
dtext:not(.CodeMirror-persist-highlight) { color: " + foregroundColor + "!import
ant;}" : ""; | 1773 var foregroundColorRule = foregroundColor ? ".CodeMirror .CodeMirror-selecte
dtext:not(.CodeMirror-persist-highlight) { color: " + foregroundColor + "!import
ant;}" : ""; |
1774 if (!foregroundColorRule && !backgroundColorRule) | 1774 if (!foregroundColorRule && !backgroundColorRule) |
1775 return; | 1775 return; |
1776 | 1776 |
1777 var style = document.createElement("style"); | 1777 var style = document.createElement("style"); |
1778 style.textContent = backgroundColorRule + foregroundColorRule; | 1778 style.textContent = backgroundColorRule + foregroundColorRule; |
1779 document.head.appendChild(style); | 1779 document.head.appendChild(style); |
1780 })(); | 1780 })(); |
OLD | NEW |