提交 42fa7d77 编写于 作者: A Alex Dima

Fix replace not working in untitled file

上级 2e3358d5
......@@ -95,6 +95,20 @@ export class FindWidget extends Widget implements EditorBrowser.IOverlayWidget {
this.focusTracker = this._register(DomUtils.trackFocus(this._findInput.inputBox.inputElement));
this.focusTracker.addFocusListener(() => this._reseedFindScope());
let updateCanReplace = () => {
let canReplace = !this._codeEditor.getConfiguration().readOnly;
DomUtils.toggleClass(this._domNode, 'can-replace', canReplace);
if (!canReplace) {
this._state.change({ isReplaceRevealed: false }, false);
}
};
this._register(this._codeEditor.addListener2(EditorCommon.EventType.ConfigurationChanged, (e:EditorCommon.IConfigurationChangedEvent) => {
if (e.readOnly) {
updateCanReplace();
}
}));
updateCanReplace();
this._codeEditor.addOverlayWidget(this);
}
......@@ -513,10 +527,6 @@ export class FindWidget extends Widget implements EditorBrowser.IOverlayWidget {
this._domNode.className = 'editor-widget find-widget';
this._domNode.setAttribute('aria-hidden', 'false');
if (!this._codeEditor.getConfiguration().readOnly) {
DomUtils.addClass(this._domNode, 'can-replace');
}
this._domNode.appendChild(this._toggleReplaceBtn.domNode);
this._domNode.appendChild(findPart);
this._domNode.appendChild(replacePart);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册