on master help sign in
clippy lint
eff6facBlaž Hrastnik
helix-lsp/src/transport.rs+1−2
@@ -138,11 +138,10 @@ impl Transport {
138 // println!("<- {} {:?}", method, notification);
138 // println!("<- {} {:?}", method, notification);
139 self.incoming.send(notification).await?;
139 self.incoming.send(notification).await?;
140 }
140 }
141− Message::Call(call) => {
141+ Message::Call(_call) => {
142 // println!("<- {:?}", call);
142 // println!("<- {:?}", call);
143 // dispatch
143 // dispatch
144 }
144 }
145− _ => unreachable!(),
146 };
145 };
147 Ok(())
146 Ok(())
148 }
147 }
helix-view/src/document.rs+2
@@ -164,4 +164,6 @@ impl Document {
164 // pub fn slice<R>(&self, range: R) -> RopeSlice where R: RangeBounds {
164 // pub fn slice<R>(&self, range: R) -> RopeSlice where R: RangeBounds {
165 // self.state.doc.slice
165 // self.state.doc.slice
166 // }
166 // }
167+
168+ // TODO: transact(Fn) ?
167}
169}
helix-view/src/editor.rs+6
@@ -12,6 +12,12 @@ pub struct Editor {
12 pub theme: Theme, // TODO: share one instance
12 pub theme: Theme, // TODO: share one instance
13}
13}
14
14
15+impl Default for Editor {
16+ fn default() -> Self {
17+ Self::new()
18+ }
19+}
20+
15impl Editor {
21impl Editor {
16 pub fn new() -> Self {
22 pub fn new() -> Self {
17 let theme = Theme::default();
23 let theme = Theme::default();
helix-view/src/keymap.rs+1−1
@@ -1,6 +1,6 @@
1use crate::commands::{self, Command};
1use crate::commands::{self, Command};
2use crate::document::Mode;
2use crate::document::Mode;
3−use helix_core::{hashmap, state};
3+use helix_core::hashmap;
4use std::collections::HashMap;
4use std::collections::HashMap;
5
5
6// Kakoune-inspired:
6// Kakoune-inspired:
helix-view/src/view.rs+20−20
@@ -86,24 +86,24 @@ impl View {
86 Some(Position::new(row, col))
86 Some(Position::new(row, col))
87 }
87 }
88
88
89− pub fn traverse<F>(&self, text: &RopeSlice, start: usize, end: usize, fun: F)
89+ // pub fn traverse<F>(&self, text: &RopeSlice, start: usize, end: usize, fun: F)
90− where
90+ // where
91− F: Fn(usize, usize),
91+ // F: Fn(usize, usize),
92− {
92+ // {
93− let start = self.screen_coords_at_pos(text, start);
93+ // let start = self.screen_coords_at_pos(text, start);
94− let end = self.screen_coords_at_pos(text, end);
94+ // let end = self.screen_coords_at_pos(text, end);
95−
95+
96− match (start, end) {
96+ // match (start, end) {
97− // fully on screen
97+ // // fully on screen
98− (Some(start), Some(end)) => {
98+ // (Some(start), Some(end)) => {
99− // we want to calculate ends of lines for each char..
99+ // // we want to calculate ends of lines for each char..
100− }
100+ // }
101− // from start to end of screen
101+ // // from start to end of screen
102− (Some(start), None) => {}
102+ // (Some(start), None) => {}
103− // from start of screen to end
103+ // // from start of screen to end
104− (None, Some(end)) => {}
104+ // (None, Some(end)) => {}
105− // not on screen
105+ // // not on screen
106− (None, None) => return,
106+ // (None, None) => return,
107− }
107+ // }
108− }
108+ // }
109}
109}