- Introduction
- 1. Setup
- 1.1. Setup an editor
- 1.2. The Zig build system
- 2. The main.zig file
- 2.1. Panic handler
- 3. Terminal configuration
- 3.1. The linux module
- 3.2. Enabling raw mode
- 3.3. Back to main.zig
- 4. Getting the window size
- 4.1. The ioctl method
- 4.2. The cursor position method
- 4.3. First test
- 5. Digression: the comptime keyword
- 6. The editor types
- 6.1. Editor
- 6.2. Buffer
- 6.3. Row
- 6.4. View
- 6.5. Digression: default initializers
- 7. Initialize the editor
- 8. Keypress processing
- 8.1. Key enum
- 8.2. Reading keys
- 9. I/O: reading
- 9.1. Reading a file
- 9.2. Io.Reader
- 9.3. Digression: assignments in Zig
- 10. Filling rows
- 10.1. Inserting a row
- 10.2. Updating a row
- 10.3. Write a test
- 11. The screen surface
- 11.1. More escape sequences
- 11.2. Refresh the screen
- 11.3. Drawing the rows
- 11.4. The statusline
- 11.5. The message area
- 11.6. The welcome message
- 12. A text viewer
- 12.1. More Row methods
- 12.2. More keypress handling
- 12.3. Move with keys
- 12.4. Handling the wanted column
- 12.5. Scroll the view
- 13. A text editor
- 13.1. Insert characters
- 13.2. Deleting a character
- 13.3. The string module
- 13.4. Insert a new line
- 13.5. Handling text wrapping
- 14. Interacting with the user
- 15. I/O: writing
- 15.1. Saving a file
- 16. Prompts
- 16.1. Prompting for a filename
- 17. Highlight
- 17.1. Highlight enum
- 17.2. Highlight groups
- 17.3. More comptime
- 17.4. Applying the highlight
- 17.5. Higlight non-printable characters
- 18. Searching
- 18.1. The prompt callback
- 18.2. EditorError set
- 18.3. Updated promptForInput()
- 19. Doing the search
- 19.1. Preparations
- 19.2. The findCallback() function
- 19.3. Search forwards
- 19.4. Search backwards
- 19.5. Write a test
- 20. Syntax highlighting
- 20.1. Syntax types
- 20.2. Syntax definitions
- 20.3. New string functions
- 20.4. Digression: inline keyword
- 20.5. Filetype detection
- 21. Doing the highlight
- 21.1. Top-level symbols
- 21.2. Multi-line comments
- 21.3. Line comments, strings
- 21.4. Numbers
- 21.5. Keywords and uppercase words
- 22. Conclusion