Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js b/third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js |
| index 51bc5562847791c2893962fcfa54ffad9ced9824..da1cb2c41dc2e3d6782ac2f2cef15bdc771b36a5 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js |
| @@ -964,6 +964,24 @@ WebInspector.CodeMirrorTextEditor.prototype = { |
| }, |
| /** |
| + * @param {string} key |
| + * @param {*} value |
| + */ |
| + setState: function(key, value) |
|
lushnikov
2016/06/27 15:47:52
why is this public?
|
| + { |
| + if (this._codeMirror.state) |
| + this._codeMirror.state[key] = value; |
|
lushnikov
2016/06/27 15:47:52
the "codeMirror.state" seems to be a part of CM in
|
| + }, |
| + |
| + /** |
| + * @return {!Object} |
| + */ |
| + getState: function() |
| + { |
| + return this._codeMirror.state || {}; |
| + }, |
| + |
| + /** |
| * @param {boolean} readOnly |
| */ |
| setReadOnly: function(readOnly) |
| @@ -2053,9 +2071,12 @@ WebInspector.CodeMirrorTextEditor.SelectNextOccurrenceController.prototype = { |
| undoLastSelection: function() |
| { |
| + var wasSuppressingEdits = this._textEditor.getState()["suppressEdits"]; |
| + this._textEditor.setState("suppressEdits", false); |
| this._muteSelectionListener = true; |
| this._codeMirror.execCommand("undoSelection"); |
| this._muteSelectionListener = false; |
| + this._textEditor.setState("suppressEdits", wasSuppressingEdits); |
| }, |
| selectNextOccurrence: function() |