Skip to content
Open
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
4 changes: 3 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ export function fillColumns(str: string, finalLength: number): string {
}

if (editor.options.insertSpaces) {
for (let e = 0; e < tabSize + finalLength - str.length; e++) {
// Extend str with spaces, until the length of finalLength, plus one tab's worth of spaces.
// We need to subtract finalLegth % tabSize to align with the use of the tab key
for (let e = 0; e < tabSize - finalLength % tabSize + finalLength - str.length; e++) {
tab += " ";
}
str += tab;
Expand Down