Fix panic on paste when editing with auto-indent
Instead of accepting text as it's input by the user, we will read it out of the edit operation after it gets sanitized by the buffer.
This commit is contained in:
parent
573dd29882
commit
d3db700db4
2 changed files with 25 additions and 1 deletions
|
@ -1233,7 +1233,8 @@ impl Buffer {
|
|||
|
||||
let inserted_ranges = edits
|
||||
.into_iter()
|
||||
.filter_map(|(range, new_text)| {
|
||||
.zip(&edit_operation.as_edit().unwrap().new_text)
|
||||
.filter_map(|((range, _), new_text)| {
|
||||
let first_newline_ix = new_text.find('\n')?;
|
||||
let new_text_len = new_text.len();
|
||||
let start = (delta + range.start as isize) as usize + first_newline_ix + 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue