@@ -1,20 +1,21 @@
1use helix_core::{
1use helix_core::{
2 comment, coords_at_pos, find_first_non_whitespace_char, find_root, graphemes, indent,
2 comment, coords_at_pos, find_first_non_whitespace_char, find_root, graphemes, indent,
3 line_ending::{
3 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,
5 str_is_line_ending,
5 str_is_line_ending,
7 match_brackets,
7 match_brackets,
8 movement::{self, Direction},
8 movement::{self, Direction},
9 object, pos_at_coords,
9 object, pos_at_coords,
10 regex::{self, Regex},
10 regex::{self, Regex},
11− register::{self, Register, Registers},
11+ register::Register,
12− search, selection, Change, ChangeSet, LineEnding, Position, Range, Rope, RopeGraphemes,
12+ search, selection, LineEnding, Position, Range, Rope, RopeGraphemes, RopeSlice, Selection,
13− RopeSlice, Selection, SmallVec, Tendril, Transaction, DEFAULT_LINE_ENDING,
13+ SmallVec, Tendril, Transaction,
16use helix_view::{
16use helix_view::{
17 document::{IndentStyle, Mode},
17 document::{IndentStyle, Mode},
18 input::KeyEvent,
19 input::KeyEvent,
19 keyboard::KeyCode,
20 keyboard::KeyCode,
20 view::{View, PADDING},
21 view::{View, PADDING},
@@ -25,19 +26,19 @@ use anyhow::anyhow;
25use helix_lsp::{
26use helix_lsp::{
27 util::{lsp_pos_to_pos, lsp_range_to_range, pos_to_lsp_pos, range_to_lsp_range},
28 util::{lsp_pos_to_pos, lsp_range_to_range, pos_to_lsp_pos, range_to_lsp_range},
28− LspProgressMap, OffsetEncoding,
29+ OffsetEncoding,
30use insert::*;
31use insert::*;
31use movement::Movement;
32use movement::Movement;
33use crate::{
34use crate::{
34− compositor::{self, Callback, Component, Compositor},
35+ compositor::{self, Component, Compositor},
35− ui::{self, Completion, Picker, Popup, Prompt, PromptEvent},
36+ ui::{self, Picker, Popup, Prompt, PromptEvent},
38−use crate::job::{self, Job, JobFuture, Jobs};
39+use crate::job::{self, Job, Jobs};
39use futures_util::{FutureExt, TryFutureExt};
40use futures_util::{FutureExt, TryFutureExt};
40−use std::{fmt, future::Future, path::Display, str::FromStr};
41+use std::{fmt, future::Future};
43 borrow::Cow,
44 borrow::Cow,
@@ -1148,7 +1149,6 @@ mod cmd {
1148 cx: &mut compositor::Context,
1149 cx: &mut compositor::Context,
1149 path: Option<P>,
1150 path: Option<P>,
1150 ) -> Result<tokio::task::JoinHandle<Result<(), anyhow::Error>>, anyhow::Error> {
1151 ) -> Result<tokio::task::JoinHandle<Result<(), anyhow::Error>>, anyhow::Error> {
1151− use anyhow::anyhow;
1152 let jobs = &mut cx.jobs;
1152 let jobs = &mut cx.jobs;
1153 let (view, doc) = current!(cx.editor);
1153 let (view, doc) = current!(cx.editor);
@@ -1723,7 +1723,6 @@ fn command_mode(cx: &mut Context) {
1723 // simple heuristic: if there's no just one part, complete command name.
1723 // simple heuristic: if there's no just one part, complete command name.
1724 // if there's a space, per command completion kicks in.
1724 // if there's a space, per command completion kicks in.
1725 if parts.len() <= 1 {
1725 if parts.len() <= 1 {
1726− use std::{borrow::Cow, ops::Range};
1727 let end = 0..;
1726 let end = 0..;
1728 cmd::TYPABLE_COMMAND_LIST
1727 cmd::TYPABLE_COMMAND_LIST
@@ -1753,8 +1752,6 @@ fn command_mode(cx: &mut Context) {
1754 }, // completion
1753 }, // completion
1755 move |cx: &mut compositor::Context, input: &str, event: PromptEvent| {
1754 move |cx: &mut compositor::Context, input: &str, event: PromptEvent| {
1756− use helix_view::editor::Action;
1758 if event != PromptEvent::Validate {
1755 if event != PromptEvent::Validate {
@@ -1792,7 +1789,6 @@ fn file_picker(cx: &mut Context) {
1794fn buffer_picker(cx: &mut Context) {
1791fn buffer_picker(cx: &mut Context) {
1795− use std::path::{Path, PathBuf};
1796 let current = view!(cx.editor).doc;
1792 let current = view!(cx.editor).doc;
1798 let picker = Picker::new(
1794 let picker = Picker::new(
@@ -1815,7 +1811,6 @@ fn buffer_picker(cx: &mut Context) {
1817 |editor: &mut Editor, (id, _path): &(DocumentId, Option<PathBuf>), _action| {
1813 |editor: &mut Editor, (id, _path): &(DocumentId, Option<PathBuf>), _action| {
1818− use helix_view::editor::Action;
1819 editor.switch(*id, Action::Replace);
1814 editor.switch(*id, Action::Replace);
@@ -2145,8 +2140,6 @@ fn goto_impl(
2145 locations: Vec<lsp::Location>,
2140 locations: Vec<lsp::Location>,
2146 offset_encoding: OffsetEncoding,
2141 offset_encoding: OffsetEncoding,
2148− use helix_view::editor::Action;
2150 push_jump(editor);
2143 push_jump(editor);
2152 fn jump_to(
2145 fn jump_to(
@@ -3181,7 +3174,6 @@ fn completion(cx: &mut Context) {
3181 if items.is_empty() {
3174 if items.is_empty() {
3184− use crate::compositor::AnyComponent;
3185 let size = compositor.size();
3177 let size = compositor.size();
3186 let ui = compositor
3178 let ui = compositor
3187 .find(std::any::type_name::<ui::EditorView>())
3179 .find(std::any::type_name::<ui::EditorView>())
@@ -3332,11 +3324,7 @@ fn rotate_view(cx: &mut Context) {
3334// split helper, clear it later
3326// split helper, clear it later
3335−use helix_view::editor::Action;
3337−use self::cmd::TypableCommand;
3338fn split(cx: &mut Context, action: Action) {
3327fn split(cx: &mut Context, action: Action) {
3339− use helix_view::editor::Action;
3340 let (view, doc) = current!(cx.editor);
3328 let (view, doc) = current!(cx.editor);
3341 let id = doc.id();
3329 let id = doc.id();
3342 let selection = doc.selection(view.id).clone();
3330 let selection = doc.selection(view.id).clone();