Window Operations Module
This module handles window lifecycle and viewport events from the kernel EventBus.
It subscribes to WindowCreated, WindowClosed, WindowFocused, and ViewportScrolled
events and provides coordinated window state management.
Architecture
Following the kernel's "mechanism vs policy" principle:
- Kernel provides the window events (mechanism)
- This module decides how to react (policy)
Command IDs
This module also provides command ID constants for window operations
(focus, split, resize, etc.) used by keybinding modules like vim.
Commands
This module implements command handlers for window operations:
- Focus navigation:
<C-w>h/j/k/l- move focus directionally - Focus cycling:
<C-w>w/W- cycle through windows - Splitting:
<C-w>s/v- horizontal/vertical splits - Closing:
<C-w>c/o- close current/close others - Float zone: Toggle, raise, lower floating windows
Event Subscriptions
WindowCreated: Initialize window-specific stateWindowClosed: Cleanup window-specific resourcesWindowFocused: Update active window tracking, trigger highlightsViewportScrolled: Handle lazy loading, update visible ranges