Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add >>, the indent-region operator #161

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

antifuchs
Copy link

This operator inserts all elements as normal, and then updates their indentation to match whatever indent-region would do. This helps get correctly-indented text in modes where unbalanced structure confuses the indentation engine.

The whole thing was discussed and proposed in #160 (reply in thread)

The change isn't super straightforward, as we need a bit more logic to support placeholder fields moving:

  • tempel--inhibit-clearing-placeholders is a new flag that allows the normal field-changing hooks to run, but prevents the default from changing, if indentation changed the field.
  • A new branch on the after case of tempel--field-modified that moves the start of the overlay if text should be inserted before it (as indentation does).

This operator inserts all elements as normal, and then updates their
indentation to match whatever indent-region would do. This helps get
correctly-indented text in modes where unbalanced structure confuses
the indentation engine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant