cursor.go
This file
Path
cursor/cursor.go
26 lines · 786 bytes · Go
Last changed by
chore: prepare v2 (#1116)Drew Smirnoffbefore adoption02d6f06
History of this fileTake it
The walk stopped after 200 commits: lines older than 6837ed2 point at it.
fix: lint issues (#909)Carlos Alexandro Beckerbefore adoption817c4bd
line 1why, one step back1// Package cursor provides cursor modes.feat(deps): bump github.com/charmbracelet/bubbletea from 0.27.0 to 1.0.0 (#661)dependabot[bot]before adoption6837ed2
lines 2–4why, one step back2package cursor34import (chore: update to bubbletea v2 (#1112)Drew Smirnoffbefore adoptionf6dd28e
lines 5–6why, one step back5 "charm.land/bubbles/v2/textarea"6 "charm.land/bubbles/v2/textinput"chore: prepare v2 (#1116)Drew Smirnoffbefore adoption02d6f06
line 7why, one step back7 "charm.land/gum/v2/style"feat(deps): bump github.com/charmbracelet/bubbletea from 0.27.0 to 1.0.0 (#661)dependabot[bot]before adoption6837ed2
lines 8–9why, one step back8)9chore: update to bubbletea v2 (#1112)Drew Smirnoffbefore adoptionf6dd28e
lines 10–25why, one step back10// TextInput applies the given cursor mode and style to the text input.11func TextInput(i *textinput.Model, mode string, s style.Styles) {12 styles := i.Styles()13 styles.Cursor.Color = s.ToLipgloss().GetForeground()14 styles.Cursor.Blink = mode == "blink"15 i.SetStyles(styles)16 i.SetVirtualCursor(mode != "hide")17}1819// TextArea applies the given cursor mode and style to the text area.20func TextArea(a *textarea.Model, mode string, s style.Styles) {21 styles := a.Styles()22 styles.Cursor.Color = s.ToLipgloss().GetForeground()23 styles.Cursor.Blink = mode == "blink"24 a.SetStyles(styles)25 a.SetVirtualCursor(mode != "hide")feat(deps): bump github.com/charmbracelet/bubbletea from 0.27.0 to 1.0.0 (#661)dependabot[bot]before adoption6837ed2
line 26why, one step back26}