aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands
diff options
context:
space:
mode:
authorBlaž Hrastnik2022-03-22 14:25:40 +0000
committerBlaž Hrastnik2022-03-28 02:02:21 +0000
commit96a4eb84838d4cbfb9313968278985ea1986a3bc (patch)
tree24506b4194cae8028130727933be8c640b7e54cf /helix-term/src/commands
parent5c162ef995e3822cd465f2c83874a040ebe153b8 (diff)
Remove more push_layer calls
Diffstat (limited to 'helix-term/src/commands')
-rw-r--r--helix-term/src/commands/lsp.rs20
1 files changed, 7 insertions, 13 deletions
diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs
index 308ff829..530e528a 100644
--- a/helix-term/src/commands/lsp.rs
+++ b/helix-term/src/commands/lsp.rs
@@ -11,7 +11,7 @@ use helix_view::editor::Action;
use crate::{
compositor::{self, Compositor},
- ui::{self, overlay::overlayed, FileLocation, FilePicker, Popup, Prompt, PromptEvent},
+ ui::{self, overlay::overlayed, FileLocation, FilePicker, Popup, PromptEvent},
};
use std::borrow::Cow;
@@ -138,9 +138,7 @@ pub fn symbol_picker(cx: &mut Context) {
cx.callback(
future,
- move |editor: &mut Editor,
- compositor: &mut Compositor,
- response: Option<lsp::DocumentSymbolResponse>| {
+ move |editor, compositor, response: Option<lsp::DocumentSymbolResponse>| {
if let Some(symbols) = response {
// lsp has two ways to represent symbols (flat/nested)
// convert the nested variant to flat, so that we have a homogeneous list
@@ -172,9 +170,7 @@ pub fn workspace_symbol_picker(cx: &mut Context) {
cx.callback(
future,
- move |_editor: &mut Editor,
- compositor: &mut Compositor,
- response: Option<Vec<lsp::SymbolInformation>>| {
+ move |_editor, compositor, response: Option<Vec<lsp::SymbolInformation>>| {
if let Some(symbols) = response {
let picker = sym_picker(symbols, current_url, offset_encoding);
compositor.push(Box::new(overlayed(picker)))
@@ -208,9 +204,7 @@ pub fn code_action(cx: &mut Context) {
cx.callback(
future,
- move |editor: &mut Editor,
- compositor: &mut Compositor,
- response: Option<lsp::CodeActionResponse>| {
+ move |editor, compositor, response: Option<lsp::CodeActionResponse>| {
let actions = match response {
Some(a) => a,
None => return,
@@ -613,7 +607,7 @@ pub fn hover(cx: &mut Context) {
cx.callback(
future,
- move |editor: &mut Editor, compositor: &mut Compositor, response: Option<lsp::Hover>| {
+ move |editor, compositor, response: Option<lsp::Hover>| {
if let Some(hover) = response {
// hover.contents / .range <- used for visualizing
@@ -650,7 +644,8 @@ pub fn hover(cx: &mut Context) {
);
}
pub fn rename_symbol(cx: &mut Context) {
- let prompt = Prompt::new(
+ ui::prompt(
+ cx,
"rename-to:".into(),
None,
ui::completers::none,
@@ -670,5 +665,4 @@ pub fn rename_symbol(cx: &mut Context) {
apply_workspace_edit(cx.editor, offset_encoding, &edits);
},
);
- cx.push_layer(Box::new(prompt));
}