Commit Graph
8 Commits
Author SHA1 Message Date
Stevan Freeborn b382f14a55 feat: add word wrap toggle functionality
Add the ability to toggle word wrap in the text editor with Alt+Z.
Word wrap can be enabled or disabled, affecting how long lines are
displayed in edit mode.

Changes:
- Add `is_word_wrap_on` state field with default value of false
- Implement `toggle_word_wrap()` and `is_word_wrap_on()` methods
- Add ToggleWordWrap variant to ViewAction enum
- Bind Alt+Z keyboard shortcut to toggle word wrap
- Refactor editor view to support dynamic wrapping behavior
  - Use responsive widget when wrap is enabled to constrain width
  - Apply Wrapping::WordOrGlyph when enabled, Wrapping::None otherwise
- Update editor view signature to accept word wrap state parameter
- Fix indentation inconsistencies in file.rs and state.rs
2026-02-25 17:17:34 -06:00
Stevan Freeborn 7462943c04 feat: display save indicator on new files 2026-02-21 05:31:00 -06:00
Stevan Freeborn 5faa42a3e1 feat: display indicator when need saving 2026-02-21 05:08:48 -06:00
Stevan Freeborn db0cd51818 chore: run cargo fmt 2026-01-25 17:26:40 -06:00
Stevan Freeborn 75ab718655 feat: add highlighting to editor 2026-01-24 21:24:32 -06:00
Stevan Freeborn f5d98197ac refactor: modularize architecture
refactors the application structure to move away from a monolithic
`main.rs`.

- **Domain Models**: Extracted `State`, `Message`, `FileAction`, and
`ViewAction` into `state.rs` and `message.rs`. Enforced encapsulation on
`State` using private fields and public accessors.
- **Controller Layer**: Created `handler.rs` to handle business logic
and I/O operations, transforming the main `update` loop into a pure
event router.
- **Component System**: Split the UI into composable, stateless
functions in `components/` (tabs, editor, status_bar, action_bar),
removing the 100+ line view function.
- **File Logic**: Encapsulated file operations and safe path handling
within `file.rs`, removing fragile `expect` calls from the UI layer.
- **Utilities**: Centralized static configuration, keybindings, and I/O
helpers into `constants.rs`, `key_bindings.rs`, and `io.rs`.

This change decouples the view from the model and makes the core
application logic testable
2026-01-24 20:51:26 -06:00
Stevan Freeborn 1704441315 feat: wire up keybinds
- added keybinds for existing file actions
- added keybinds to support zooming
2026-01-10 08:02:21 -06:00
Stevan Freeborn 8e8409a7b5 feat: added saving existing file or new file 2026-01-09 07:18:43 -06:00