The TextEdit component failed to recognize consecutive '\r\n' characters correctly
- Dominant language
- Rust
- Stars
- 30.6k
- Forks
- 2.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 72
Description
The TextEdit component failed to recognize consecutive '\r\n' characters correctly
**Describe the bug**
I found that when I give a string with '\r\n\r\n' to make TextEdit display, there is something wrong with the display. For example it looks like there is one line missing.When I press Key::Down, I can't reach the last '\r\n', but whether I get a new line can be displayed.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to the CodeEditor,modify the code value to end with '\r\n\r\n'
2. Click on the keyboard down button
3.
**Expected behavior**
**Screenshots**
**Desktop (please complete the following information):**
- OS: Windows11
- Browser :chrome
- Version 22
**Additional context**
Modified value:
code: "// A very simple example\n\
fn main() {\n\
\tprintln!(\"Hello world!\");\n\
}\r\n\r\n"
.into(),
Contributor guide
Research direction
Start with the TextEdit component and reproduce the issue through CodeEditor using a value ending in consecutive '\r\n' characters. Inspect how Key::Down handles the final empty lines and verify that every newline is reachable and displayed correctly, including the trailing blank line.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100