talon-scripts/community/core/edit/insert_between.py
2025-08-19 08:06:37 -04:00

13 lines
376 B
Python

from talon import Module, actions
mod = Module()
@mod.action_class
class module_actions:
def insert_between(before: str, after: str):
"""Insert `before + after`, leaving cursor between `before` and `after`. Not entirely reliable if `after` contains newlines."""
actions.insert(f"{before}{after}")
for _ in after:
actions.edit.left()