Skip to content

Core & Buffer Management #6

Closed

Description

@VagnoDev

Buffer structure

  • Create the Buffer struct
  • Store file contents using Vec<String>
  • Add cursor position tracking (row and column)
  • Define cursor position invariants
  • Prevent invalid cursor positions
  • Handle empty lines correctly

File loading

  • Implement fetch() to load file contents
  • Handle missing files
  • Handle empty files
  • Handle file reading errors
  • Preserve trailing empty lines
  • Support large files

Buffer operations

  • Implement line access helpers
  • Implement character access helpers
  • Implement line insertion
  • Implement line deletion
  • Implement character insertion
  • Implement character deletion
  • Implement buffer modification tracking

Cursor management

  • Implement cursor boundary validation
  • Handle cursor movement across empty lines
  • Handle cursor movement across different line lengths
  • Handle UTF-8 text correctly
  • Add cursor position tests

Definition of Done

  • Buffer operations never access invalid indexes.
  • Empty buffers and empty lines are handled safely.
  • Cursor coordinates remain consistent after modifications.
  • Core operations are covered by unit tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestqualityquality of the code

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions