japanoise / emsys

ersatz-emacs text editor
MIT License
3 stars 2 forks source link

Independent window Scrolling #32

Closed nicholascarroll closed 3 months ago

nicholascarroll commented 3 months ago

I'm working in my main branch of my fork to have separated window and rendering logic from buffer editing operations, enabling independent window scrolling. Once I have that done I will raise a PR. It also includes toggle-truncate-lines and POSIX 2001 compliance.

Independent window Scrolling

Have separated window and rendering logic from buffer editing operations, enabling independent window scrolling.

  1. Buffer-Centric Cursor Management The buffer cursor remains the source of truth for navigation and editing. The struct editorWindow now includes cx and cy fields, but these are only used to bookmark the buffer cursor position when switching away from a window operations.

  2. Screen Cursor Migration

    • scx and scy (screen cursor) moved from buffer to window struct.
    • Used exclusively for rendering the displayed cursor.
  3. Scroll Offset Migration

    • rowoff (row offset) moved from buffer to window struct.
    • Added coloff (column offset) to window struct for horizontal scrolling.
  4. Rendering Function Refactor

    • Rendering functions now based on editorWindow struct instead of editorBuffer.
    • editorScroll doesn't have arguments anymore (its happier now)
  5. Window Height

    • screenrows and screencols stil represent total terminal height and width.
    • Window struct has its own height.
    • No window width only screencols (side-by-side windows not planned).

Can disable line wrap in current buffer

M-x toggle-truncate-lines or C-x x t - Toggles line wrap off/on

POSIX 2001 Compliance

japanoise commented 3 months ago

Fixed by #36