diff options
| author | Craig Jennings <c@cjennings.net> | 2025-11-08 11:37:29 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-11-08 11:37:29 -0600 |
| commit | f18f1c90e362d84f4978b4365ae0a88807afb6e4 (patch) | |
| tree | e1c4b0aa7cabc6a118f588da5ede23b94eaec7b6 /tests/README-DEBUG-TESTS.md | |
| parent | 19e88c1ed7ecde966372adefeb3d468374ef1dd7 (diff) | |
refactor: mode-line: extract inline keymap to shared defvar
Replace inline keymap construction with shared wttrin--mode-line-map defvar.
Before (line 474-479): Keymap recreated on every mode-line update
- (let ((map (make-sparse-keymap))) ...)
- Allocates new keymap object each time
- 6 lines of repetitive code
After (line 183-190 + line 483): Shared keymap created once
- (defvar wttrin--mode-line-map ...)
- Reference: 'local-map wttrin--mode-line-map
- Single allocation, no repeated construction
Added comprehensive tests (8 tests, all passing):
- Keymap existence and structure verification
- Keybinding tests (mouse-1, mouse-3, no mouse-2)
- Integration test verifying mode-line uses shared map
Benefits:
- More efficient (no allocation on every update)
- Clearer code structure
- Easier to add new keybindings
- Self-documenting with inline documentation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'tests/README-DEBUG-TESTS.md')
0 files changed, 0 insertions, 0 deletions
