@@ -1,20 +1,21 @@
11use helix_core::{
22 comment, coords_at_pos, find_first_non_whitespace_char, find_root, graphemes, indent,
33 line_ending::{
4− get_line_ending, get_line_ending_of_str, line_end_char_index, rope_end_without_line_ending,
4+ get_line_ending_of_str, line_end_char_index, rope_end_without_line_ending,
55 str_is_line_ending,
66 },
77 match_brackets,
88 movement::{self, Direction},
99 object, pos_at_coords,
1010 regex::{self, Regex},
11− register::{self, Register, Registers},
12− search, selection, Change, ChangeSet, LineEnding, Position, Range, Rope, RopeGraphemes,
13− RopeSlice, Selection, SmallVec, Tendril, Transaction, DEFAULT_LINE_ENDING,
11+ register::Register,
12+ search, selection, LineEnding, Position, Range, Rope, RopeGraphemes, RopeSlice, Selection,
13+ SmallVec, Tendril, Transaction,
1414};
1515
1616use helix_view::{
1717 document::{IndentStyle, Mode},
18+ editor::Action,
1819 input::KeyEvent,
1920 keyboard::KeyCode,
2021 view::{View, PADDING},
@@ -25,19 +26,19 @@ use anyhow::anyhow;
2526use helix_lsp::{
2627 lsp,
2728 util::{lsp_pos_to_pos, lsp_range_to_range, pos_to_lsp_pos, range_to_lsp_range},
28− LspProgressMap, OffsetEncoding,
29+ OffsetEncoding,
2930};
3031use insert::*;
3132use movement::Movement;
3233
3334use crate::{
34− compositor::{self, Callback, Component, Compositor},
35− ui::{self, Completion, Picker, Popup, Prompt, PromptEvent},
35+ compositor::{self, Component, Compositor},
36+ ui::{self, Picker, Popup, Prompt, PromptEvent},
3637};
3738
38−use crate::job::{self, Job, JobFuture, Jobs};
39+use crate::job::{self, Job, Jobs};
3940use futures_util::{FutureExt, TryFutureExt};
40−use std::{fmt, future::Future, path::Display, str::FromStr};
41+use std::{fmt, future::Future};
4142
4243use std::{
4344 borrow::Cow,
@@ -1148,7 +1149,6 @@ mod cmd {
11481149 cx: &mut compositor::Context,
11491150 path: Option<P>,
11501151 ) -> Result<tokio::task::JoinHandle<Result<(), anyhow::Error>>, anyhow::Error> {
1151− use anyhow::anyhow;
11521152 let jobs = &mut cx.jobs;
11531153 let (view, doc) = current!(cx.editor);
11541154
@@ -1723,7 +1723,6 @@ fn command_mode(cx: &mut Context) {
17231723 // simple heuristic: if there's no just one part, complete command name.
17241724 // if there's a space, per command completion kicks in.
17251725 if parts.len() <= 1 {
1726− use std::{borrow::Cow, ops::Range};
17271726 let end = 0..;
17281727 cmd::TYPABLE_COMMAND_LIST
17291728 .iter()
@@ -1753,8 +1752,6 @@ fn command_mode(cx: &mut Context) {
17531752 }
17541753 }, // completion
17551754 move |cx: &mut compositor::Context, input: &str, event: PromptEvent| {
1756− use helix_view::editor::Action;
1757−
17581755 if event != PromptEvent::Validate {
17591756 return;
17601757 }
@@ -1792,7 +1789,6 @@ fn file_picker(cx: &mut Context) {
17921789}
17931790
17941791fn buffer_picker(cx: &mut Context) {
1795− use std::path::{Path, PathBuf};
17961792 let current = view!(cx.editor).doc;
17971793
17981794 let picker = Picker::new(
@@ -1815,7 +1811,6 @@ fn buffer_picker(cx: &mut Context) {
18151811 }
18161812 },
18171813 |editor: &mut Editor, (id, _path): &(DocumentId, Option<PathBuf>), _action| {
1818− use helix_view::editor::Action;
18191814 editor.switch(*id, Action::Replace);
18201815 },
18211816 );
@@ -2145,8 +2140,6 @@ fn goto_impl(
21452140 locations: Vec<lsp::Location>,
21462141 offset_encoding: OffsetEncoding,
21472142) {
2148− use helix_view::editor::Action;
2149−
21502143 push_jump(editor);
21512144
21522145 fn jump_to(
@@ -3181,7 +3174,6 @@ fn completion(cx: &mut Context) {
31813174 if items.is_empty() {
31823175 return;
31833176 }
3184− use crate::compositor::AnyComponent;
31853177 let size = compositor.size();
31863178 let ui = compositor
31873179 .find(std::any::type_name::<ui::EditorView>())
@@ -3332,11 +3324,7 @@ fn rotate_view(cx: &mut Context) {
33323324}
33333325
33343326// split helper, clear it later
3335−use helix_view::editor::Action;
3336−
3337−use self::cmd::TypableCommand;
33383327fn split(cx: &mut Context, action: Action) {
3339− use helix_view::editor::Action;
33403328 let (view, doc) = current!(cx.editor);
33413329 let id = doc.id();
33423330 let selection = doc.selection(view.id).clone();