Skip to content

Commit f2bfdd7

Browse files
authored
TreeView - Tooltip markdown closing on pressing CTRL (microsoft#158922)
Fixes microsoft#158762
1 parent d5104dc commit f2bfdd7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/vs/workbench/services/hover/browser/hoverService.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import { HoverWidget } from 'vs/workbench/services/hover/browser/hoverWidget';
1414
import { IContextViewProvider, IDelegate } from 'vs/base/browser/ui/contextview/contextview';
1515
import { DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle';
1616
import { addDisposableListener, EventType } from 'vs/base/browser/dom';
17+
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
18+
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
1719

1820
export class HoverService implements IHoverService {
1921
declare readonly _serviceBrand: undefined;
@@ -24,7 +26,8 @@ export class HoverService implements IHoverService {
2426
constructor(
2527
@IInstantiationService private readonly _instantiationService: IInstantiationService,
2628
@IContextViewService private readonly _contextViewService: IContextViewService,
27-
@IContextMenuService contextMenuService: IContextMenuService
29+
@IContextMenuService contextMenuService: IContextMenuService,
30+
@IKeybindingService private readonly _keybindingService: IKeybindingService
2831
) {
2932
contextMenuService.onDidShowContextMenu(() => this.hideHover());
3033
}
@@ -102,6 +105,11 @@ export class HoverService implements IHoverService {
102105
hover.isLocked = true;
103106
return;
104107
}
108+
const event = new StandardKeyboardEvent(e);
109+
const keybinding = this._keybindingService.resolveKeyboardEvent(event);
110+
if (keybinding.getSingleModifierDispatchParts().some(value => !!value) || this._keybindingService.softDispatch(event, event.target)) {
111+
return;
112+
}
105113
this.hideHover();
106114
}
107115

0 commit comments

Comments
 (0)