Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Underscore breaks Label - see Text Input Controls scenario #3893

Open
tznind opened this issue Jan 11, 2025 · 0 comments
Open

Underscore breaks Label - see Text Input Controls scenario #3893

tznind opened this issue Jan 11, 2025 · 0 comments
Labels
bug v2 For discussions, issues, etc... relavant for v2

Comments

@tznind
Copy link
Collaborator

tznind commented Jan 11, 2025

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Launch Text Input Controls Scenario
  2. Type _- (underscore minus)
  3. See crash

Error appears to be in Label hotkey draw logic

Expected behavior
No crash

Screenshots
minus

System.ArgumentOutOfRangeException
  HResult=0x80131502
  Message=Specified argument was out of the range of valid values. (Parameter 'ch')
  Source=System.Private.CoreLib
  StackTrace:
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument) in System\ThrowHelper.cs:line 259
   at System.Text.Rune.op_Explicit(Char ch) in System.Text\Rune.cs:line 127
   at Terminal.Gui.TextFormatter.RemoveHotKeySpecifier(String text, Int32 hotPos, Rune hotKeySpecifier) in D:\Repos\temp\gui.cs\Terminal.Gui\Text\TextFormatter.cs:line 2127
   at Terminal.Gui.TextFormatter.GetLines() in D:\Repos\temp\gui.cs\Terminal.Gui\Text\TextFormatter.cs:line 607
   at Terminal.Gui.TextFormatter.Draw(Rectangle screen, Attribute normalColor, Attribute hotColor, Rectangle maximum, IConsoleDriver driver) in D:\Repos\temp\gui.cs\Terminal.Gui\Text\TextFormatter.cs:line 78
   at Terminal.Gui.View.DrawText() in D:\Repos\temp\gui.cs\Terminal.Gui\View\View.Drawing.cs:line 423
   at Terminal.Gui.View.DoDrawText() in D:\Repos\temp\gui.cs\Terminal.Gui\View\View.Drawing.cs:line 391
   at Terminal.Gui.View.Draw() in D:\Repos\temp\gui.cs\Terminal.Gui\View\View.Drawing.cs:line 84
   at Terminal.Gui.View.DrawSubviews() in D:\Repos\temp\gui.cs\Terminal.Gui\View\View.Drawing.cs:line 535
   at Terminal.Gui.View.DoDrawSubviews() in D:\Repos\temp\gui.cs\Terminal.Gui\View\View.Drawing.cs:line 496
   at Terminal.Gui.View.Draw() in D:\Repos\temp\gui.cs\Terminal.Gui\View\View.Drawing.cs:line 79
   at Terminal.Gui.View.Draw(IEnumerable`1 views, Boolean force) in D:\Repos\temp\gui.cs\Terminal.Gui\View\View.Drawing.cs:line 24
   at Terminal.Gui.Application.LayoutAndDraw(Boolean forceDraw) in D:\Repos\temp\gui.cs\Terminal.Gui\Application\Application.Run.cs:line 519
   at Terminal.Gui.Application.RunIteration(RunState& state, Boolean firstIteration) in D:\Repos\temp\gui.cs\Terminal.Gui\Application\Application.Run.cs:line 596
   at Terminal.Gui.Application.RunLoop(RunState state) in D:\Repos\temp\gui.cs\Terminal.Gui\Application\Application.Run.cs:line 557
   at Terminal.Gui.Application.Run(Toplevel view, Func`2 errorHandler) in D:\Repos\temp\gui.cs\Terminal.Gui\Application\Application.Run.cs:line 425
   at UICatalog.Scenarios.Text.Main() in D:\Repos\temp\gui.cs\UICatalog\Scenarios\Text.cs:line 447
   at UICatalog.UICatalogApp.UICatalogMain(Options options) in D:\Repos\temp\gui.cs\UICatalog\UICatalog.cs:line 393
   at UICatalog.UICatalogApp.Main(String[] args) in D:\Repos\temp\gui.cs\UICatalog\UICatalog.cs:line 207

image

@tznind tznind added bug v2 For discussions, issues, etc... relavant for v2 labels Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug v2 For discussions, issues, etc... relavant for v2
Projects
None yet
Development

No branches or pull requests

1 participant