diff --git a/helix-core/src/match_brackets.rs b/helix-core/src/match_brackets.rs index 03525087e..7520d3e46 100644 --- a/helix-core/src/match_brackets.rs +++ b/helix-core/src/match_brackets.rs @@ -205,50 +205,6 @@ pub fn find_matching_bracket_plaintext(doc: RopeSlice, cursor_pos: usize) -> Opt None } -// fn create_rename_prompt( -// editor: &Editor, -// prefill: String, -// history_register: Option, -// language_server_id: Option, -// ) -> Box { -// let prompt = ui::Prompt::new( -// "rename-to:".into(), -// history_register, -// ui::completers::none, -// move |cx: &mut compositor::Context, input: &str, event: PromptEvent| { -// if event != PromptEvent::Validate { -// return; -// } -// let (view, doc) = current!(cx.editor); - -// let Some(language_server) = doc -// .language_servers_with_feature(LanguageServerFeature::RenameSymbol) -// .find(|ls| language_server_id.map_or(true, |id| id == ls.id())) -// else { -// cx.editor -// .set_error("No configured language server supports symbol renaming"); -// return; -// }; - -// let offset_encoding = language_server.offset_encoding(); -// let pos = doc.position(view.id, offset_encoding); -// let future = language_server -// .rename_symbol(doc.identifier(), pos, input.to_string()) -// .unwrap(); - -// match block_on(future) { -// Ok(edits) => { -// let _ = cx.editor.apply_workspace_edit(offset_encoding, &edits); -// } -// Err(err) => cx.editor.set_error(err.to_string()), -// } -// }, -// ) -// .with_line(prefill, editor); - -// Box::new(prompt) -// } - /// Returns the open and closing chars pair. If not found in /// [`BRACKETS`] returns (ch, ch). /// diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs index 6ba2fcb9e..6e0f79f0e 100644 --- a/helix-term/src/ui/prompt.rs +++ b/helix-term/src/ui/prompt.rs @@ -103,6 +103,7 @@ impl Prompt { self } + /// Sets the line of the prompt as if the user has typed that text manually pub fn set_line(&mut self, line: String, editor: &Editor) { let cursor = line.len(); self.line = line;