Kill Ring Testing Guide
Testing the Kill Ring Implementation
Open this file in lumacs to test the kill ring functionality:
./build/lumacs KILL_RING_TEST.md
Test Cases
Test 1: C-k (kill-line)
- Navigate to the line below
- Place cursor at the beginning of the line
- Press
C-k to kill the line
- The text should be cut and added to kill ring
This is a test line for C-k functionality
Test 2: Kill to end of line
- Place cursor here: --> in the middle of this line
- Press
C-k
- Everything after the cursor should be killed
Test 3: Kill newline at EOL
- Place cursor at the end of this line (after "line")
- Press
C-k
- Should kill the newline and join with next line
Next line to be joined
Test 4: Mark and kill region (C-@ then C-w)
- Place cursor at START below
- Press
C-@ (or C-SPC) to set mark
- Move to END
- Press
C-w to kill region
START of region to kill. This entire block should be killed when you select it and press C-w. END of region.
Test 5: Copy region (M-w)
- Place cursor at START below
- Press
C-@ to set mark
- Move to END
- Press
M-w to copy (not cut)
- Text should stay but be in kill ring
START This text should be copied, not cut. END
Test 6: Yank (C-y)
- After killing or copying above, move cursor here:
- Press
C-y to paste
Test 7: Yank-pop (M-y)
- Kill multiple different pieces of text (use C-k on different lines)
- Press
C-y to yank the most recent
- Press
M-y repeatedly to cycle through kill ring
- Each press of M-y replaces the yanked text with the previous kill ring entry
Line 1 for kill ring test
Line 2 for kill ring test
Line 3 for kill ring test
Test 8: Multiple kills accumulate
- Place cursor at the start of the paragraph below
- Press
C-k multiple times in succession
- All killed lines should accumulate in one kill ring entry
- Paste with
C-y - all lines should be pasted together
First killed line
Second killed line
Third killed line
Expected Behavior
- C-@ (C-SPC): Sets mark, shows "Mark set" message
- C-w: Kills (cuts) region between mark and cursor, message varies
- M-w: Copies region to kill ring, shows "Region copied"
- C-k: Kills from cursor to end of line
- C-k at EOL: Kills the newline character (joins lines)
- C-y: Pastes (yanks) from kill ring
- M-y: After C-y, cycles through kill ring history
Debug Output
Check stderr for debug output like:
[DEBUG] Killed text: '...'
[DEBUG] Yanked: '...'
[DEBUG] Yank-pop: '...'
Success Criteria
✅ C-k kills to end of line
✅ C-k at EOL joins with next line
✅ C-@ sets mark
✅ C-w cuts marked region
✅ M-w copies marked region (doesn't delete)
✅ C-y pastes last killed text
✅ M-y after C-y cycles through kill history
✅ Mark is deactivated after kill/copy operation
✅ Multiple consecutive kills don't work yet (needs "last command" tracking)
Known Limitations
- Consecutive kills don't append yet (would need command history tracking)
- C-SPC might be sent as C-@ by terminal (this is correct Emacs behavior)
- No visual indication of active mark yet
Next Steps
After kill ring works, implement:
- Phase 1.2: Mark and Region commands (C-x C-x, C-x h)
- Phase 1.3: Word movement (M-f, M-b)
- Phase 1.4: Page scrolling (C-v, M-v)