fix(hashline-edit): preserve intentional whitespace removal in autocorrect
restoreIndentForPairedReplacement() and restoreLeadingIndent() unconditionally restored original indentation when replacement had none, preventing intentional indentation changes (e.g. removing a tab from '\t1절' to '1절'). Skip indent restoration when trimmed content is identical, indicating a whitespace-only edit.
This commit is contained in:
@@ -53,6 +53,7 @@ export function restoreLeadingIndent(templateLine: string, line: string): string
|
||||
const templateIndent = leadingWhitespace(templateLine)
|
||||
if (templateIndent.length === 0) return line
|
||||
if (leadingWhitespace(line).length > 0) return line
|
||||
if (templateLine.trim() === line.trim()) return line
|
||||
return `${templateIndent}${line}`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user