提交 f3e1716d 编写于 作者: J jeanp413

Fixes #89562

上级 9bc92b48
......@@ -48,6 +48,9 @@ import { textLinkForeground } from 'vs/platform/theme/common/colorRegistry';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { OS, OperatingSystem } from 'vs/base/common/platform';
import { IFileService } from 'vs/platform/files/common/files';
import { domEvent } from 'vs/base/browser/event';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { KeyCode } from 'vs/base/common/keyCodes';
export type TreeElement = ResourceMarkers | Marker | RelatedInformation;
......@@ -374,14 +377,21 @@ class MarkerWidget extends Disposable {
dom.append(parent, this._codeLink);
this._codeLink.setAttribute('href', codeLink);
this._codeLink.onclick = (e) => {
e.preventDefault();
if ((this._clickModifierKey === 'meta' && e.metaKey) || (this._clickModifierKey === 'ctrl' && e.ctrlKey) || (this._clickModifierKey === 'alt' && e.altKey)) {
this._openerService.open(codeUri);
e.stopPropagation();
}
};
this._codeLink.tabIndex = 0;
const onClick = Event.chain(domEvent(this._codeLink, 'click'))
.filter(e => ((this._clickModifierKey === 'meta' && e.metaKey) || (this._clickModifierKey === 'ctrl' && e.ctrlKey) || (this._clickModifierKey === 'alt' && e.altKey)))
.event;
const onEnterPress = Event.chain(domEvent(this._codeLink, 'keydown'))
.map(e => new StandardKeyboardEvent(e))
.filter(e => e.keyCode === KeyCode.Enter)
.event;
const onOpen = Event.any<dom.EventLike>(onClick, onEnterPress);
this._register(onOpen(e => {
dom.EventHelper.stop(e, true);
this._openerService.open(codeUri);
}));
const code = new HighlightedLabel(dom.append(this._codeLink, dom.$('.marker-code')), false);
const codeMatches = filterData && filterData.codeMatches || [];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册