Skip to content

Adding lineHeightsAdded array to onLinesInserted#289634

Merged
aiday-mar merged 9 commits intomainfrom
kind-meadowlark
Feb 11, 2026
Merged

Adding lineHeightsAdded array to onLinesInserted#289634
aiday-mar merged 9 commits intomainfrom
kind-meadowlark

Conversation

@aiday-mar
Copy link
Contributor

@aiday-mar aiday-mar commented Jan 22, 2026

fixes #285900

From the code:

              if (editingLinesCnt < insertingLinesCnt) {
					const injectedTextInEditedRangeQueue = new ArrayQueue(injectedTextInEditedRange);
					// Must insert some lines
					const spliceLineNumber = startLineNumber + editingLinesCnt;
					const cnt = insertingLinesCnt - editingLinesCnt;
					const fromLineNumber = newLineCount - lineCount - cnt + spliceLineNumber + 1;
					const injectedTexts: (LineInjectedText[] | null)[] = [];
					const newLines: string[] = [];
					for (let i = 0; i < cnt; i++) {
						const lineNumber = fromLineNumber + i;
						newLines[i] = this.getLineContent(lineNumber);

						injectedTextInEditedRangeQueue.takeWhile(r => r.lineNumber < lineNumber);
						injectedTexts[i] = injectedTextInEditedRangeQueue.takeWhile(r => r.lineNumber === lineNumber);
					}

					rawContentChanges.push(
						new ModelRawLinesInserted(
							spliceLineNumber + 1,
							startLineNumber + insertingLinesCnt,
							newLines,
							injectedTexts
						)
					);
				}

We see that the final line numbers to which the insertion is applied go from fromLineNumber to fromineNumber+cnt-1

Copilot AI review requested due to automatic review settings January 22, 2026 12:10
@aiday-mar aiday-mar self-assigned this Jan 22, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@aiday-mar aiday-mar requested a review from alexdima January 23, 2026 11:16
@aiday-mar aiday-mar marked this pull request as ready for review January 23, 2026 11:16
@vs-code-engineering vs-code-engineering bot added this to the January 2026 milestone Jan 23, 2026
@alexdima alexdima modified the milestones: January 2026, February 2026 Jan 30, 2026
@aiday-mar aiday-mar enabled auto-merge (squash) February 6, 2026 17:01
alexdima
alexdima previously approved these changes Feb 11, 2026
@aiday-mar aiday-mar merged commit a7cc092 into main Feb 11, 2026
18 checks passed
@aiday-mar aiday-mar deleted the kind-meadowlark branch February 11, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flicker of variable line heights when inserting new line

4 participants