Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion build/linux/debian/dep-lists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ export const referenceGeneratedDepsByArch = {
'libatk-bridge2.0-0 (>= 2.5.3)',
'libatk1.0-0 (>= 2.11.90)',
'libatspi2.0-0 (>= 2.9.90)',
'libc6 (>= 2.15)',
'libc6 (>= 2.16)',
'libc6 (>= 2.17)',
'libc6 (>= 2.25)',
Expand Down
45 changes: 23 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "code-oss-dev",
"version": "1.109.0",
"distro": "f84811280304020eab0bbc930e85b8f2180b1ed6",
"distro": "ce89ce05183635114ccfc46870d71ec520727c8e",
"author": {
"name": "Microsoft Corporation"
},
Expand Down Expand Up @@ -83,7 +83,7 @@
"@vscode/proxy-agent": "^0.36.0",
"@vscode/ripgrep": "^1.15.13",
"@vscode/spdlog": "^0.15.2",
"@vscode/sqlite3": "5.1.10-vscode",
"@vscode/sqlite3": "5.1.11-vscode",
"@vscode/sudo-prompt": "9.3.2",
"@vscode/tree-sitter-wasm": "^0.3.0",
"@vscode/vscode-languagedetection": "1.0.21",
Expand Down Expand Up @@ -240,4 +240,4 @@
"optionalDependencies": {
"windows-foreground-love": "0.5.0"
}
}
}
25 changes: 13 additions & 12 deletions remote/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/vs/base/common/buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export function binaryIndexOf(haystack: Uint8Array, needle: Uint8Array, offset =
}

if (needleLen === 1) {
return haystack.indexOf(needle[0]);
return haystack.indexOf(needle[0], offset);
}

if (needleLen > haystackLen - offset) {
Expand Down
2 changes: 2 additions & 0 deletions src/vs/base/test/common/buffer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,12 @@ suite('Buffer', () => {

assert.strictEqual(haystack.indexOf(VSBuffer.fromString('a')), 0);
assert.strictEqual(haystack.indexOf(VSBuffer.fromString('c')), 2);
assert.strictEqual(haystack.indexOf(VSBuffer.fromString('c'), 4), 7);

assert.strictEqual(haystack.indexOf(VSBuffer.fromString('abcaa')), 0);
assert.strictEqual(haystack.indexOf(VSBuffer.fromString('caaab')), 8);
assert.strictEqual(haystack.indexOf(VSBuffer.fromString('ccc')), 15);
assert.strictEqual(haystack.indexOf(VSBuffer.fromString('cc'), 9), 15);

assert.strictEqual(haystack.indexOf(VSBuffer.fromString('cccb')), -1);
});
Expand Down
13 changes: 10 additions & 3 deletions src/vs/editor/contrib/hover/browser/contentHoverController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { IKeybindingService } from '../../../../platform/keybinding/common/keybi
import { ResultKind } from '../../../../platform/keybinding/common/keybindingResolver.js';
import { HoverVerbosityAction } from '../../../common/languages.js';
import { RunOnceScheduler } from '../../../../base/common/async.js';
import { isMousePositionWithinElement, shouldShowHover } from './hoverUtils.js';
import { isMousePositionWithinElement, shouldShowHover, isTriggerModifierPressed } from './hoverUtils.js';
import { ContentHoverWidgetWrapper } from './contentHoverWidgetWrapper.js';
import './hover.css';
import { Emitter } from '../../../../base/common/event.js';
Expand Down Expand Up @@ -266,12 +266,19 @@ export class ContentHoverController extends Disposable implements IEditorContrib
}

private _onKeyDown(e: IKeyboardEvent): void {
if (this._ignoreMouseEvents) {
if (this._ignoreMouseEvents || !this._contentWidget) {
return;
}
if (!this._contentWidget) {

if (this._hoverSettings.enabled === 'onKeyboardModifier'
&& isTriggerModifierPressed(this._editor.getOption(EditorOption.multiCursorModifier), e)
&& this._mouseMoveEvent) {
if (!this._contentWidget.isVisible) {
this._contentWidget.showsOrWillShow(this._mouseMoveEvent);
}
return;
}

const isPotentialKeyboardShortcut = this._isPotentialKeyboardShortcut(e);
const isModifierKeyPressed = isModifierKey(e.keyCode);
if (isPotentialKeyboardShortcut || isModifierKeyPressed) {
Expand Down
10 changes: 9 additions & 1 deletion src/vs/editor/contrib/hover/browser/glyphHoverController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { IEditorContribution, IScrollEvent } from '../../../common/editorCommon.
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
import { IHoverWidget } from './hoverTypes.js';
import { RunOnceScheduler } from '../../../../base/common/async.js';
import { isMousePositionWithinElement, shouldShowHover } from './hoverUtils.js';
import { isMousePositionWithinElement, isTriggerModifierPressed, shouldShowHover } from './hoverUtils.js';
import './hover.css';
import { GlyphHoverWidget } from './glyphHoverWidget.js';

Expand Down Expand Up @@ -206,6 +206,14 @@ export class GlyphHoverController extends Disposable implements IEditorContribut
if (!this._editor.hasModel()) {
return;
}

if (this._hoverSettings.enabled === 'onKeyboardModifier'
&& isTriggerModifierPressed(this._editor.getOption(EditorOption.multiCursorModifier), e)
&& this._mouseMoveEvent) {
this._tryShowHoverWidget(this._mouseMoveEvent);
return;
}

if (isModifierKey(e.keyCode)) {
// Do not hide hover when a modifier key is pressed
return;
Expand Down
16 changes: 13 additions & 3 deletions src/vs/editor/contrib/hover/browser/hoverUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,19 @@ export function shouldShowHover(
if (hoverEnabled === 'off') {
return false;
}
return isTriggerModifierPressed(multiCursorModifier, mouseEvent.event);
}

/**
* Returns true if the trigger modifier (inverse of multi-cursor modifier) is pressed.
* This works with both mouse and keyboard events by relying only on the modifier flags.
*/
export function isTriggerModifierPressed(
multiCursorModifier: 'altKey' | 'ctrlKey' | 'metaKey',
event: { ctrlKey: boolean; metaKey: boolean; altKey: boolean }
): boolean {
if (multiCursorModifier === 'altKey') {
return mouseEvent.event.ctrlKey || mouseEvent.event.metaKey;
} else {
return mouseEvent.event.altKey;
return event.ctrlKey || event.metaKey;
}
return event.altKey; // multiCursorModifier is ctrlKey or metaKey
}
Loading
Loading