Skip to content

Commit

Permalink
don't update cursor if not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhou121 committed Sep 13, 2023
1 parent 5bfc597 commit 4154fe3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lapce-app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ bytemuck = "1.8.0"
tokio = { version = "1.21", features = ["full"] }
futures = "0.3.26"
clipboard = "0.5.0"
floem = { git = "https://github.com/lapce/floem", rev = "143e81b3ea901c5436a1dcfa17bcdea9079645f4" }
floem = { git = "https://github.com/lapce/floem", rev = "49ca91c7814b88685ff53f957c3d23fe9f21cdcb" }
# floem = { path = "../../workspaces/floem" }
config = { version = "0.13.2", default-features = false, features = ["toml"] }
structdesc = { git = "https://github.com/lapce/structdesc" }
Expand Down
4 changes: 3 additions & 1 deletion lapce-app/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2068,7 +2068,9 @@ impl EditorData {
pub fn pointer_move(&self, pointer_event: &PointerMoveEvent) {
let mode = self.cursor.with_untracked(|c| c.get_mode());
let (offset, is_inside) = self.view.offset_of_point(mode, pointer_event.pos);
if self.active.get_untracked() {
if self.active.get_untracked()
&& self.cursor.with_untracked(|c| c.offset()) != offset
{
self.cursor.update(|cursor| {
cursor.set_offset(offset, true, pointer_event.modifiers.alt_key())
});
Expand Down

0 comments on commit 4154fe3

Please sign in to comment.