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

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

Issue 704243002: DevTools: Fix initial match index showing in sources panel editor search. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 * @param {function(!WebInspector.View, number)} searchFinishedCallback 417 * @param {function(!WebInspector.View, number)} searchFinishedCallback
418 */ 418 */
419 _doFindSearchMatches: function(searchConfig, shouldJump, jumpBackwards, sear chFinishedCallback) 419 _doFindSearchMatches: function(searchConfig, shouldJump, jumpBackwards, sear chFinishedCallback)
420 { 420 {
421 this._currentSearchResultIndex = -1; 421 this._currentSearchResultIndex = -1;
422 this._searchResults = []; 422 this._searchResults = [];
423 423
424 var regex = WebInspector.SourceFrame._createSearchRegexForConfig(searchC onfig); 424 var regex = WebInspector.SourceFrame._createSearchRegexForConfig(searchC onfig);
425 this._searchRegex = regex; 425 this._searchRegex = regex;
426 this._searchResults = this._collectRegexMatches(regex); 426 this._searchResults = this._collectRegexMatches(regex);
427 searchFinishedCallback(this, this._searchResults.length);
427 if (!this._searchResults.length) 428 if (!this._searchResults.length)
428 this._textEditor.cancelSearchResultsHighlight(); 429 this._textEditor.cancelSearchResultsHighlight();
429 else if (shouldJump && jumpBackwards) 430 else if (shouldJump && jumpBackwards)
430 this.jumpToPreviousSearchResult(); 431 this.jumpToPreviousSearchResult();
431 else if (shouldJump) 432 else if (shouldJump)
432 this.jumpToNextSearchResult(); 433 this.jumpToNextSearchResult();
433 else 434 else
434 this._textEditor.highlightSearchResults(regex, null); 435 this._textEditor.highlightSearchResults(regex, null);
435 searchFinishedCallback(this, this._searchResults.length);
436 }, 436 },
437 437
438 /** 438 /**
439 * @param {!WebInspector.SearchableView.SearchConfig} searchConfig 439 * @param {!WebInspector.SearchableView.SearchConfig} searchConfig
440 * @param {boolean} shouldJump 440 * @param {boolean} shouldJump
441 * @param {boolean} jumpBackwards 441 * @param {boolean} jumpBackwards
442 * @param {function(!WebInspector.View, number)} searchFinishedCallback 442 * @param {function(!WebInspector.View, number)} searchFinishedCallback
443 * @param {function(number)} currentMatchChangedCallback 443 * @param {function(number)} currentMatchChangedCallback
444 * @param {function()} searchResultsChangedCallback 444 * @param {function()} searchResultsChangedCallback
445 */ 445 */
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 1008
1009 /** 1009 /**
1010 * @param {?WebInspector.TextRange} from 1010 * @param {?WebInspector.TextRange} from
1011 * @param {?WebInspector.TextRange} to 1011 * @param {?WebInspector.TextRange} to
1012 */ 1012 */
1013 onJumpToPosition: function(from, to) 1013 onJumpToPosition: function(from, to)
1014 { 1014 {
1015 this._sourceFrame.onJumpToPosition(from, to); 1015 this._sourceFrame.onJumpToPosition(from, to);
1016 } 1016 }
1017 } 1017 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698