Skip to content

Commit cfb36e3

Browse files
committed
refactor: . Extract variable newLineNumber
1 parent 9cb685c commit cfb36e3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Commands/ToggleDone.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ export const toggleLine = (line: string, path: string): EditorInsertion => {
7575
});
7676
if (task !== null) {
7777
const lines = task.toggleWithRecurrenceInUsersOrder().map((t) => t.toFileLineString());
78-
return { text: lines.join('\n'), moveTo: { line: lines.length - 1 } };
78+
const newLineNumber = lines.length - 1;
79+
return { text: lines.join('\n'), moveTo: { line: newLineNumber } };
7980
} else {
8081
// If the task is null this means that we have one of:
8182
// 1. a regular checklist item

0 commit comments

Comments
 (0)