diff options
author | Mateusz S. Szczygieł | 2022-03-01 01:45:29 +0000 |
---|---|---|
committer | GitHub | 2022-03-01 01:45:29 +0000 |
commit | 14e2ced440a2ba0f1794644f5cc1295a5738ad36 (patch) | |
tree | a0ef9ea2b0c1e6ff8a6677550bcfba7d78038d57 /helix-view/src/editor.rs | |
parent | e83cdf3fd33a43e1ff78793995adbe23bd62ae49 (diff) |
Make repeat operator work with completion edits (#1640)
* add basic completion replay
* use transaction as the last completion
* completion replay only on trigger position
* cache changes in CompletionAction
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
Diffstat (limited to 'helix-view/src/editor.rs')
-rw-r--r-- | helix-view/src/editor.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index 3a2a9af8..0eb61308 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -33,6 +33,7 @@ pub use helix_core::register::Registers; use helix_core::{ auto_pairs::AutoPairs, syntax::{self, AutoPairConfig}, + Change, }; use helix_core::{Position, Selection}; use helix_dap as dap; @@ -301,9 +302,17 @@ pub struct Editor { pub last_motion: Option<Motion>, pub pseudo_pending: Option<String>, + pub last_completion: Option<CompleteAction>, + pub exit_code: i32, } +#[derive(Debug, Clone)] +pub struct CompleteAction { + pub trigger_offset: usize, + pub changes: Vec<Change>, +} + #[derive(Debug, Copy, Clone)] pub enum Action { Load, @@ -347,6 +356,7 @@ impl Editor { autoinfo: None, idle_timer: Box::pin(sleep(config.idle_timeout)), last_motion: None, + last_completion: None, pseudo_pending: None, config, auto_pairs, |