MCPcopy
hub / github.com/mathaou/termdbms / placeholderView

Method placeholderView

tuiutil/textinput.go:729–747  ·  view source on GitHub ↗

placeholderView returns the prompt and placeholder view, if any.

()

Source from the content-addressed store, hash-verified

727
728// placeholderView returns the prompt and placeholder view, if any.
729func (m TextInputModel) placeholderView() string {
730 var (
731 v string
732 p = m.Placeholder
733 style = m.PlaceholderStyle.Inline(true).Render
734 )
735
736 // Cursor
737 if m.blink {
738 v += m.cursorView(style(p[:1]))
739 } else {
740 v += m.cursorView(p[:1])
741 }
742
743 // The rest of the placeholder text
744 v += style(p[1:])
745
746 return m.PromptStyle.Render(m.Prompt) + v
747}
748
749// cursorView styles the cursor.
750func (m TextInputModel) cursorView(v string) string {

Callers 1

ViewMethod · 0.95

Calls 2

cursorViewMethod · 0.95
RenderMethod · 0.65

Tested by

no test coverage detected