Skip to content

TerminalTextModifier#87

Open
darmuh wants to merge 1 commit intoTeamXiaolan:mainfrom
darmuh:TerminalTextPostProcessing
Open

TerminalTextModifier#87
darmuh wants to merge 1 commit intoTeamXiaolan:mainfrom
darmuh:TerminalTextPostProcessing

Conversation

@darmuh
Copy link
Contributor

@darmuh darmuh commented Mar 15, 2026

Rework of PR #63 this adds a new class for modifying terminalnode displaytext following original Terminal.TextPostProcess method

Allows for two styles:

  • Simple
  • Regex (less performant, according to online searches)

Regex vs Simple is determined by bool RegexPattern

In Simple you can then either replace OR insert after the matching string your IProvider value.

  • Replace vs Insert is determined by bool ShouldReplaceText
  • The index of your replace/insert is determined by IndexStyle (an enum that switches between first, last, and everything)

This can be applied to:

  • Every terminal node. (NodeToProcess & NodeKeyword are both null/empty)
  • A directly assigned terminal node. (NodeToProcess is assigned and not null)
  • The resulting node of a given keyword. (NodeKeyword returns a non-null terminalNode)

I've also added xml comments for everything public that was added this time (my bad for not doing this in earlier PRs lol)

initial commit for this feature, already contains XML comments explaining all the public methods.

Can use regex pattern matching or simple string matching to insert/replace text following Terminal's TextPostProcess method.

Uses a delegate/event that is invoked on all TerminalTextModifier instances. Text is run thru each instance sequentially based on which instance was created first.

I also added some test examples in DawnTesting.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant