0

有没有办法在 AvalonEdit 中添加一条规则,将字符串中的所有变量着色为不同的颜色?有点像 NSIS 的工作方式(例如 HM NIS 编辑)

在这种情况下,我需要让“ $SmPrograms ”(一个常量)和“ ${AppName} ”(一个变量)从字符串的其余部分中脱颖而出。

Section "Start Menu Shortcuts" SecStartMenuShortcuts
  SectionIn 1 2
  CreateDirectory "$SMPROGRAMS\MyApp"
  CreateShortCut "$SMPROGRAMS\MyApp\Uninstall-${AppName}.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
  Delete "$SMPROGRAMS\MyApp\MyApp.lnk" ; Delete older link if exists
  CreateShortCut "$SMPROGRAMS\MyApp\MyApp2.lnk" "$INSTDIR\MyApp.exe" "" "$INSTDIR\MyApp.exe" 0
SectionEnd

非常感谢如果有人可以提供帮助

4

1 回答 1

1

您可以在跨度内嵌套规则集:

    <Span color="String">
        <Begin>"</Begin>
        <End>"</End>
        <RuleSet>
            <Rule foreground="#FF993366">
                \$[\w\d_]+
            </Span>
        </RuleSet>
    </Span>
于 2014-10-08T16:53:59.677 回答