@@ -768,6 +768,63 @@ void main() {
768768 // Ensure that we received a notification when the tag was cancelled.
769769 expect (tagNotificationCount, 7 );
770770 });
771+
772+ testWidgetsOnAllPlatforms ("does not start composing when placing the caret at an existing tag pattern" ,
773+ (tester) async {
774+ await _pumpTestEditor (
775+ tester,
776+ MutableDocument (
777+ nodes: [
778+ ParagraphNode (
779+ id: "1" ,
780+ text: AttributedText ("This is origin/main branch" ),
781+ ),
782+ ],
783+ ),
784+ );
785+
786+ // Place the caret at "mai|n".
787+ await tester.placeCaretInParagraph ("1" , 18 );
788+
789+ // Ensure that we are not composing a tag.
790+ final text = SuperEditorInspector .findTextInComponent ("1" );
791+ expect (
792+ text.getAttributionSpansInRange (
793+ attributionFilter: (attribution) => attribution == actionTagComposingAttribution,
794+ range: const SpanRange (0 , 26 ),
795+ ),
796+ isEmpty,
797+ );
798+ });
799+
800+ testWidgetsOnAllPlatforms ("updates composing when moving the caret within an existing composing tag" ,
801+ (tester) async {
802+ await _pumpTestEditor (
803+ tester,
804+ singleParagraphEmptyDoc (),
805+ );
806+ await tester.placeCaretInParagraph ("1" , 0 );
807+
808+ // Compose an action tag.
809+ await tester.typeImeText ("/header" );
810+
811+ // Ensure that the tag has a composing attribution.
812+ final textBefore = SuperEditorInspector .findTextInComponent ("1" );
813+ expect (
814+ textBefore.getAttributedRange ({actionTagComposingAttribution}, 0 ),
815+ const SpanRange (0 , 6 ),
816+ );
817+
818+ // Press the left arrow to move the caret within the tag.
819+ await tester.pressLeftArrow ();
820+
821+ // Ensure that the tag was updated.
822+ final textAfter = SuperEditorInspector .findTextInComponent ("1" );
823+ expect (
824+ textAfter.getAttributedRange ({actionTagComposingAttribution}, 0 ),
825+ const SpanRange (0 , 5 ),
826+ );
827+ });
771828 });
772829
773830 group ("submissions >" , () {
0 commit comments