diff options
author | Blaž Hrastnik | 2021-06-22 14:26:34 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-06-22 14:26:34 +0000 |
commit | 20f33ead67f5adf895e899945ea569e2c89a4d7f (patch) | |
tree | 15285f8c9d82336669d047d7ace2d32c1a0f88aa /helix-term/src/ui | |
parent | e0fd08d6df93c7a42289ee9859406077c1dbf638 (diff) |
minor: Remove old TODOs
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r-- | helix-term/src/ui/completion.rs | 25 | ||||
-rw-r--r-- | helix-term/src/ui/editor.rs | 2 | ||||
-rw-r--r-- | helix-term/src/ui/mod.rs | 2 | ||||
-rw-r--r-- | helix-term/src/ui/picker.rs | 2 |
4 files changed, 3 insertions, 28 deletions
diff --git a/helix-term/src/ui/completion.rs b/helix-term/src/ui/completion.rs index 80f7d590..85543610 100644 --- a/helix-term/src/ui/completion.rs +++ b/helix-term/src/ui/completion.rs @@ -68,7 +68,7 @@ impl menu::Item for CompletionItem { /// Wraps a Menu. pub struct Completion { - popup: Popup<Menu<CompletionItem>>, // TODO: Popup<Menu> need to be able to access contents. + popup: Popup<Menu<CompletionItem>>, trigger_offset: usize, // TODO: maintain a completioncontext with trigger kind & trigger char } @@ -82,28 +82,10 @@ impl Completion { // let items: Vec<CompletionItem> = Vec::new(); let mut menu = Menu::new(items, move |editor: &mut Editor, item, event| { match event { - PromptEvent::Abort => { - // revert state - // let id = editor.view().doc; - // let doc = &mut editor.documents[id]; - // doc.state = snapshot.clone(); - } + PromptEvent::Abort => {} PromptEvent::Validate => { let (view, doc) = current!(editor); - // revert state to what it was before the last update - // doc.state = snapshot.clone(); - - // extract as fn(doc, item): - - // TODO: need to apply without composing state... - // TODO: need to update lsp on accept/cancel by diffing the snapshot with - // the final state? - // -> on update simply update the snapshot, then on accept redo the call, - // finally updating doc.changes + notifying lsp. - // - // or we could simply use doc.undo + apply when changing between options - // always present here let item = item.unwrap(); @@ -143,7 +125,6 @@ impl Completion { doc.apply(&transaction, view.id); - // TODO: merge edit with additional_text_edits if let Some(additional_edits) = &item.additional_text_edits { // gopls uses this to add extra imports if !additional_edits.is_empty() { @@ -226,7 +207,7 @@ impl Component for Completion { fn render(&self, area: Rect, surface: &mut Surface, cx: &mut Context) { self.popup.render(area, surface, cx); - // TODO: if we have a selection, render a markdown popup on top/below with info + // if we have a selection, render a markdown popup on top/below with info if let Some(option) = self.popup.contents().selection() { // need to render: // option.detail diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index 44f331ff..4f1b4bca 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -123,8 +123,6 @@ impl EditorView { }; // TODO: range doesn't actually restrict source, just highlight range - // TODO: cache highlight results - // TODO: only recalculate when state.doc is actually modified let highlights: Vec<_> = match doc.syntax() { Some(syntax) => { syntax diff --git a/helix-term/src/ui/mod.rs b/helix-term/src/ui/mod.rs index c062bffe..f60152c9 100644 --- a/helix-term/src/ui/mod.rs +++ b/helix-term/src/ui/mod.rs @@ -42,7 +42,6 @@ pub fn regex_prompt( move |editor: &mut Editor, input: &str, event: PromptEvent| { match event { PromptEvent::Abort => { - // TODO: also revert text let (view, doc) = current!(editor); doc.set_selection(view.id, snapshot.clone()); } @@ -61,7 +60,6 @@ pub fn regex_prompt( let registers = &mut editor.registers; // revert state to what it was before the last update - // TODO: also revert text doc.set_selection(view.id, snapshot.clone()); fun(view, doc, registers, regex); diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 0aec9894..a3fe5e61 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -256,8 +256,6 @@ impl<T: 'static> Component for Picker<T> { let inner = block.inner(area); block.render(area, surface); - // TODO: abstract into a clear(area) fn - // surface.set_style(inner, Style::default().bg(Color::Rgb(150, 50, 0))); // -- Render the input bar: |