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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 | 239 |
240 CodeMirror.commands.redoAndReveal = function(codemirror) | 240 CodeMirror.commands.redoAndReveal = function(codemirror) |
241 { | 241 { |
242 var scrollInfo = codemirror.getScrollInfo(); | 242 var scrollInfo = codemirror.getScrollInfo(); |
243 codemirror.execCommand("redo"); | 243 codemirror.execCommand("redo"); |
244 var cursor = codemirror.getCursor("start"); | 244 var cursor = codemirror.getCursor("start"); |
245 codemirror._codeMirrorTextEditor._innerRevealLine(cursor.line, scrollInfo); | 245 codemirror._codeMirrorTextEditor._innerRevealLine(cursor.line, scrollInfo); |
246 codemirror._codeMirrorTextEditor._autocompleteController.finishAutocomplete(
); | 246 codemirror._codeMirrorTextEditor._autocompleteController.finishAutocomplete(
); |
247 } | 247 } |
248 | 248 |
| 249 /** |
| 250 * @return {!Object|undefined} |
| 251 */ |
249 CodeMirror.commands.dismissMultipleSelections = function(codemirror) | 252 CodeMirror.commands.dismissMultipleSelections = function(codemirror) |
250 { | 253 { |
251 var selections = codemirror.listSelections(); | 254 var selections = codemirror.listSelections(); |
252 var selection = selections[0]; | 255 var selection = selections[0]; |
253 if (selections.length === 1) { | 256 if (selections.length === 1) { |
254 if (codemirror._codeMirrorTextEditor._isSearchActive()) | 257 if (codemirror._codeMirrorTextEditor._isSearchActive()) |
255 return CodeMirror.Pass; | 258 return CodeMirror.Pass; |
256 if (WebInspector.CodeMirrorUtils.toRange(selection.anchor, selection.hea
d).isEmpty()) | 259 if (WebInspector.CodeMirrorUtils.toRange(selection.anchor, selection.hea
d).isEmpty()) |
257 return CodeMirror.Pass; | 260 return CodeMirror.Pass; |
258 codemirror.setSelection(selection.anchor, selection.anchor, {scroll: fal
se}); | 261 codemirror.setSelection(selection.anchor, selection.anchor, {scroll: fal
se}); |
(...skipping 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2124 var backgroundColorRule = backgroundColor ? ".CodeMirror .CodeMirror-selecte
d { background-color: " + backgroundColor + ";}" : ""; | 2127 var backgroundColorRule = backgroundColor ? ".CodeMirror .CodeMirror-selecte
d { background-color: " + backgroundColor + ";}" : ""; |
2125 var foregroundColor = InspectorFrontendHost.getSelectionForegroundColor(); | 2128 var foregroundColor = InspectorFrontendHost.getSelectionForegroundColor(); |
2126 var foregroundColorRule = foregroundColor ? ".CodeMirror .CodeMirror-selecte
dtext:not(.CodeMirror-persist-highlight) { color: " + foregroundColor + "!import
ant;}" : ""; | 2129 var foregroundColorRule = foregroundColor ? ".CodeMirror .CodeMirror-selecte
dtext:not(.CodeMirror-persist-highlight) { color: " + foregroundColor + "!import
ant;}" : ""; |
2127 if (!foregroundColorRule && !backgroundColorRule) | 2130 if (!foregroundColorRule && !backgroundColorRule) |
2128 return; | 2131 return; |
2129 | 2132 |
2130 var style = document.createElement("style"); | 2133 var style = document.createElement("style"); |
2131 style.textContent = backgroundColorRule + foregroundColorRule; | 2134 style.textContent = backgroundColorRule + foregroundColorRule; |
2132 document.head.appendChild(style); | 2135 document.head.appendChild(style); |
2133 })(); | 2136 })(); |
OLD | NEW |