-
Notifications
You must be signed in to change notification settings - Fork 607
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
Some minor updates for scrolling and for a double-click in diff #1039
Conversation
Perhaps the 3 test diffs are due to the small changes in scrolling ? |
I wanted to try this because I'm not sure what exactly changed. |
The changes are small but I found quite useful. The changes are for both mouse or key scrolling.
|
I configured --with-ncursesw and have ncurses 6.2 installed. But I don't think you need the most recent ncurses for any of this. |
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.
Thanks, it works with this config! 1. and 2. are obvious improvements!
I somehow can't figure how to reproduce the difference from 3. 🤔
src/view.c
Outdated
@@ -164,7 +172,24 @@ scroll_view(struct view *view, enum request request) | |||
die("request %d not handled in switch", request); | |||
} | |||
|
|||
unsigned long orig_offset = view->pos.offset; |
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 think the style convention here is to always declare variables at the beginning of a block (pre-C99).
|
||
int i; | ||
if (move_lines < 0) { | ||
for(i=0; i<-move_lines; i++) |
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.
at first I thought this was a reverse dereference operator 😆
ok, I will move the declaration up, outside the block in a amended commit in a few. |
Amended commit. |
Right, I see it now, it's a really nice improvement as well. I had already noticed the difference before, but then re-enabled |
Closing for now, may resubmit PR soon. |
This still applies cleanly and works well, I don't think this needs more work (besides maybe small style changes). |
Resubmitted from another repo at: #1060 |
@jonas Thank you for awesome tig. I use it every day.
Here are a few small updates that I think improve scrolling, and to not Enter when double-clicking on a diff line.
What do you think ?
thx,
-m