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

Function GetScrollDownMaximumForSelection

viewer/util.go:194–207  ·  view source on GitHub ↗
(m *TuiModel)

Source from the content-addressed store, hash-verified

192}
193
194func GetScrollDownMaximumForSelection(m *TuiModel) int {
195 max := 0
196 if m.UI.RenderSelection {
197 conv, _ := FormatJson(m.Data().EditTextBuffer)
198 lines := SplitLines(conv)
199 max = len(lines)
200 } else if m.UI.FormatModeEnabled {
201 max = len(SplitLines(DisplayFormatText(m)))
202 } else {
203 return len(m.GetColumnData())
204 }
205
206 return max
207}
208
209// FormatJson is some more code I stole off stackoverflow
210func FormatJson(str string) (string, error) {

Callers 1

ScrollDownFunction · 0.85

Calls 5

FormatJsonFunction · 0.85
SplitLinesFunction · 0.85
DisplayFormatTextFunction · 0.85
DataMethod · 0.80
GetColumnDataMethod · 0.80

Tested by

no test coverage detected