fix: set the initial repl cursor pos, fixes #8943 (#8955)

# Description
Set the initial repl cursor pos, so running `commandline --insert`
inserts at the current cursor position of the input buffer.



Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
This commit is contained in:
Steven Xu 2023-04-26 09:08:11 +10:00 committed by GitHub
parent 503052b669
commit 66b5931438
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -477,6 +477,12 @@ pub fn evaluate_repl(
}
}
let mut repl_cursor = engine_state
.repl_cursor_pos
.lock()
.expect("repl cursor pos mutex");
*repl_cursor = line_editor.current_insertion_point();
drop(repl_cursor);
let mut repl_buffer = engine_state
.repl_buffer_state
.lock()