winterm/scroll_helper.go
func (h *windowsAnsiEventHandler) scrollLine(columns int, position COORD, info *CONSOLE_SCREEN_BUFFER_INFO) error {
	// Copy from and clip to the scroll region (full buffer width)
	scrollRect := SMALL_RECT{
		Top:    position.Y,
		Bottom: position.Y,
		Left:   position.X,
		Right:  info.Size.X - 1,
	}

	// Origin to which area should be copied
	destOrigin := COORD{
		X: position.X - int16(columns),
		Y: position.Y,
	}

	char := CHAR_INFO{
		UnicodeChar: ' ',
		Attributes:  h.attributes,
	}

	if err := ScrollConsoleScreenBuffer(h.fd, scrollRect, scrollRect, destOrigin, char); err != nil {
		return err
	}
	return nil
}
func (h *windowsAnsiEventHandler) scrollLine(columns int, position COORD, info *CONSOLE_SCREEN_BUFFER_INFO) error {
	// Copy from and clip to the scroll region (full buffer width)
	scrollRect := SMALL_RECT{
		Top:    position.Y,
		Bottom: position.Y,
		Left:   position.X,
		Right:  info.Size.X - 1,
	}

	// Origin to which area should be copied
	destOrigin := COORD{
		X: position.X - int16(columns),
		Y: position.Y,
	}

	char := CHAR_INFO{
		UnicodeChar: ' ',
		Attributes:  h.attributes,
	}

	if err := ScrollConsoleScreenBuffer(h.fd, scrollRect, scrollRect, destOrigin, char); err != nil {
		return err
	}
	return nil
}
func ( h * windowsAnsiEventHandler ) scrollLine ( columns int , position COORD , info * CONSOLE_SCREEN_BUFFER_INFO ) error { // Copy from and clip to the scroll region (full buffer width) scrollRect := SMALL_RECT { Top : position . Y , Bottom : position . Y , Left : position . X , Right : info . Size . X - 1 , } // Origin to which area should be copied destOrigin := COORD { X : position . X - int16 ( columns ) , Y : position . Y , } char := CHAR_INFO { UnicodeChar : ' ' , Attributes : h . attributes , } if err := ScrollConsoleScreenBuffer ( h . fd , scrollRect , scrollRect , destOrigin , char ) ; err != nil { return err } return nil }
// scrollLine scrolls a line horizontally starting at the provided position by a number of columns.
scrollLine scrolls a line horizontally starting at the provided position by a number of columns .