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

Method SetValue

tuiutil/textinput.go:185–196  ·  view source on GitHub ↗

SetValue sets the value of the text input.

(s string)

Source from the content-addressed store, hash-verified

183
184// SetValue sets the value of the text input.
185func (m *TextInputModel) SetValue(s string) {
186 runes := []rune(s)
187 if m.CharLimit > 0 && len(runes) > m.CharLimit {
188 m.value = runes[:m.CharLimit]
189 } else {
190 m.value = runes
191 }
192 if m.pos == 0 || m.pos > len(m.value) {
193 m.setCursor(len(m.value))
194 }
195 m.handleOverflow()
196}
197
198// Value returns the value of the text input.
199func (m TextInputModel) Value() string {

Callers 6

initFunction · 0.80
PrepareFormatModeFunction · 0.80
HandleEditInputFunction · 0.80
HandleEditModeFunction · 0.80
EditEnterFunction · 0.80
handleSQLModeFunction · 0.80

Calls 2

setCursorMethod · 0.95
handleOverflowMethod · 0.95

Tested by

no test coverage detected