winterm/win_event_handler.go
func (h *windowsAnsiEventHandler) executeLF() error {
	handled, err := h.simulateLF(false)
	if err != nil {
		return err
	}
	if !handled {
		// Windows LF will reset the cursor column position. Write the LF
		// and restore the cursor position.
		pos, _, err := h.getCurrentInfo()
		if err != nil {
			return err
		}
		h.buffer.WriteByte(ansiterm.ANSI_LINE_FEED)
		if pos.X != 0 {
			if err := h.Flush(); err != nil {
				return err
			}
			h.logf("Resetting cursor position for LF without CR")
			if err := SetConsoleCursorPosition(h.fd, pos); err != nil {
				return err
			}
		}
	}
	return nil
}
func (h *windowsAnsiEventHandler) executeLF() error {
	handled, err := h.simulateLF(false)
	if err != nil {
		return err
	}
	if !handled {
		// Windows LF will reset the cursor column position. Write the LF
		// and restore the cursor position.
		pos, _, err := h.getCurrentInfo()
		if err != nil {
			return err
		}
		h.buffer.WriteByte(ansiterm.ANSI_LINE_FEED)
		if pos.X != 0 {
			if err := h.Flush(); err != nil {
				return err
			}
			h.logf("Resetting cursor position for LF without CR")
			if err := SetConsoleCursorPosition(h.fd, pos); err != nil {
				return err
			}
		}
	}
	return nil
}
func ( h * windowsAnsiEventHandler ) executeLF ( ) error { handled , err := h . simulateLF ( false ) if err != nil { return err } if ! handled { // Windows LF will reset the cursor column position. Write the LF // and restore the cursor position. pos , _ , err := h . getCurrentInfo ( ) if err != nil { return err } h . buffer . WriteByte ( ansiterm . ANSI_LINE_FEED ) if pos . X != 0 { if err := h . Flush ( ) ; err != nil { return err } h . logf ( " " ) if err := SetConsoleCursorPosition ( h . fd , pos ) ; err != nil { return err } } } return nil }
// executeLF executes a LF without a CR.
executeLF executes a LF without a CR .