diff --git a/README.md b/README.md index 9c2185a..600d8f0 100644 --- a/README.md +++ b/README.md @@ -14,10 +14,10 @@ - [x] Search in buffer switcher - [x] File saving - [x] Syntax highlighting +- [x] Project search +- [x] Auto-indent (and related features) +- [x] Undo/redo ## Todo -- [ ] Replace -- [ ] Project search -- [ ] Auto-indent (and related features) -- [ ] Undo/redo +- [ ] Replace \ No newline at end of file diff --git a/src/theme.rs b/src/theme.rs index c2d8aca..1e09e39 100644 --- a/src/theme.rs +++ b/src/theme.rs @@ -88,7 +88,7 @@ impl Default for Theme { option_new: Color::AnsiValue(148), hl_token_whitespace: Color::Reset, - hl_token_ident: Color::AnsiValue(7), + hl_token_ident: Color::AnsiValue(15), hl_token_keyword: Color::AnsiValue(112), hl_token_number: Color::AnsiValue(45), hl_token_type: Color::AnsiValue(210), diff --git a/src/ui/input.rs b/src/ui/input.rs index 5ea7c02..4db6b20 100644 --- a/src/ui/input.rs +++ b/src/ui/input.rs @@ -131,11 +131,16 @@ impl Input { Ok(Resp::handled(None)) } Some(Action::Mouse(MouseAction::Click, pos, false)) => { - buffer.goto_cursor( - cursor_id, - [self.focus[0] + pos[0], self.focus[1] + pos[1]], - true, - ); + let pos = [self.focus[0] + pos[0], self.focus[1] + pos[1]]; + // If we're already in the right place, select the token instead + if let Some(cursor) = buffer.cursors.get(cursor_id) + && cursor.selection().is_none() + && buffer.text.to_coord(cursor.pos) == pos + { + buffer.select_token_cursor(cursor_id); + } else { + buffer.goto_cursor(cursor_id, pos, true); + } Ok(Resp::handled(None)) } Some(