Initial commit: it compiles?

This commit is contained in:
Madison Rye Progress
2025-08-25 23:02:06 -07:00
parent 9ab2fb22fb
commit 82e7f3b393
9 changed files with 408 additions and 0 deletions

57
model/cursor.go Normal file
View File

@ -0,0 +1,57 @@
package model
func (m Model) CursorCellUp() Model {
if m.cursor-m.size > 0 {
m.cursor -= m.size
}
return m
}
func (m Model) CursorCellDown() Model {
if m.cursor+m.size < m.size*m.size {
m.cursor += m.size
}
return m
}
func (m Model) CursorCellRight() Model {
if m.cursor%m.size < m.size {
m.cursor++
}
return m
}
func (m Model) CursorCellLeft() Model {
if m.cursor%m.size != 1 {
m.cursor--
}
return m
}
func (m Model) CursorSectionUp() Model {
if m.cursor > m.size*m.perSection {
m.cursor -= m.size * m.perSection
}
return m
}
func (m Model) CursorSectionDown() Model {
if m.cursor < m.size*m.perSection*(m.section-1) {
m.cursor += m.size * m.perSection
}
return m
}
func (m Model) CursorSectionRight() Model {
if m.cursor%m.perSection < m.section-1 {
m.cursor += m.section
}
return m
}
func (m Model) CursorSectionLeft() Model {
if m.cursor%m.perSection > 0 {
m.cursor -= m.section
}
return m
}