Skip to main content

Crate reovim_module_window_ops

Crate reovim_module_window_ops 

Source
Expand description

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 state
  • WindowClosed: Cleanup window-specific resources
  • WindowFocused: Update active window tracking, trigger highlights
  • ViewportScrolled: Handle lazy loading, update visible ranges

Modules§

command
Window operation command handlers.
ids
Command ID constants for window operations.

Structs§

WindowOps
Window operations module.