Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion box.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (b *Box) Write(p []byte) (int, error) {
return b.Buf.Write(p)
}

// Render Box
// String renders Box
func (b *Box) String() (out string) {
borders := strings.Split(b.Border, " ")
lines := strings.Split(b.Buf.String(), "\n")
Expand Down
10 changes: 5 additions & 5 deletions terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ type winsize struct {
// Its not recommended write to buffer dirrectly, use package Print,Printf,Println fucntions instead.
var Screen *bytes.Buffer = new(bytes.Buffer)

// Get relative or absolute coordinates
// GetXY gets relative or absolute coordinates
// To get relative, set PCT flag to number:
//
// // Get 10% of total width to `x` and 20 to y
Expand Down Expand Up @@ -145,7 +145,7 @@ func MoveTo(str string, x int, y int) (out string) {
})
}

// Return carrier to start of line
// ResetLine returns carrier to start of line
func ResetLine(str string) (out string) {
return applyTransform(str, func(idx int, line string) string {
return fmt.Sprintf("%s%s", RESET_LINE, line)
Expand Down Expand Up @@ -188,7 +188,7 @@ func Background(str string, color int) string {
})
}

// Get console width
// Width gets console width
func Width() int {
ws, err := getWinsize()

Expand All @@ -199,7 +199,7 @@ func Width() int {
return int(ws.Col)
}

// Get console height
// Height gets console height
func Height() int {
ws, err := getWinsize()
if err != nil {
Expand All @@ -208,7 +208,7 @@ func Height() int {
return int(ws.Row)
}

// Get current height. Line count in Screen buffer.
// CurrentHeight gets current height. Line count in Screen buffer.
func CurrentHeight() int {
return strings.Count(Screen.String(), "\n")
}
Expand Down