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:
minpeter
2026-02-24 14:07:21 +09:00
parent 54b756c145
commit c7efe8f002
3 changed files with 24 additions and 0 deletions
@@ -159,6 +159,7 @@ export function restoreIndentForPairedReplacement(
if (leadingWhitespace(line).length > 0) return line
const indent = leadingWhitespace(originalLines[idx])
if (indent.length === 0) return line
if (originalLines[idx].trim() === line.trim()) return line
return `${indent}${line}`
})
}