Better click behaviour
This commit is contained in:
parent
30fea7233d
commit
f2a9876b81
3 changed files with 15 additions and 10 deletions
|
|
@ -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
|
||||
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue