Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/tools/FileEditTool/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function getEditToolDescription(): string {

function getDefaultEditDescription(): string {
const prefixFormat = isCompactLinePrefixEnabled()
? 'line number + tab'
? 'line number + │ (box drawing character)'
: 'spaces + line number + arrow'
const minimalUniquenessHint =
process.env.USER_TYPE === 'ant'
Expand Down
6 changes: 3 additions & 3 deletions src/utils/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ export function addLineNumbers({

if (isCompactLinePrefixEnabled()) {
return lines
.map((line, index) => `${index + startLine}\t${line}`)
.map((line, index) => `${index + startLine}${line}`)
.join('\n')
}

Expand All @@ -319,11 +319,11 @@ export function addLineNumbers({
}

/**
* Inverse of addLineNumbers — strips the `N→` or `N\t` prefix from a single
* Inverse of addLineNumbers — strips the `N→`, `N│` or `N\t` prefix from a single
* line. Co-located so format changes here and in addLineNumbers stay in sync.
*/
export function stripLineNumberPrefix(line: string): string {
const match = line.match(/^\s*\d+[\u2192\t](.*)$/)
const match = line.match(/^\s*\d+[\u2192\u2502\t](.*)$/)
return match?.[1] ?? line
}

Expand Down
Loading