Skip to content

Commit

Permalink
changed var name from 'str' to 's' for uniformity
Browse files Browse the repository at this point in the history
  • Loading branch information
gbrlmarn committed Mar 14, 2024
1 parent 993fdbc commit b051588
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions examples/glamour/main.go
Expand Up @@ -73,12 +73,12 @@ func newExample() (*example, error) {
return nil, err
}

str, err := renderer.Render(content)
s, err := renderer.Render(content)
if err != nil {
return nil, err
}

vp.SetContent(str)
vp.SetContent(s)

return &example{
viewport: vp,
Expand Down
4 changes: 2 additions & 2 deletions examples/list-simple/main.go
Expand Up @@ -37,7 +37,7 @@ func (d itemDelegate) Render(w io.Writer, m list.Model, index int, listItem list
return
}

str := fmt.Sprintf("%d. %s", index+1, i)
s := fmt.Sprintf("%d. %s", index+1, i)

fn := itemStyle.Render
if index == m.Index() {
Expand All @@ -46,7 +46,7 @@ func (d itemDelegate) Render(w io.Writer, m list.Model, index int, listItem list
}
}

fmt.Fprint(w, fn(str))
fmt.Fprint(w, fn(s))
}

type model struct {
Expand Down
6 changes: 3 additions & 3 deletions examples/spinner/main.go
Expand Up @@ -57,11 +57,11 @@ func (m model) View() string {
if m.err != nil {
return m.err.Error()
}
str := fmt.Sprintf("\n\n %s Loading forever...press q to quit\n\n", m.spinner.View())
s := fmt.Sprintf("\n\n %s Loading forever...press q to quit\n\n", m.spinner.View())
if m.quitting {
return str + "\n"
return s + "\n"
}
return str
return s
}

func main() {
Expand Down
6 changes: 3 additions & 3 deletions key.go
Expand Up @@ -46,7 +46,7 @@ type KeyMsg Key

// String returns a string representation for a key message. It's safe (and
// encouraged) for use in key comparison.
func (k KeyMsg) String() (str string) {
func (k KeyMsg) String() (s string) {
return Key(k).String()
}

Expand All @@ -64,7 +64,7 @@ type Key struct {
// k := Key{Type: KeyEnter}
// fmt.Println(k)
// // Output: enter
func (k Key) String() (str string) {
func (k Key) String() (s string) {
var buf strings.Builder
if k.Alt {
buf.WriteString("alt+")
Expand Down Expand Up @@ -107,7 +107,7 @@ func (k Key) String() (str string) {
// }
type KeyType int

func (k KeyType) String() (str string) {
func (k KeyType) String() (s string) {
if s, ok := keyNames[k]; ok {
return s
}
Expand Down
4 changes: 2 additions & 2 deletions mouse.go
Expand Up @@ -170,8 +170,8 @@ const (
//
// https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Extended-coordinates
func parseSGRMouseEvent(buf []byte) MouseEvent {
str := string(buf[3:])
matches := mouseSGRRegex.FindStringSubmatch(str)
s := string(buf[3:])
matches := mouseSGRRegex.FindStringSubmatch(s)
if len(matches) != 5 {
// Unreachable, we already checked the regex in `detectOneMsg`.
panic("invalid mouse event")
Expand Down

0 comments on commit b051588

Please sign in to comment.