Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Dec 20, 2024
1 parent de6633a commit 5f67f38
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions clients/vscode/src/chat/fileContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export async function getFileContext(
range,
filepath: filePathParams.filePath,
git_url: filePathParams.gitRemoteUrl ?? "",
is_entire_file: !useSelection
is_entire_file: !useSelection,
};
}

Expand Down Expand Up @@ -75,9 +75,10 @@ export async function showFileContext(fileContext: FileContext, gitProvider: Git
preserveFocus: true,
});


// move the cursor to the specified line
const start = fileContext.is_entire_file ? new Position(0, 0) : new Position(Math.max(0, fileContext.range.start - 1), 0);
const start = fileContext.is_entire_file
? new Position(0, 0)
: new Position(Math.max(0, fileContext.range.start - 1), 0);
const end = fileContext.is_entire_file ? new Position(0, 0) : new Position(fileContext.range.end, 0);
editor.selection = new Selection(start, end);
editor.revealRange(new Range(start, end), TextEditorRevealType.InCenter);
Expand Down

0 comments on commit 5f67f38

Please sign in to comment.