如何在 AvalonEdit 中更改选项卡的符号和颜色

How to change the symbol and color the Tab in AvalonEdit

如何更改 Tab 字符的符号和颜色

想把字符改成箭头字符

并设置红色

如果您查看源代码,您会发现用于显示制表符的字符是硬编码的:

https://github.com/icsharpcode/AvalonEdit/blob/106b31efe17a4992e1c02ee5c8650bc86591aeb7/ICSharpCode.AvalonEdit/Rendering/SingleCharacterElementGenerator.cs#L106

为制表符改变颜色

textEditor.TextArea.TextView.NonPrintableCharacterBrush = Brushes.Red;