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

Error when replacing a word in textView #2429

Closed
robece opened this issue Mar 19, 2023 · 0 comments · Fixed by #2442
Closed

Error when replacing a word in textView #2429

robece opened this issue Mar 19, 2023 · 0 comments · Fixed by #2442
Labels

Comments

@robece
Copy link

robece commented Mar 19, 2023

Describe the bug
Error when replacing a word in textView.

System.ArgumentOutOfRangeException: "Index was out of range. Must be non-negative and less than or equal to the size of the collection. (Parameter 'startIndex')"
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)\n at System.Globalization.CompareInfo.IndexOf(String source, String value, Int32 startIndex, Int32 count, CompareOptions options)\n at Terminal.Gui.TextModel.ReplaceAllText(ustring text, Boolean matchCase, Boolean matchWholeWord, ustring textToReplace)\n at Terminal.Gui.TextView.ReplaceAllText(ustring textToFind, Boolean matchCase, Boolean matchWholeWord, ustring textToReplace)\n at event_generator.Program.ReplaceAll() in /Users/robece/Documents/event-generator/Program.cs:line 507\n at event_generator.Program.<>c.b__46_7() in /Users/robece/Documents/event-generator/Program.cs:816

To Reproduce
Steps to reproduce the behavior:

  1. Implement a textView
  2. Run the ReplaceAllText method with the following parameters:
    textToFind: hello! hello!
    matchCase: false
    matchWholeWord: false
    textToReplace: hello!

Expected behavior
It should be replacing the text as expected.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
MacOS (Ventura 13.2.1)
NuGet version 1.10.0

Smartphone (please complete the following information):
Not mobile

Additional context
Add any other context about the problem here.

@tig tig added the bug label Mar 19, 2023
BDisp added a commit to BDisp/Terminal.Gui that referenced this issue Mar 22, 2023
tig added a commit that referenced this issue Mar 22, 2023
Fixes #2429. Error when replacing a word in textView.
BDisp added a commit to BDisp/Terminal.Gui that referenced this issue Mar 22, 2023
BDisp added a commit to BDisp/Terminal.Gui that referenced this issue Mar 22, 2023
@tig tig closed this as completed in #2442 Mar 22, 2023
tig added a commit that referenced this issue Mar 22, 2023
Fixes #2429. Error when replacing a word in textView.
tznind pushed a commit to tznind/gui.cs that referenced this issue May 7, 2023
tznind pushed a commit to tznind/gui.cs that referenced this issue May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants