editor: Input enter to get next indent level performance. (#1304)
Now we can handle about 1M lines. https://github.com/user-attachments/assets/cb55cd18-6755-40cd-a5b0-3d0f865d12e1
This commit is contained in:
parent
aca03d47c0
commit
6028de3b5a
1 changed files with 2 additions and 2 deletions
|
|
@ -1206,7 +1206,7 @@ impl InputState {
|
|||
let mut next_indent = String::new();
|
||||
let current_line_start_pos = self.start_of_line();
|
||||
let next_line_start_pos = self.end_of_line();
|
||||
for c in self.text.chars().skip(current_line_start_pos) {
|
||||
for c in self.text.slice(current_line_start_pos..).chars() {
|
||||
if !c.is_whitespace() {
|
||||
break;
|
||||
}
|
||||
|
|
@ -1216,7 +1216,7 @@ impl InputState {
|
|||
current_indent.push(c);
|
||||
}
|
||||
|
||||
for c in self.text.chars().skip(next_line_start_pos) {
|
||||
for c in self.text.slice(next_line_start_pos..).chars() {
|
||||
if !c.is_whitespace() {
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue