-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
TextEdit: fix crash when hitting SHIFT + TAB around non-ASCII text #3984
Conversation
emilk#3878 panic patch
let remove_len = if self.as_str().chars().nth(line_start.index) == Some('\t') { | ||
Some(1) | ||
} else if self.as_str()[line_start.index..] | ||
} else if self | ||
.as_str() | ||
.chars() | ||
.skip(line_start.index) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Iteration over chars two times can be time consuming for a long text. It is better to do that only once
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be, you right.
However, it only works when we press SHIFT + TAB, so we don't need to change it.
PR Merge this for egui v0.26.3, Please. |
…milk#3984) * Closes emilk#3846 * Closes emilk#3878 Dear emilk. Leaving aside other function, I think this is all you need to fix to patch the panic that occurs when Shift + TAB. Thank you, emilk.
panic
when pressing Shift + TAB in aTextEdit
#3846Dear emilk.
Leaving aside other function,
I think this is all you need to fix to patch the panic that occurs when Shift + TAB.
Thank you, emilk.