Commit to history after executing a command from the palette (#5294)
This commit is contained in:
parent
60f84be40c
commit
3cf5216dbd
1 changed files with 15 additions and 0 deletions
|
@ -2504,7 +2504,22 @@ pub fn command_palette(cx: &mut Context) {
|
|||
on_next_key_callback: None,
|
||||
jobs: cx.jobs,
|
||||
};
|
||||
let focus = view!(ctx.editor).id;
|
||||
|
||||
command.execute(&mut ctx);
|
||||
|
||||
if ctx.editor.tree.contains(focus) {
|
||||
let config = ctx.editor.config();
|
||||
let mode = ctx.editor.mode();
|
||||
let view = view_mut!(ctx.editor, focus);
|
||||
let doc = doc_mut!(ctx.editor, &view.doc);
|
||||
|
||||
view.ensure_cursor_in_view(doc, config.scrolloff);
|
||||
|
||||
if mode != Mode::Insert {
|
||||
doc.append_changes_to_history(view);
|
||||
}
|
||||
}
|
||||
});
|
||||
compositor.push(Box::new(overlayed(picker)));
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue