Feat: Add configuration option to always indent on TAB key press #2187
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I have added an option that allows indentation/un-indentation to be applied whenever the Tab key is pressed, regardless of the cursor position.
Previously, the Tab key would only function as an indent when the cursor was at the beginning of a line. If the Tab key was pressed in the middle of a line (for example, within a bullet point), it would just insert a tab character without indenting.
In common editors like Google Docs or Notion, and in input fields such as Slack, pressing Tab is always recognized as an indent and Shift + Tab as an un-indent, regardless of the cursor's position. To make Flutter Quill more accessible and familiar to a wider audience, we have introduced a feature that mimics this behavior.
By default, the Tab key will still only trigger indentation at the beginning of a line, as it has in the past.
Since tabs are visually indistinguishable from spaces in the editor, the need to input a tab character directly seems rare. Therefore, we considered making it so that the Tab key always functions as an indent, without adding an option. While we’ve chosen to introduce this as an optional feature for now to maintain the current behavior, we could also consider changing the default behavior or setting this option to true by default if there's no strong reason to preserve the existing behavior.
Please feel free to share your thoughts on this approach.
Related Issues
Type of Change
Suggestions