Commit Graph
18 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 268325adfa feat(main): if given file path as argument use it
- if existing file then populate default file with that file's state
- if non-existing file create it and populate default file with that
file
2026-02-19 16:11:59 -06:00
Stevan Freeborn 3b40d30744 feat: migrate to a daemon to support windowing in future. allow to run without attached console 2026-01-26 12:44:50 -06:00
Stevan Freeborn 2c098b23b7 styles: working on making it look just right 2026-01-25 17:26:16 -06:00
Stevan Freeborn b281b154fa chore: remove unused sync file ops 2026-01-24 20:51:26 -06:00
Stevan Freeborn 88006d08a2 feat: update handler logic to use async io methods and produce completion messages and implemend handlers to deal with completions 2026-01-24 20:51:26 -06:00
Stevan Freeborn 4e3bdf8db3 feat: added new messages to represent completion of saving and opening a file async 2026-01-24 20:51:26 -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 cb5f1cf717 feat: refactor bindings to work in edit and preview modes 2026-01-23 07:09:50 -06:00
Stevan Freeborn 55bdbafce2 feat: add ability to preview markdown 2026-01-21 07:12:20 -06:00
Stevan Freeborn 9386fb38fd feat: refactor to make sure new tabs are added to end of the tab list always 2026-01-18 08:33:49 -06:00
Stevan Freeborn 573724901f feat: refactor state into hashmap + add new file action with keybind 2026-01-15 07:02:21 -06:00
Stevan Freeborn 599aacaf3b feat: keep track of multiple open files using tabbed buttons 2026-01-13 04:25:46 -06:00
Stevan Freeborn 3fd69df4db feat: implement font reset and wip on tab
- implemented the ability to reset
  font along with corresponding keybind
- added initial tab using buttons
  and on click loading file into
  editor state
2026-01-11 08:04:25 -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 c2a9685b5b feat: app icon 2026-01-09 07:51:53 -06:00
Stevan Freeborn 8e8409a7b5 feat: added saving existing file or new file 2026-01-09 07:18:43 -06:00
Stevan Freeborn cb02373547 feat: trying hard to be a Rustacean with chat's help 2026-01-06 07:19:44 -06:00