mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-10 16:58:55 -05:00
@@ -48,6 +48,7 @@ export class MarkdownPreview {
|
||||
previewColumn, {
|
||||
enableScripts: true,
|
||||
enableCommandUris: true,
|
||||
enableFindWidget: true,
|
||||
localResourceRoots: this.getLocalResourceRoots(_resource)
|
||||
});
|
||||
|
||||
|
||||
7
src/vs/vscode.proposed.d.ts
vendored
7
src/vs/vscode.proposed.d.ts
vendored
@@ -528,6 +528,13 @@ declare module 'vscode' {
|
||||
*/
|
||||
readonly enableCommandUris?: boolean;
|
||||
|
||||
/**
|
||||
* Should the find widget be enabled in the webview?
|
||||
*
|
||||
* Defaults to false.
|
||||
*/
|
||||
readonly enableFindWidget?: boolean;
|
||||
|
||||
/**
|
||||
* Should the webview's context be kept around even when the webview is no longer visible?
|
||||
*
|
||||
|
||||
@@ -84,7 +84,7 @@ export class ReleaseNotesManager {
|
||||
}
|
||||
} else {
|
||||
const uri = URI.parse('release-notes:' + version);
|
||||
this._currentReleaseNotes = new WebviewInput(uri, title, { tryRestoreScrollPosition: true }, html, {
|
||||
this._currentReleaseNotes = new WebviewInput(uri, title, { tryRestoreScrollPosition: true, enableFindWidget: true }, html, {
|
||||
onDidClickLink: uri => this.onDidClickLink(uri),
|
||||
onDispose: () => { this._currentReleaseNotes = undefined; }
|
||||
}, this._partService);
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IDisposable, } from 'vs/base/common/lifecycle';
|
||||
import { EditorOptions } from 'vs/workbench/common/editor';
|
||||
@@ -199,10 +197,12 @@ export class WebviewEditor extends BaseWebviewEditor {
|
||||
this._onDidFocusWebview.fire();
|
||||
});
|
||||
|
||||
this._contextKeyService = this._contextKeyService.createScoped(this.webviewContent);
|
||||
this.contextKey = KEYBINDING_CONTEXT_WEBVIEWEDITOR_FOCUS.bindTo(this._contextKeyService);
|
||||
this.findInputFocusContextKey = KEYBINDING_CONTEXT_WEBVIEWEDITOR_FIND_WIDGET_INPUT_FOCUSED.bindTo(this._contextKeyService);
|
||||
this.findWidgetVisible = KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE.bindTo(this._contextKeyService);
|
||||
if (input.options.enableFindWidget) {
|
||||
this._contextKeyService = this._contextKeyService.createScoped(this.webviewContent);
|
||||
this.contextKey = KEYBINDING_CONTEXT_WEBVIEWEDITOR_FOCUS.bindTo(this._contextKeyService);
|
||||
this.findInputFocusContextKey = KEYBINDING_CONTEXT_WEBVIEWEDITOR_FIND_WIDGET_INPUT_FOCUSED.bindTo(this._contextKeyService);
|
||||
this.findWidgetVisible = KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE.bindTo(this._contextKeyService);
|
||||
}
|
||||
|
||||
this._webview = new Webview(
|
||||
this._partService.getContainer(Parts.EDITOR_PART),
|
||||
|
||||
Reference in New Issue
Block a user