- Introduced `SwapManager` for buffering and writing incremental edits to sidecar `.kte.swp` files. - Implemented basic operations: insertion, deletion, split, join, and checkpointing. - Added recovery design doc (`docs/plans/swap-files.md`). - Updated editor initialization to integrate `SwapManager` instance for crash recovery across buffers.
34 lines
741 B
C++
34 lines
741 B
C++
/*
|
|
* TerminalInputHandler - ncurses-based input handling for terminal mode
|
|
*/
|
|
#pragma once
|
|
#include "InputHandler.h"
|
|
|
|
|
|
class TerminalInputHandler final : public InputHandler {
|
|
public:
|
|
TerminalInputHandler();
|
|
|
|
~TerminalInputHandler() override;
|
|
|
|
|
|
void Attach(Editor *ed) override
|
|
{
|
|
ed_ = ed;
|
|
}
|
|
|
|
|
|
bool Poll(MappedInput &out) override;
|
|
|
|
private:
|
|
bool decode_(MappedInput &out);
|
|
|
|
// ke-style prefix state
|
|
bool k_prefix_ = false; // true after C-k until next key or ESC
|
|
// Optional control qualifier inside k-prefix (e.g., user typed literal 'C' or '^')
|
|
bool k_ctrl_pending_ = false;
|
|
// Simple meta (ESC) state for ESC sequences like ESC b/f
|
|
bool esc_meta_ = false;
|
|
|
|
Editor *ed_ = nullptr; // attached editor for uarg handling
|
|
}; |