winterm/scroll_helper.go
func (h *windowsAnsiEventHandler) effectiveSr(window SMALL_RECT) scrollRegion {
	top := addInRange(window.Top, h.sr.top, window.Top, window.Bottom)
	bottom := addInRange(window.Top, h.sr.bottom, window.Top, window.Bottom)
	if top >= bottom {
		top = window.Top
		bottom = window.Bottom
	}
	return scrollRegion{top: top, bottom: bottom}
}
func (h *windowsAnsiEventHandler) effectiveSr(window SMALL_RECT) scrollRegion {
	top := addInRange(window.Top, h.sr.top, window.Top, window.Bottom)
	bottom := addInRange(window.Top, h.sr.bottom, window.Top, window.Bottom)
	if top >= bottom {
		top = window.Top
		bottom = window.Bottom
	}
	return scrollRegion{top: top, bottom: bottom}
}
// effectiveSr gets the current effective scroll region in buffer coordinates