Merge 5adfb455e2e88e38fde86118e2818fdf6b294a66 into d1e684c419b4f88fee62490b0c2b4fcf65469e59

This commit is contained in:
LinruoT 2026-07-12 07:13:13 +08:00 committed by GitHub
commit 499a74a765
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -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'

View File

@ -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')
}
@ -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
}