-
Notifications
You must be signed in to change notification settings - Fork 106
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
Add default support for scrolling with the mouse wheel. #104
base: master
Are you sure you want to change the base?
Conversation
Also changes the scrollback() function so that the amount to scroll can be configured as a fraction of the screen height. This fixes martanne#103.
Hi, I'm a long time dvtm user. Just wanted to note that this patch seems to be working properly and I'm very happy with the feature, although I don't know about the implementation details. Thank you @ccrusius ! |
@@ -10,7 +10,7 @@ DEBUG_CFLAGS = ${CFLAGS} -UNDEBUG -O0 -g -ggdb -Wall -Wextra -Wno-unused-paramet | |||
|
|||
all: dvtm dvtm-editor | |||
|
|||
config.h: | |||
config.h: config.def.h |
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.
This is bad. It will overwrite custom config.h
div = -2; | ||
|
||
if (div > sel->h) | ||
vt_scroll(sel->term, abs(div)/div); |
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.
This does not seem right. You compare div, which is essentially compile-time constant with buffer height.
I have also tried this patch and it seems to work very well. Thanks a lot @ccrusius ! |
Shameless plug for a4 https://a4term.com which is a rewrite of dvtm and implements configurable scrolling with the mouse wheel by default. You can specify a number of lines to scroll (with an integer) or a percentage of a screen (with a decimal number). You can scroll whichever window the mouse is hovering over, not just the selected window. You can also use the mouse for additional configurable actions by clicking on a tag in the status bar, the layout symbol, and more. End of shameless plug. |
Also changes the scrollback() function so that the amount to scroll
can be configured as a fraction of the screen height.
This fixes #103.