REMOVED — Feature disabled to ensure reliable editing functionality. Toggle (F3) and all word wrap code removed. Editor always uses truncate for long lines.
config->display.word_wrapexists and toggles via F3- But
view.cnever checksconfig->display.word_wrap - Long lines are truncated at screen boundary regardless of toggle state
- No test validates the feature
- No change needed
- Buffer stores logical lines unchanged
buffer_get_line()always returns full line
-
Currently: Truncates lines to fit screen width
int max_print = (int)(COLS - 2 - num_width); // Just cuts off if (print_len > max_print) print_len = max_print;
-
Needed: When
config->display.word_wrap == 1:- Split long logical lines into multiple visual rows
- Track which visual row corresponds to which logical position
- Handle selection/highlighting across wrapped segments
- Maintain cursor position tracking through wrapped text
-
When
config->display.word_wrap == 0:- Keep current behavior (truncate + maybe show indicator like
→)
- Keep current behavior (truncate + maybe show indicator like
- ✓ Toggle already works (F3)
- Needs update: Cursor movement (arrows, page up/down) must account for wrapped lines
- Up arrow in wrapped text might move to visual row above (same logical line)
- Or move to logical line above (current behavior)
- Decision needed: UX for cursor in wrapped text?
✓ Added to test_controller.c — runs via led -t
Test: test_word_wrap_toggle()
- Creates a long line (140+ chars)
- Toggles
config->display.word_wrapOFF and ON - Verifies buffer is unchanged in all cases
- Confirms toggle flag actually flips
Run tests:
cd ~/Documents/refgift/led
./led -tAll word wrap assertions pass ✓ (model layer is correct)
- Model: Verify buffer unchanged when toggle changes (test passes ✓)
- Controller: Toggle works via F3 (already implemented)
- VIEW: Implement actual word wrapping display logic
- Check
config->display.word_wrapindraw_update()(~line 530) - When enabled: wrap long lines to multiple screen rows
- When disabled: truncate long lines (current behavior, maybe add
→indicator) - Track visual row to logical line mapping for cursor navigation
- Update selection highlighting to work across wrapped segments
- Check
- Cursor movement: Define behavior in wrapped text (up/down arrow keys)
- Update README.md to document F3 (word wrap toggle)
- Toggle:
editor.cline ~150 (else if (ch == KEY_F(3))) - Rendering:
view.cfunctiondraw_update()starting at line 496 - Config:
config.hstructDisplayConfighasword_wrapfield - Highlight:
view.cfunctionprint_highlighted()
-
Cursor movement: When a line is wrapped, should arrow keys move:
- By visual row (Up/Down move within the wrapped line)?
- By logical line (Up/Down skip the whole wrapped line)?
-
Visual indicator: Show
→at line boundary when truncated (wrap OFF)? -
Priority: Is this high priority for next iteration, or lower?