Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ccrusius
Copy link

Also changes the scrollback() function so that the amount to scroll
can be configured as a fraction of the screen height.

This fixes #103.

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.
@gwn
Copy link

gwn commented Feb 21, 2021

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
Copy link

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);
Copy link

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.

@kugurerdem
Copy link

I have also tried this patch and it seems to work very well. Thanks a lot @ccrusius !

@rpmohn
Copy link
Contributor

rpmohn commented Feb 16, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for mouse wheel scrolling
5 participants