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

Fix text input crash #87

Merged
merged 1 commit into from
Aug 13, 2023
Merged

Fix text input crash #87

merged 1 commit into from
Aug 13, 2023

Conversation

MinusGix
Copy link
Member

This PR fixes a crash bug with text-input.

  • Type some text
  • Ctrl+A to select all
  • Backspace to delete it all
  • Type a character -> Crash

This was due to backspace not clearing the current selection.
I fixed the clearing of the selection on backspace. I also made so replace_range is less likely to crash. It will log to stderr if the range was invalid, so we can still notice bugs like that.
(Maybe we should add tracing in the future? Unsure.)

@codecov
Copy link

codecov bot commented Aug 13, 2023

Codecov Report

Merging #87 (006c850) into main (5786551) will increase coverage by 0.08%.
The diff coverage is 35.29%.

@@           Coverage Diff            @@
##            main     #87      +/-   ##
========================================
+ Coverage   4.09%   4.17%   +0.08%     
========================================
  Files         43      43              
  Lines       7543    7561      +18     
========================================
+ Hits         309     316       +7     
- Misses      7234    7245      +11     
Files Changed Coverage Δ
src/views/text_input.rs 10.21% <35.29%> (+0.93%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@dzhou121 dzhou121 merged commit 0c16251 into lapce:main Aug 13, 2023
9 checks passed
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.

2 participants