Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
rename EraseInLine to EraseLine
Browse files Browse the repository at this point in the history
  • Loading branch information
coryb committed Apr 18, 2017
1 parent 9358f19 commit 6a1b406
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion confirm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 := ""
Expand Down
2 changes: 1 addition & 1 deletion input.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions multiselect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions select.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion terminal/display_posix.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import (
"fmt"
)

func EraseInLine(mode EraseLineMode) {
func EraseLine(mode EraseLineMode) {
fmt.Printf("\x1b[%dK", mode)
}
2 changes: 1 addition & 1 deletion terminal/display_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"unsafe"
)

func EraseInLine(mode EraseLineMode) {
func EraseLine(mode EraseLineMode) {
handle := syscall.Handle(os.Stdout.Fd())

var csbi consoleScreenBufferInfo
Expand Down

0 comments on commit 6a1b406

Please sign in to comment.