Skip to content

winterm: remove addInRange() utility - #29

Open
Sebastiaan van Stijn (thaJeztah) wants to merge 1 commit into
Azure:masterfrom
thaJeztah:remove_addInRange
Open

winterm: remove addInRange() utility#29
Sebastiaan van Stijn (thaJeztah) wants to merge 1 commit into
Azure:masterfrom
thaJeztah:remove_addInRange

Conversation

@thaJeztah

Copy link
Copy Markdown
Contributor

It was only used in a single place, and a thin wrapper for ensureInRange().

Comment thread winterm/scroll_helper.go
top := addInRange(window.Top, h.sr.top, window.Top, window.Bottom)
bottom := addInRange(window.Top, h.sr.bottom, window.Top, window.Bottom)
top := ensureInRange(window.Top+h.sr.top, window.Top, window.Bottom)
bottom := ensureInRange(window.Top+h.sr.bottom, window.Top, window.Bottom)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

John Starks (@jstarks) trying to get my head around if this is correct or a bug; wondering if this should be;

Suggested change
bottom := ensureInRange(window.Top+h.sr.bottom, window.Top, window.Bottom)
bottom := ensureInRange(window.Bottom+h.sr.bottom, window.Top, window.Bottom)

Looks like it was added in 396f10f

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I believe it's correct as-is. The effective scroll region is relative to the window rectangle, so adding to the window top is the right thing.

Of course I wrote this code 5 years ago so who knows ;)

It was only used in a single place, and a thin wrapper for
ensureInRange().

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah

Copy link
Copy Markdown
Contributor Author

rebased

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