on master help sign in
clippy lint
commiteff6fac9ece0700f0ed8eb0a230b6816fa7cece7 authorBlaž Hrastnik <blaz@mxxn.io> dateFri 23 Oct 2020, 13:51 (6 years ago) parentf5981f7
5 files changed+30−23
helix-lsp/src/transport.rs+1−2 helix-view/src/document.rs+2 helix-view/src/editor.rs+6 helix-view/src/keymap.rs+1−1 helix-view/src/view.rs+20−20
helix-lsp/src/transport.rs+1−2
@@ -138,11 +138,10 @@ impl Transport {
138138 // println!("<- {} {:?}", method, notification);
139139 self.incoming.send(notification).await?;
140140 }
141− Message::Call(call) => {
141+ Message::Call(_call) => {
142142 // println!("<- {:?}", call);
143143 // dispatch
144144 }
145− _ => unreachable!(),
146145 };
147146 Ok(())
148147 }
helix-view/src/document.rs+2
@@ -164,4 +164,6 @@ impl Document {
164164 // pub fn slice<R>(&self, range: R) -> RopeSlice where R: RangeBounds {
165165 // self.state.doc.slice
166166 // }
167+
168+ // TODO: transact(Fn) ?
167169}
helix-view/src/editor.rs+6
@@ -12,6 +12,12 @@ pub struct Editor {
1212 pub theme: Theme, // TODO: share one instance
1313}
1414
15+impl Default for Editor {
16+ fn default() -> Self {
17+ Self::new()
18+ }
19+}
20+
1521impl Editor {
1622 pub fn new() -> Self {
1723 let theme = Theme::default();
helix-view/src/keymap.rs+1−1
@@ -1,6 +1,6 @@
11use crate::commands::{self, Command};
22use crate::document::Mode;
3−use helix_core::{hashmap, state};
3+use helix_core::hashmap;
44use std::collections::HashMap;
55
66// Kakoune-inspired:
helix-view/src/view.rs+20−20
@@ -86,24 +86,24 @@ impl View {
8686 Some(Position::new(row, col))
8787 }
8888
89− pub fn traverse<F>(&self, text: &RopeSlice, start: usize, end: usize, fun: F)
90− where
91− F: Fn(usize, usize),
92− {
93− let start = self.screen_coords_at_pos(text, start);
94− let end = self.screen_coords_at_pos(text, end);
95−
96− match (start, end) {
97− // fully on screen
98− (Some(start), Some(end)) => {
99− // we want to calculate ends of lines for each char..
100− }
101− // from start to end of screen
102− (Some(start), None) => {}
103− // from start of screen to end
104− (None, Some(end)) => {}
105− // not on screen
106− (None, None) => return,
107− }
108− }
89+ // pub fn traverse<F>(&self, text: &RopeSlice, start: usize, end: usize, fun: F)
90+ // where
91+ // F: Fn(usize, usize),
92+ // {
93+ // let start = self.screen_coords_at_pos(text, start);
94+ // let end = self.screen_coords_at_pos(text, end);
95+
96+ // match (start, end) {
97+ // // fully on screen
98+ // (Some(start), Some(end)) => {
99+ // // we want to calculate ends of lines for each char..
100+ // }
101+ // // from start to end of screen
102+ // (Some(start), None) => {}
103+ // // from start of screen to end
104+ // (None, Some(end)) => {}
105+ // // not on screen
106+ // (None, None) => return,
107+ // }
108+ // }
109109}