Fix indentation bug in suggestedIndentForBufferRow

A leading space was being accounted for when doing some math to compute indent level… but not on both sides of the equation.
This commit is contained in:
Andrew Dupont 2024-01-27 01:32:44 -08:00
parent adfdd05472
commit 6767cda288

View File

@ -1520,7 +1520,7 @@ class WASMTreeSitterLanguageMode {
}
scopeResolver.reset();
let finalIndent = comparisonRowIndent + indentDelta + dedentDelta;
let finalIndent = comparisonRowIndent + indentDelta + dedentDelta + existingIndent;
// console.log('score:', comparisonRowIndent, '+', indentDelta, '-', ((dedentDelta < 0) ? -dedentDelta : dedentDelta), '=', finalIndent);
return Math.max(finalIndent - existingIndent, 0);