diff --git a/confirm.go b/confirm.go index ad159c86..25f735bc 100644 --- a/confirm.go +++ b/confirm.go @@ -118,7 +118,7 @@ func (c *Confirm) Cleanup(rl *readline.Instance, val interface{}) error { // go up one line terminal.CursorPreviousLine(1) // clear the line - terminal.EraseInLine(terminal.ERASE_LINE_ALL) + terminal.EraseLine(terminal.ERASE_LINE_ALL) // the string version of the answer ans := "" diff --git a/input.go b/input.go index 8deae056..4b27ac0c 100644 --- a/input.go +++ b/input.go @@ -52,7 +52,7 @@ func (i *Input) Cleanup(rl *readline.Instance, val interface{}) error { // go up one line terminal.CursorPreviousLine(1) // clear the line - terminal.EraseInLine(terminal.ERASE_LINE_ALL) + terminal.EraseLine(terminal.ERASE_LINE_ALL) // render the template out, err := core.RunTemplate( diff --git a/multiselect.go b/multiselect.go index 9f0b0271..bcf10114 100644 --- a/multiselect.go +++ b/multiselect.go @@ -75,7 +75,7 @@ func (m *MultiSelect) render() error { // clean up what we left behind last time for range m.Options { terminal.CursorPreviousLine(1) - terminal.EraseInLine(terminal.ERASE_LINE_ALL) + terminal.EraseLine(terminal.ERASE_LINE_ALL) } // render the template summarizing the current state @@ -170,10 +170,10 @@ func (m *MultiSelect) Prompt(rl *readline.Instance) (interface{}, error) { // Cleanup removes the options section, and renders the ask like a normal question. func (m *MultiSelect) Cleanup(rl *readline.Instance, val interface{}) error { terminal.CursorPreviousLine(1) - terminal.EraseInLine(terminal.ERASE_LINE_ALL) + terminal.EraseLine(terminal.ERASE_LINE_ALL) for range m.Options { terminal.CursorPreviousLine(1) - terminal.EraseInLine(terminal.ERASE_LINE_ALL) + terminal.EraseLine(terminal.ERASE_LINE_ALL) } // execute the output summary template with the answer diff --git a/select.go b/select.go index ea2ec71e..7f8ba7e0 100644 --- a/select.go +++ b/select.go @@ -65,7 +65,7 @@ func (s *Select) OnChange(line []rune, pos int, key rune) (newLine []rune, newPo func (s *Select) render() error { for range s.Options { terminal.CursorPreviousLine(1) - terminal.EraseInLine(terminal.ERASE_LINE_ALL) + terminal.EraseLine(terminal.ERASE_LINE_ALL) } // the formatted response @@ -153,10 +153,10 @@ func (s *Select) Prompt(rl *readline.Instance) (interface{}, error) { func (s *Select) Cleanup(rl *readline.Instance, val interface{}) error { terminal.CursorPreviousLine(1) - terminal.EraseInLine(terminal.ERASE_LINE_ALL) + terminal.EraseLine(terminal.ERASE_LINE_ALL) for range s.Options { terminal.CursorPreviousLine(1) - terminal.EraseInLine(terminal.ERASE_LINE_ALL) + terminal.EraseLine(terminal.ERASE_LINE_ALL) } // execute the output summary template with the answer diff --git a/terminal/display_posix.go b/terminal/display_posix.go index 06819dee..47a765c7 100644 --- a/terminal/display_posix.go +++ b/terminal/display_posix.go @@ -6,6 +6,6 @@ import ( "fmt" ) -func EraseInLine(mode EraseLineMode) { +func EraseLine(mode EraseLineMode) { fmt.Printf("\x1b[%dK", mode) } diff --git a/terminal/display_windows.go b/terminal/display_windows.go index 2d36e5df..31c03bf2 100644 --- a/terminal/display_windows.go +++ b/terminal/display_windows.go @@ -6,7 +6,7 @@ import ( "unsafe" ) -func EraseInLine(mode EraseLineMode) { +func EraseLine(mode EraseLineMode) { handle := syscall.Handle(os.Stdout.Fd()) var csbi consoleScreenBufferInfo