mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04:00
clippy lint
This commit is contained in:
parent
f5981f72c2
commit
eff6fac9ec
@ -138,11 +138,10 @@ pub async fn recv_msg(&mut self, msg: Message) -> anyhow::Result<()> {
|
||||
// println!("<- {} {:?}", method, notification);
|
||||
self.incoming.send(notification).await?;
|
||||
}
|
||||
Message::Call(call) => {
|
||||
Message::Call(_call) => {
|
||||
// println!("<- {:?}", call);
|
||||
// dispatch
|
||||
}
|
||||
_ => unreachable!(),
|
||||
};
|
||||
Ok(())
|
||||
}
|
||||
|
@ -164,4 +164,6 @@ pub fn selection(&self) -> &Selection {
|
||||
// pub fn slice<R>(&self, range: R) -> RopeSlice where R: RangeBounds {
|
||||
// self.state.doc.slice
|
||||
// }
|
||||
|
||||
// TODO: transact(Fn) ?
|
||||
}
|
||||
|
@ -12,6 +12,12 @@ pub struct Editor {
|
||||
pub theme: Theme, // TODO: share one instance
|
||||
}
|
||||
|
||||
impl Default for Editor {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl Editor {
|
||||
pub fn new() -> Self {
|
||||
let theme = Theme::default();
|
||||
|
@ -1,6 +1,6 @@
|
||||
use crate::commands::{self, Command};
|
||||
use crate::document::Mode;
|
||||
use helix_core::{hashmap, state};
|
||||
use helix_core::hashmap;
|
||||
use std::collections::HashMap;
|
||||
|
||||
// Kakoune-inspired:
|
||||
|
@ -86,24 +86,24 @@ pub fn screen_coords_at_pos(&self, text: &RopeSlice, pos: usize) -> Option<Posit
|
||||
Some(Position::new(row, col))
|
||||
}
|
||||
|
||||
pub fn traverse<F>(&self, text: &RopeSlice, start: usize, end: usize, fun: F)
|
||||
where
|
||||
F: Fn(usize, usize),
|
||||
{
|
||||
let start = self.screen_coords_at_pos(text, start);
|
||||
let end = self.screen_coords_at_pos(text, end);
|
||||
// pub fn traverse<F>(&self, text: &RopeSlice, start: usize, end: usize, fun: F)
|
||||
// where
|
||||
// F: Fn(usize, usize),
|
||||
// {
|
||||
// let start = self.screen_coords_at_pos(text, start);
|
||||
// let end = self.screen_coords_at_pos(text, end);
|
||||
|
||||
match (start, end) {
|
||||
// fully on screen
|
||||
(Some(start), Some(end)) => {
|
||||
// we want to calculate ends of lines for each char..
|
||||
}
|
||||
// from start to end of screen
|
||||
(Some(start), None) => {}
|
||||
// from start of screen to end
|
||||
(None, Some(end)) => {}
|
||||
// not on screen
|
||||
(None, None) => return,
|
||||
}
|
||||
}
|
||||
// match (start, end) {
|
||||
// // fully on screen
|
||||
// (Some(start), Some(end)) => {
|
||||
// // we want to calculate ends of lines for each char..
|
||||
// }
|
||||
// // from start to end of screen
|
||||
// (Some(start), None) => {}
|
||||
// // from start of screen to end
|
||||
// (None, Some(end)) => {}
|
||||
// // not on screen
|
||||
// (None, None) => return,
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user