Skip to content

Prathvi-Raj-Chauhan/text-editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📝 Text Editor from Scratch (C + SDL3)

A minimal text editor built completely from scratch using C, SDL3, and SDL3_ttf — no external text editing libraries.
It’s a lightweight prototype that demonstrates how text editors manage text, cursor movement, and rendering in real time.


🚀 Features

  • 🧱 Custom Text Buffer – implemented using a Linked List structure for dynamic insertion/deletion.
  • Cursor Movement – smooth left/right up/down navigation with blinking effects.
  • 🔤 Character Rendering – text drawn using SDL3_ttf with real-time updates.
  • ↩️ Line Management – new lines handled using a linked list of linked lists (document → line → characters).
  • Backspace Support – safely removes characters, including at line boundaries.
  • 🧠 Ready for Optimization – structure designed to evolve into gap buffers or rope trees later.

🏗️ Architecture Overview

Document ├── LineNode (linked list of lines) │ └── TextBuffer (doubly linked list of characters) │ ├── Node (char, prev, next) │ └── Cursor pointer

This structure mimics how real editors like Vim or VS Code manage text efficiently.


🧩 Tech Stack

  • Language: C (compiled as .cpp for compatibility)
  • Graphics & Rendering: SDL2
  • Font Handling: SDL_ttf

🌟 Future Plans

-✅ Smooth blinking cursor -✅ Multi-line rendering -🕹️ Text selection -💾 File saving/loading -🧩 Undo/Redo system -🚀 Gap buffer optimization

SCREENSHOTS OF GUI

image

About

Text Editor with minimal features and minimal look made from scratch.

Resources

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages