Skip to content

Commit 45a7031

Browse files
authored
Merge branch 'main' into tyriar/utility_ptyhost__2
2 parents b725a17 + f47327f commit 45a7031

File tree

77 files changed

+3768
-2002
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+3768
-2002
lines changed

extensions/git/package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2706,6 +2706,14 @@
27062706
"default": "prompt",
27072707
"markdownDescription": "%config.openRepositoryInParentFolders%",
27082708
"scope": "resource"
2709+
},
2710+
"git.similarityThreshold": {
2711+
"type": "number",
2712+
"default": 50,
2713+
"minimum": 0,
2714+
"maximum": 100,
2715+
"description": "%config.similarityThreshold%",
2716+
"scope": "resource"
27092717
}
27102718
}
27112719
},

extensions/git/package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@
252252
"config.publishBeforeContinueOn.always": "Always publish unpublished git state when using Continue Working On from a git repository",
253253
"config.publishBeforeContinueOn.never": "Never publish unpublished git state when using Continue Working On from a git repository",
254254
"config.publishBeforeContinueOn.prompt": "Prompt to publish unpublished git state when using Continue Working On from a git repository",
255+
"config.similarityThreshold": "Controls the threshold of the similarity index (i.e. amount of additions/deletions compared to the file's size) for changes in a pair of added/deleted files to be considered a rename.",
255256
"submenu.explorer": "Git",
256257
"submenu.commit": "Commit",
257258
"submenu.commit.amend": "Amend",

extensions/git/src/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ function getCheckoutProcessor(repository: Repository, type: string): CheckoutPro
308308
}
309309

310310
function sanitizeBranchName(name: string, whitespaceChar: string): string {
311-
return name.trim().replace(/^-+/, '').replace(/^\.|\/\.|\.\.|~|\^|:|\/$|\.lock$|\.lock\/|\\|\*|\s|^\s*$|\.$|\[|\]$/g, whitespaceChar);
311+
return name ? name.trim().replace(/^-+/, '').replace(/^\.|\/\.|\.\.|~|\^|:|\/$|\.lock$|\.lock\/|\\|\*|\s|^\s*$|\.$|\[|\]$/g, whitespaceChar) : name;
312312
}
313313

314314
function sanitizeRemoteName(name: string) {

extensions/git/src/git.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2000,7 +2000,7 @@ export class Repository {
20002000
}
20012001
}
20022002

2003-
async getStatus(opts?: { limit?: number; ignoreSubmodules?: boolean; untrackedChanges?: 'mixed' | 'separate' | 'hidden'; cancellationToken?: CancellationToken }): Promise<{ status: IFileStatus[]; statusLength: number; didHitLimit: boolean }> {
2003+
async getStatus(opts?: { limit?: number; ignoreSubmodules?: boolean; similarityThreshold?: number; untrackedChanges?: 'mixed' | 'separate' | 'hidden'; cancellationToken?: CancellationToken }): Promise<{ status: IFileStatus[]; statusLength: number; didHitLimit: boolean }> {
20042004
if (opts?.cancellationToken && opts?.cancellationToken.isCancellationRequested) {
20052005
throw new CancellationError();
20062006
}
@@ -2020,6 +2020,10 @@ export class Repository {
20202020
args.push('--ignore-submodules');
20212021
}
20222022

2023+
if (opts?.similarityThreshold) {
2024+
args.push(`--find-renames=${opts.similarityThreshold}%`);
2025+
}
2026+
20232027
const child = this.stream(args, { env });
20242028

20252029
let result = new Promise<{ status: IFileStatus[]; statusLength: number; didHitLimit: boolean }>((c, e) => {

extensions/git/src/repository.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2056,9 +2056,10 @@ export class Repository implements Disposable {
20562056
const ignoreSubmodules = scopedConfig.get<boolean>('ignoreSubmodules');
20572057

20582058
const limit = scopedConfig.get<number>('statusLimit', 10000);
2059+
const similarityThreshold = scopedConfig.get<number>('similarityThreshold', 50);
20592060

20602061
const start = new Date().getTime();
2061-
const { status, statusLength, didHitLimit } = await this.repository.getStatus({ limit, ignoreSubmodules, untrackedChanges, cancellationToken });
2062+
const { status, statusLength, didHitLimit } = await this.repository.getStatus({ limit, ignoreSubmodules, similarityThreshold, untrackedChanges, cancellationToken });
20622063
const totalTime = new Date().getTime() - start;
20632064

20642065
this.isRepositoryHuge = didHitLimit ? { limit } : false;

extensions/notebook-renderers/src/index.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,28 @@ function onScrollHandler(e: globalThis.Event) {
198198
}
199199
}
200200

201+
function onKeypressHandler(e: KeyboardEvent) {
202+
if (e.ctrlKey || e.shiftKey) {
203+
return;
204+
}
205+
if (e.code === 'ArrowDown' || e.code === 'End' || e.code === 'ArrowUp' || e.code === 'Home') {
206+
// These should change the scroll position, not adjust the selected cell in the notebook
207+
e.stopPropagation();
208+
}
209+
}
210+
201211
// if there is a scrollable output, it will be scrolled to the given value if provided or the bottom of the element
202212
function initializeScroll(scrollableElement: HTMLElement, disposables: DisposableStore, scrollTop?: number) {
203213
if (scrollableElement.classList.contains(scrollableClass)) {
204-
scrollableElement.classList.toggle('scrollbar-visible', scrollableElement.scrollHeight > scrollableElement.clientHeight);
214+
const scrollbarVisible = scrollableElement.scrollHeight > scrollableElement.clientHeight;
215+
scrollableElement.classList.toggle('scrollbar-visible', scrollbarVisible);
205216
scrollableElement.scrollTop = scrollTop !== undefined ? scrollTop : scrollableElement.scrollHeight;
206-
scrollableElement.addEventListener('scroll', onScrollHandler);
207-
disposables.push({ dispose: () => scrollableElement.removeEventListener('scroll', onScrollHandler) });
217+
if (scrollbarVisible) {
218+
scrollableElement.addEventListener('scroll', onScrollHandler);
219+
disposables.push({ dispose: () => scrollableElement.removeEventListener('scroll', onScrollHandler) });
220+
scrollableElement.addEventListener('keydown', onKeypressHandler);
221+
disposables.push({ dispose: () => scrollableElement.removeEventListener('keydown', onKeypressHandler) });
222+
}
208223
}
209224
}
210225

extensions/theme-abyss/themes/abyss-color-theme.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@
1717
}
1818
},
1919
{
20-
"name": "Comment",
21-
"scope": "comment",
20+
"name": "Comments",
21+
"scope": [
22+
"comment",
23+
"string.quoted.docstring"
24+
],
2225
"settings": {
2326
"foreground": "#384887"
2427
}

extensions/theme-defaults/themes/dark_vs.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@
5757
}
5858
},
5959
{
60-
"scope": "comment",
60+
"name": "Comments",
61+
"scope": [
62+
"comment",
63+
"string.quoted.docstring"
64+
],
6165
"settings": {
6266
"foreground": "#6A9955"
6367
}

extensions/theme-defaults/themes/hc_black.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@
4343
}
4444
},
4545
{
46-
"scope": "comment",
46+
"name": "Comments",
47+
"scope": [
48+
"comment",
49+
"string.quoted.docstring"
50+
],
4751
"settings": {
4852
"foreground": "#7ca668"
4953
}

extensions/theme-defaults/themes/hc_light.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@
2727
}
2828
},
2929
{
30-
"scope": "comment",
30+
"name": "Comments",
31+
"scope": [
32+
"comment",
33+
"string.quoted.docstring"
34+
],
3135
"settings": {
3236
"foreground": "#515151"
3337
}

0 commit comments

Comments
 (0)