From 56595d42fe38e57e0b4da1d3039c2abeec1cbc50 Mon Sep 17 00:00:00 2001 From: moshyfawn Date: Sun, 29 Sep 2024 21:41:05 -0400 Subject: [PATCH] [feat] enable start line and column for Zed only (#422) --- app/common/ide.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/common/ide.ts b/app/common/ide.ts index 96156a948..1b2ee6768 100644 --- a/app/common/ide.ts +++ b/app/common/ide.ts @@ -48,13 +48,16 @@ export class IDE { const endTag = templateNode.endTag || startTag; let codeCommand = `${this.command}://file/${filePath}`; - // Note: Zed API not handling lines https://github.com/zed-industries/zed/issues/14820 - if (startTag && endTag && this.type !== IdeType.ZED) { + if (startTag && endTag) { const startRow = startTag.start.line; const startColumn = startTag.start.column; const endRow = endTag.end.line; const endColumn = endTag.end.column - 1; - codeCommand += `:${startRow}:${startColumn}:${endRow}:${endColumn}`; + codeCommand += `:${startRow}:${startColumn}`; + // Note: Zed API doesn't seem to handle end row/column (ref: https://github.com/zed-industries/zed/issues/18520) + if (this.type !== IdeType.ZED) { + codeCommand += `:${endRow}:${endColumn}`; + } } return codeCommand; }