jpsheehan / ocaml-edit

An OCaml version of my editor experiment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OCaml-Edit

An experimental editor made using OCaml.

To Do List:

Navigation

  • Horizontal scrolling with cursor
  • Horizontal scrolling with mouse wheel
  • Cursor navigation with mouse
    • Vertical navigation
    • Horizontal navigation
  • Vertical scrolling with cursor
    • Apply the idea of a scroll margin
  • Page up/down (implemented but not working, could just be this laptop)
  • Ctrl+left/right should skip words

Editing

  • Text insertion
  • Text deletion (backspace and delete)
  • Newlines
  • Text selection
    • With mouse
    • With keyboard
    • Select-all

UI

  • Widgets (TODO: Expand on this)
  • Line numbers
  • Syntax highlighting?
  • Window resize event

Performance

  • Cache the document texture if unchanged
  • Cache each line individually
  • Cache the selection of each line individually

Tech Debt

  • Refactor document lines as own module (refactored as Doctext)
  • Refactor entire rendering context (window, renderer, etc) as own module
  • Refactor cursor module to do operations on cursor_pos instead. May want to declare own module so it is testable?
  • Lift all SDL references to the outside of the program

Bugs

  • Shift+left to select over newline crashes (do cursor_pos refactor first)
  • There is a memory leak when the cursor is not moving around vertically. It is likely that the textures are not being disposed of properly.
    • Fixed. I wasn't freeing the surface of the performance counter
  • When the document is shorter than the viewport, vertical scrolling is buggy

About

An OCaml version of my editor experiment


Languages

Language:OCaml 100.0%