提交 f3e1716d 编写于 作者: J jeanp413

Fixes #89562

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