Indent and Outdent are not languageGrammar sensitive

4 spaces is a standard indent for most language grammars, but not for TaskPaper, which is specifically a tab-indented outline format.

Can I suggest an edit to the start of these two actions, making them adapt to the active languageGrammar ?

Perhaps something like:

const indent = draft.languageGrammar !== 'Taskpaper' ? (
		'    '
	) : '\t';

( Jesse Grosjean’s TaskPaper 3 on macOS for example, saves with tab indents. )

Out of the box, the supplied Indent and Outdent actions are format-insensitive – using four spaces even in TaskPaper language mode, and for cross-platform use this can inadvertently result in slightly messy files, with mixed indentation, probably without the user realising.

(The TaskPaper app has to assume that indentation white-spacing is consistent, and will not see all of the structure which a user of Drafts indent/outdent user thought they had created, if the file contains an inadvertent mixture of canonical tabs with accidental or unwitting 4 * space)

Yes, agreed. This exact situation has ever happened while working with Taskpaper over the years. It seems I have perfectly formatted Taskpaper documents (on an iOS version) only to find that everything is shifted (a space? or two?) on macOS, often breaking the syntax.

1 Like

For reference:

Use Tabs to indent items under other items

and

From which it emerges that however flexible TaskPaper tries to be, it does need consistency in indentation whitespace. An outline which is partly tab-indented, and partly (following use of the standard Drafts IndentOutdent actions) space-indented, is undefined as an outline, and cannot be correctly read.

Finally, it is possible that some confusion lingers on from a change, at least seven years ago, in the TaskPaper format.

1 Like