Files
kte/TerminalInputHandler.h
Kyle Isom 33bbb5b98f Add SQL, Erlang, and Forth highlighter implementations and tests for LSP process and transport handling.
- Added highlighters for new languages (SQL, Erlang, Forth) with filetype recognition.
- Updated and reorganized syntax files to maintain consistency and modularity.
- Introduced LSP transport framing unit tests and JSON decoding/dispatch tests.
- Refactored `LspManager`, integrating UTF-16/UTF-8 position conversions and robust diagnostics handling.
- Enhanced server start/restart logic with workspace root detection and logging to improve LSP usability.
2025-12-02 00:15:15 -08:00

43 lines
1.1 KiB
C++

/*
* TerminalInputHandler - ncurses-based input handling for terminal mode
*/
#ifndef KTE_TERMINAL_INPUT_HANDLER_H
#define KTE_TERMINAL_INPUT_HANDLER_H
#include "InputHandler.h"
class TerminalInputHandler final : public InputHandler {
public:
TerminalInputHandler();
~TerminalInputHandler() override;
bool Poll(MappedInput &out) override;
void SetUtf8Enabled(bool on)
{
utf8_enabled_ = on;
}
private:
bool decode_(MappedInput &out);
// ke-style prefix state
bool k_prefix_ = false; // true after C-k until next key or ESC
// Simple meta (ESC) state for ESC sequences like ESC b/f
bool esc_meta_ = false;
// Universal argument (C-u) state
bool uarg_active_ = false; // an argument is pending for the next command
bool uarg_collecting_ = false; // collecting digits / '-' right now
bool uarg_negative_ = false; // whether a leading '-' was supplied
bool uarg_had_digits_ = false; // whether any digits were supplied
int uarg_value_ = 0; // current absolute value (>=0)
std::string uarg_text_; // raw digits/minus typed for status display
bool utf8_enabled_ = true;
};
#endif // KTE_TERMINAL_INPUT_HANDLER_H