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

Unified Diff: Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js

Issue 669043002: DevTools: Fix the way search works when switching between editor tabs. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Comments addressed Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js
diff --git a/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js b/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js
index 70f5a7b8389ef7df5ee343593ef0076299c9f612..981557827453f96bc25888c9344c0c94f8d18e66 100644
--- a/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js
+++ b/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js
@@ -555,6 +555,11 @@ WebInspector.CodeMirrorTextEditor.prototype = {
this._codeMirror.refresh();
},
+ willHide: function()
+ {
+ delete this._editorSizeInSync;
+ },
+
_guessIndentationLevel: function()
{
var tabRegex = /^\t+/;
@@ -1182,6 +1187,11 @@ WebInspector.CodeMirrorTextEditor.prototype = {
{
this._autocompleteController.finishAutocomplete();
this._resizeEditor();
+ this._editorSizeInSync = true;
+ if (this._selectionSetScheduled) {
+ delete this._selectionSetScheduled;
+ this.setSelection(this._lastSelection);
+ }
},
/**
@@ -1387,6 +1397,10 @@ WebInspector.CodeMirrorTextEditor.prototype = {
setSelection: function(textRange)
{
this._lastSelection = textRange;
+ if (!this._editorSizeInSync) {
+ this._selectionSetScheduled = true;
+ return;
+ }
var pos = WebInspector.CodeMirrorUtils.toPos(textRange);
this._codeMirror.setSelection(pos.start, pos.end);
},
« no previous file with comments | « Source/devtools/front_end/components/SearchableView.js ('k') | Source/devtools/front_end/source_frame/SourceFrame.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698