@@ -902,6 +902,31 @@ def script_toggleReportLinks(self, gesture):
902902 config .conf ["documentFormatting" ]["reportLinks" ] = True
903903 ui .message (state )
904904
905+ @script (
906+ # Translators: Input help mode message for cycle through report link type command.
907+ description = _ ("Cycles through the report link type states" ),
908+ category = SCRCAT_DOCUMENTFORMATTING ,
909+ )
910+ def script_cyclesReportLinkType (self , gesture : inputCore .InputGesture ) -> None :
911+ """Set next state of report link type and reports it with ui.message."""
912+ featureFlag : FeatureFlag = config .conf ["documentFormatting" ]["reportLinkType" ]
913+ boolFlag : BoolFlag = featureFlag .enumClassType
914+ values = [x .value for x in boolFlag ]
915+ currentValue = featureFlag .value .value
916+ nextValueIndex = (currentValue % len (values )) + 1
917+ nextName : str = boolFlag (nextValueIndex ).name
918+ config .conf ["documentFormatting" ]["reportLinkType" ] = nextName
919+ featureFlag = config .conf ["documentFormatting" ]["reportLinkType" ]
920+ if featureFlag .isDefault ():
921+ # Translators: Used to announce reporting link type state
922+ # (default behavior).
923+ msg = _ ("Report link type default (%s)" ) % featureFlag .behaviorOfDefault .displayString
924+ else :
925+ # Translators: Announces which report link type state is used
926+ # (disabled or enabled).
927+ msg = _ ("Report link type %s" ) % BoolFlag [nextName ].displayString
928+ ui .message (msg )
929+
905930 @script (
906931 # Translators: Input help mode message for toggle report graphics command.
907932 description = _ ("Toggles on and off the reporting of graphics" ),
0 commit comments