@@ -1492,7 +1492,7 @@ fn search_impl(
1492 let selection = doc.selection(view.id);
1492 let selection = doc.selection(view.id);
1494 // Get the right side of the primary block cursor for forward search, or the
1494 // Get the right side of the primary block cursor for forward search, or the
1495− //grapheme before the start of the selection for reverse search.
1495+ // grapheme before the start of the selection for reverse search.
1496 let start = match direction {
1496 let start = match direction {
1497 Direction::Forward => text.char_to_byte(graphemes::next_grapheme_boundary(
1497 Direction::Forward => text.char_to_byte(graphemes::next_grapheme_boundary(
@@ -1504,10 +1504,10 @@ fn search_impl(
1507− //A regex::Match returns byte-positions in the str. In the case where we
1507+ // A regex::Match returns byte-positions in the str. In the case where we
1508− //do a reverse search and wraparound to the end, we don't need to search
1508+ // do a reverse search and wraparound to the end, we don't need to search
1509− //the text before the current cursor position for matches, but by slicing
1509+ // the text before the current cursor position for matches, but by slicing
1510− //it out, we need to add it back to the position of the selection.
1510+ // it out, we need to add it back to the position of the selection.
1511 let mut offset = 0;
1511 let mut offset = 0;
1513 // use find_at to find the next match after the cursor, loop around the end
1513 // use find_at to find the next match after the cursor, loop around the end
@@ -4352,9 +4352,6 @@ pub mod insert {
4353// Undo / Redo
4353// Undo / Redo
4355−// TODO: each command could simply return a Option<transaction>, then the higher level handles
4358fn undo(cx: &mut Context) {
4355fn undo(cx: &mut Context) {
4359 let count = cx.count();
4356 let count = cx.count();
4360 let (view, doc) = current!(cx.editor);
4357 let (view, doc) = current!(cx.editor);
@@ -4930,42 +4927,6 @@ fn remove_primary_selection(cx: &mut Context) {
4930pub fn completion(cx: &mut Context) {
4927pub fn completion(cx: &mut Context) {
4931 use helix_lsp::{lsp, util::pos_to_lsp_pos};
4928 use helix_lsp::{lsp, util::pos_to_lsp_pos};
4933− // trigger on trigger char, or if user calls it
4934− // (or on word char typing??)
4935− // after it's triggered, if response marked is_incomplete, update on every subsequent keypress
4937− // lsp calls are done via a callback: it sends a request and doesn't block.
4938− // when we get the response similarly to notification, trigger a call to the completion popup
4940− // language_server.completion(params, |cx: &mut Context, _meta, response| {
4941− // // called at response time
4942− // // compositor, lookup completion layer
4943− // // downcast dyn Component to Completion component
4944− // // emit response to completion (completion.complete/handle(response))
4947− // typing after prompt opens: usually start offset is tracked and everything between
4948− // start_offset..cursor is replaced. For our purposes we could keep the start state (doc,
4949− // selection) and revert to them before applying. This needs to properly reset changes/history
4952− // company-mode does this by matching the prefix of the completion and removing it.
4954− // ignore isIncomplete for now
4955− // keep state while typing
4956− // the behavior should be, filter the menu based on input
4957− // if items returns empty at any point, remove the popup
4958− // if backspace past initial offset point, remove the popup
4960− // debounce requests!
4962− // need an idle timeout thing.
4963− // https://github.com/company-mode/company-mode/blob/master/company.el#L620-L622
4965− // "The idle delay in seconds until completion starts automatically.
4966− // The prefix still has to satisfy `company-minimum-prefix-length' before that
4967− // happens. The value of nil means no idle completion."
4969 let (view, doc) = current!(cx.editor);
4930 let (view, doc) = current!(cx.editor);
4971 let language_server = match doc.language_server() {
4932 let language_server = match doc.language_server() {