Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
liangfung committed Dec 23, 2024
1 parent f8da58d commit 73d8379
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion clients/vscode/src/chat/fileContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export async function showFileContext(fileContext: FileContext, gitProvider: Git
preserveFocus: true,
});

// move the cursor to the specified line
// Move the cursor to the specified line
const start = fileContext.range ? new Position(Math.max(0, fileContext.range.start - 1), 0) : new Position(0, 0);
const end = fileContext.range ? new Position(fileContext.range.end, 0) : new Position(0, 0);
editor.selection = new Selection(start, end);
Expand Down
2 changes: 1 addition & 1 deletion ee/tabby-ui/components/chat/chat-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ function ChatPanelRenderer(
</motion.div>
) : null}
{relevantContext.map((item, idx) => {
// `filepath + range` as unique key
// `git_url + filepath + range` as unique key
const key = `${item.git_url}_${item.filepath}_${item.range?.start}_${item.range?.end}`
return (
<motion.div
Expand Down
3 changes: 2 additions & 1 deletion ee/tabby-ui/components/chat/question-answer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,8 @@ function AssistantMessageCard(props: AssistantMessageCardProps) {
content: o.content,
filepath: o.filepath,
gitUrl: o.git_url,
startLine: o.range?.start ?? 0,
// for server attachment code, startLine will not be undefined
startLine: o.range?.start ?? 1,
language: filename2prism(o.filepath ?? '')[0],
isClient: false
})) ?? []
Expand Down

0 comments on commit 73d8379

Please sign in to comment.