Skip to content

Commit 4ee502c

Browse files
committed
fix: filter whitespace-only lines in multi-line paste
Change .filter((l) => l.length > 0) to .filter((l) => l.trim().length > 0) so that whitespace-only lines are excluded. Previously, a paste like "db.test\n \n.find()" would produce a spurious double space.
1 parent 4fa1037 commit 4ee502c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/documentdb/shell/DocumentDBShellPty.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ export class DocumentDBShellPty implements vscode.Pseudoterminal {
267267
*/
268268
private async handleMultiLinePaste(data: string): Promise<void> {
269269
// Normalize line endings and split
270-
const lines = data.split(/\r\n|\r|\n/).filter((l) => l.length > 0);
270+
const lines = data.split(/\r\n|\r|\n/).filter((l) => l.trim().length > 0);
271271

272272
// If only one non-empty line after splitting, process normally
273273
if (lines.length <= 1) {

0 commit comments

Comments
 (0)