-
-
Notifications
You must be signed in to change notification settings - Fork 651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(plugin): Add mouse events for plugins #629
Conversation
This looks exciting! Let me know when things are ready for a review! |
4f6252a
to
58ac85c
Compare
@TheLostLambda This should be ready for review. cargo._home_pawel_Projects_zellij.2021-08-26.09-05-06.mp4 |
6cd08d2
to
c6d89f3
Compare
@qepasa Sorry I missed your last message by so many days! I'll try to give this a full review tomorrow! Thanks for all of the hard work! |
Hey, no worries! I should have just pinged you on Zellij discord when I wrote that comment. Looking forward to your review. I guess some E2E tests would be nice to have some regression guards on this behavior (i.e. it broke at some point when borders were introduced). I can look into e2e tests as a follow up PR :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great overall! I've left a couple of comments and we need to fix a hard-crash / investigate some ClearScroll
/ isize
things, but I'm happy to merge after that!
Hey @qepasa ! Just checking in! Is there anything more that you need from me to get this over the line? I feel like it's quite close to being mergable! Thanks for everything you've done on it so far! :) |
…electing past the list of files and random double click action
8f1f641
to
8e67c47
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@qepasa Thanks for all of the great work here! I've left a couple of comments as discussion points, but since I find them all rather minor nits and I want to get this merged for you, I'll clean them up in a commit to main
!
If you disagree with any of these comments or think I'm missing something though, I'm happy to patch things up in a second, super small PR!
Thanks for adding this super useful functionality to Zellij!
} | ||
} | ||
|
||
fn render(&mut self, rows: usize, cols: usize) { | ||
for i in 0..rows { | ||
// If the key was pressed, set selected so that we can see the cursor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm slightly confused by this comment, is it in the right place? I could just be missing something!
for bar_part in tab_line { | ||
s = format!("{}{}", s, bar_part.part); | ||
let mut len_cnt = 0; | ||
dbg!(&tab_line); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably remove this before merging! Great for debugging, probably not great to fill up user's logs!
@@ -25,6 +25,16 @@ pub enum Key { | |||
Esc, | |||
} | |||
|
|||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] | |||
|
|||
pub enum Mouse { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we detect right-clicks with Terminon? If not, we could just rename LeftClick
to Click
or something like that. We could probably also change MouseHold
to Hold
and MouseRelease
to Release
to reduce redundancy!
Looks great otherwise!
Adds mouse events to
zellij_tile::Event
. Also, adds mouse scroll and mouse select in strider.tab-bar
i.e. tab selection.If possible tab reordering would be nice (drag to change order of tab)(with current mouse handling it would be difficult to implement)