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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/source_frame/SourceFrame.js

Issue 2281703002: DevTools: Create TextEditor Interface around CodeMirrorTextEditor (Closed)
Patch Set: Remove accidental devtools.gypi Created 4 years, 3 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
OLDNEW
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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 /** 503 /**
504 * @override 504 * @override
505 * @param {!WebInspector.SearchableView.SearchConfig} searchConfig 505 * @param {!WebInspector.SearchableView.SearchConfig} searchConfig
506 * @param {string} replacement 506 * @param {string} replacement
507 */ 507 */
508 replaceAllWith: function(searchConfig, replacement) 508 replaceAllWith: function(searchConfig, replacement)
509 { 509 {
510 this._resetCurrentSearchResultIndex(); 510 this._resetCurrentSearchResultIndex();
511 511
512 var text = this._textEditor.text(); 512 var text = this._textEditor.text();
513 var range = this._textEditor.range(); 513 var range = this._textEditor.fullRange();
514 514
515 var regex = searchConfig.toSearchRegex(true); 515 var regex = searchConfig.toSearchRegex(true);
516 if (regex.__fromRegExpQuery) 516 if (regex.__fromRegExpQuery)
517 text = text.replace(regex, replacement); 517 text = text.replace(regex, replacement);
518 else 518 else
519 text = text.replace(regex, function() { return replacement; }); 519 text = text.replace(regex, function() { return replacement; });
520 520
521 var ranges = this._collectRegexMatches(regex); 521 var ranges = this._collectRegexMatches(regex);
522 if (!ranges.length) 522 if (!ranges.length)
523 return; 523 return;
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 _handleKeyDown: function(e) 644 _handleKeyDown: function(e)
645 { 645 {
646 var shortcutKey = WebInspector.KeyboardShortcut.makeKeyFromEvent(e); 646 var shortcutKey = WebInspector.KeyboardShortcut.makeKeyFromEvent(e);
647 var handler = this._shortcuts[shortcutKey]; 647 var handler = this._shortcuts[shortcutKey];
648 if (handler && handler()) 648 if (handler && handler())
649 e.consume(true); 649 e.consume(true);
650 }, 650 },
651 651
652 __proto__: WebInspector.SimpleView.prototype 652 __proto__: WebInspector.SimpleView.prototype
653 } 653 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698