From b54310c57ad2a31cfbeaf37c12d4f84e1f8e8add Mon Sep 17 00:00:00 2001 From: moshyfawn Date: Sun, 29 Sep 2024 21:17:02 -0400 Subject: [PATCH] feat(IDE, Zed): enable start line and column for Zed only --- 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; }