(m *TuiModel)
| 192 | } |
| 193 | |
| 194 | func 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 |
| 210 | func FormatJson(str string) (string, error) { |
no test coverage detected