Skip to content

added alt+scrollwheel -> horizontal scroll - #169

Open
SwissalpS wants to merge 1 commit into
rxi:masterfrom
SwissalpS:horizontalScrollWheel
Open

added alt+scrollwheel -> horizontal scroll#169
SwissalpS wants to merge 1 commit into
rxi:masterfrom
SwissalpS:horizontalScrollWheel

Conversation

@SwissalpS

Copy link
Copy Markdown

permits reading long lines such as logfiles with more ease

@SwissalpS SwissalpS changed the title added alt+scrollwheel -> horizontal scrollbar added alt+scrollwheel -> horizontal scroll Jun 28, 2020
@anzz1

anzz1 commented Aug 1, 2026

Copy link
Copy Markdown

this is better so you can't scroll left out-of-bounds. idk how to do right and bottom of out-of-bounds tho, while top seems to be handled elsewhere already

function View:on_mouse_wheel(y)
  if self.scrollable then
    if keymap.modkeys['alt'] then
      local nx = self.scroll.to.x + y * -config.mouse_wheel_scroll
      self.scroll.to.x = nx > 0 and nx or 0
    else
      self.scroll.to.y = self.scroll.to.y + y * -config.mouse_wheel_scroll
    end
  end
end

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.

2 participants