on master help sign in
Merge some imports.
commitcbcacb1063c9b6384867a6078a75595ae2ff6861 authorBlaž Hrastnik <blaz@mxxn.io> dateMon 22 Mar 2021, 12:40 (6 years ago) parentc4792ef
15 files changed+47−46
helix-core/src/lib.rs+1−2 helix-core/src/syntax.rs+14−11 helix-core/src/transaction.rs+1−2 helix-lsp/src/select_all.rs+7−7 helix-term/src/application.rs+2−4 helix-term/src/commands.rs+4−2 helix-term/src/compositor.rs+1−2 helix-term/src/ui/editor.rs+6−4 helix-term/src/ui/markdown.rs+1−1 helix-term/src/ui/menu.rs+1−1 helix-term/src/ui/picker.rs+1−1 helix-term/src/ui/popup.rs+5−3 helix-term/src/ui/prompt.rs+1−2 helix-term/src/ui/text.rs+1−1 helix-view/src/editor.rs+1−3
helix-core/src/lib.rs+1−2
@@ -51,8 +51,7 @@ pub use tendril::StrTendril as Tendril;
5151pub use {regex, tree_sitter};
5252
5353pub use position::{coords_at_pos, pos_at_coords, Position};
54−pub use selection::Range;
55−pub use selection::Selection;
54+pub use selection::{Range, Selection};
5655pub use syntax::Syntax;
5756
5857pub use diagnostic::Diagnostic;
helix-core/src/syntax.rs+14−11
@@ -1,12 +1,13 @@
11use crate::{Change, Rope, RopeSlice, Transaction};
2−pub use helix_syntax::Lang;
3−pub use helix_syntax::{get_language, get_language_name};
4−
5−use std::borrow::Cow;
6−use std::cell::RefCell;
7−use std::collections::HashMap;
8−use std::path::{Path, PathBuf};
9−use std::sync::Arc;
2+pub use helix_syntax::{get_language, get_language_name, Lang};
3+
4+use std::{
5+ borrow::Cow,
6+ cell::RefCell,
7+ collections::HashMap,
8+ path::{Path, PathBuf},
9+ sync::Arc,
10+};
1011
1112use once_cell::sync::{Lazy, OnceCell};
1213
@@ -355,9 +356,11 @@ pub struct LanguageLayer {
355356 pub(crate) tree: Option<Tree>,
356357}
357358
358−use crate::coords_at_pos;
359−use crate::transaction::{ChangeSet, Operation};
360−use crate::Tendril;
359+use crate::{
360+ coords_at_pos,
361+ transaction::{ChangeSet, Operation},
362+ Tendril,
363+};
361364
362365impl LanguageLayer {
363366 // pub fn new() -> Self {
helix-core/src/transaction.rs+1−2
@@ -1,6 +1,5 @@
11use crate::{Range, Rope, Selection, State, Tendril};
2−use std::borrow::Cow;
3−use std::convert::TryFrom;
2+use std::{borrow::Cow, convert::TryFrom};
43
54/// (from, to, replacement)
65pub type Change = (usize, usize, Option<Tendril>);
helix-lsp/src/select_all.rs+7−7
@@ -1,15 +1,15 @@
11//! An unbounded set of streams
22
3−use core::fmt::{self, Debug};
4−use core::iter::FromIterator;
5−use core::pin::Pin;
3+use core::{
4+ fmt::{self, Debug},
5+ iter::FromIterator,
6+ pin::Pin,
7+};
68
7−use smol::ready;
8−use smol::stream::Stream;
9+use smol::{ready, stream::Stream};
910use std::task::{Context, Poll};
1011
11−use futures_util::stream::FusedStream;
12−use futures_util::stream::{FuturesUnordered, StreamExt, StreamFuture};
12+use futures_util::stream::{FusedStream, FuturesUnordered, StreamExt, StreamFuture};
1313
1414/// An unbounded set of streams
1515///
helix-term/src/application.rs+2−4
@@ -2,8 +2,7 @@ use clap::ArgMatches as Args;
22
33use helix_view::{document::Mode, Document, Editor, Theme, View};
44
5−use crate::compositor::Compositor;
6−use crate::ui;
5+use crate::{compositor::Compositor, ui};
76
87use log::{error, info};
98
@@ -139,9 +138,8 @@ impl Application {
139138 .diagnostics
140139 .into_iter()
141140 .map(|diagnostic| {
142− use helix_core::diagnostic::Severity::*;
143141 use helix_core::{
144− diagnostic::{Range, Severity},
142+ diagnostic::{Range, Severity, Severity::*},
145143 Diagnostic,
146144 };
147145 use helix_lsp::{lsp, util::lsp_pos_to_pos};
helix-term/src/commands.rs+4−2
@@ -10,8 +10,10 @@ use helix_core::{
1010
1111use once_cell::sync::Lazy;
1212
13−use crate::compositor::Compositor;
14−use crate::ui::{self, Popup, Prompt, PromptEvent};
13+use crate::{
14+ compositor::Compositor,
15+ ui::{self, Popup, Prompt, PromptEvent},
16+};
1517
1618use std::path::PathBuf;
1719
helix-term/src/compositor.rs+1−2
@@ -5,8 +5,7 @@
55use crossterm::event::Event;
66use helix_core::Position;
77use smol::Executor;
8−use tui::buffer::Buffer as Surface;
9−use tui::layout::Rect;
8+use tui::{buffer::Buffer as Surface, layout::Rect};
109
1110pub type Callback = Box<dyn FnOnce(&mut Compositor, &mut Editor)>;
1211
helix-term/src/ui/editor.rs+6−4
@@ -1,7 +1,9 @@
1−use crate::commands;
2−use crate::compositor::{Component, Compositor, Context, EventResult};
3−use crate::keymap::{self, Keymaps};
4−use crate::ui::text_color;
1+use crate::{
2+ commands,
3+ compositor::{Component, Compositor, Context, EventResult},
4+ keymap::{self, Keymaps},
5+ ui::text_color,
6+};
57
68use helix_core::{
79 indent::TAB_WIDTH,
helix-term/src/ui/markdown.rs+1−1
@@ -1,7 +1,7 @@
11use crate::compositor::{Component, Compositor, Context, EventResult};
22use crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers};
3−use tui::buffer::Buffer as Surface;
43use tui::{
4+ buffer::Buffer as Surface,
55 layout::Rect,
66 style::{Color, Style},
77 text::Text,
helix-term/src/ui/menu.rs+1−1
@@ -1,7 +1,7 @@
11use crate::compositor::{Component, Compositor, Context, EventResult};
22use crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers};
3−use tui::buffer::Buffer as Surface;
43use tui::{
4+ buffer::Buffer as Surface,
55 layout::Rect,
66 style::{Color, Style},
77 widgets::{Block, Borders},
helix-term/src/ui/picker.rs+1−1
@@ -1,7 +1,7 @@
11use crate::compositor::{Component, Compositor, Context, EventResult};
22use crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers};
3−use tui::buffer::Buffer as Surface;
43use tui::{
4+ buffer::Buffer as Surface,
55 layout::Rect,
66 style::{Color, Style},
77 widgets::{Block, Borders},
helix-term/src/ui/popup.rs+5−3
@@ -1,7 +1,7 @@
11use crate::compositor::{Component, Compositor, Context, EventResult};
22use crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers};
3−use tui::buffer::Buffer as Surface;
43use tui::{
4+ buffer::Buffer as Surface,
55 layout::Rect,
66 style::{Color, Style},
77 widgets::{Block, Borders},
@@ -107,8 +107,10 @@ impl Component for Popup {
107107 }
108108
109109 fn render(&self, viewport: Rect, surface: &mut Surface, cx: &mut Context) {
110− use tui::text::Text;
111− use tui::widgets::{Paragraph, Widget, Wrap};
110+ use tui::{
111+ text::Text,
112+ widgets::{Paragraph, Widget, Wrap},
113+ };
112114
113115 cx.scroll = Some(self.scroll);
114116
helix-term/src/ui/prompt.rs+1−2
@@ -1,8 +1,7 @@
11use crate::compositor::{Component, Compositor, Context, EventResult};
22use crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers};
33use helix_core::Position;
4−use helix_view::Editor;
5−use helix_view::Theme;
4+use helix_view::{Editor, Theme};
65use std::{borrow::Cow, ops::RangeFrom};
76
87pub struct Prompt {
helix-term/src/ui/text.rs+1−1
@@ -1,7 +1,7 @@
11use crate::compositor::{Component, Compositor, Context, EventResult};
22use crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers};
3−use tui::buffer::Buffer as Surface;
43use tui::{
4+ buffer::Buffer as Surface,
55 layout::Rect,
66 style::{Color, Style},
77};
helix-view/src/editor.rs+1−3
@@ -1,6 +1,4 @@
1−use crate::theme::Theme;
2−use crate::tree::Tree;
3−use crate::{Document, View};
1+use crate::{theme::Theme, tree::Tree, Document, View};
42
53use std::path::PathBuf;
64