Add LSP logs into the end of the editor, not after its caret
Also prevent tabs from being added in readonly editors
This commit is contained in:
@@ -405,8 +405,14 @@ impl LspLogView {
|
||||
{
|
||||
log_view.editor.update(cx, |editor, cx| {
|
||||
editor.set_read_only(false);
|
||||
editor.handle_input(entry.trim(), cx);
|
||||
editor.handle_input("\n", cx);
|
||||
let last_point = editor.buffer().read(cx).len(cx);
|
||||
editor.edit(
|
||||
vec![
|
||||
(last_point..last_point, entry.trim()),
|
||||
(last_point..last_point, "\n"),
|
||||
],
|
||||
cx,
|
||||
);
|
||||
editor.set_read_only(true);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user