mirror of
https://github.com/tstack/lnav
synced 2024-11-05 21:21:19 +00:00
Add configuration option for cursor movement
This commit is contained in:
parent
2b5c291a86
commit
bd81c4382d
@ -508,6 +508,20 @@ static const struct json_path_container keymap_defs_handlers = {
|
|||||||
.with_children(keymap_def_handlers),
|
.with_children(keymap_def_handlers),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const json_path_handler_base::enum_value_t _movement_values[] = {
|
||||||
|
{"top", config_movement_mode::TOP},
|
||||||
|
{"cursor", config_movement_mode::CURSOR}};
|
||||||
|
|
||||||
|
static const struct json_path_container movement_handlers = {
|
||||||
|
yajlpp::property_handler("mode")
|
||||||
|
.with_synopsis("mode_name")
|
||||||
|
.with_enum_values(_movement_values)
|
||||||
|
.with_example("top")
|
||||||
|
.with_example("cursor")
|
||||||
|
.with_description("The mode of cursor movement to use.")
|
||||||
|
.for_field<>(&_lnav_config::lc_ui_movement, &movement_config::mode),
|
||||||
|
};
|
||||||
|
|
||||||
static const struct json_path_container global_var_handlers = {
|
static const struct json_path_container global_var_handlers = {
|
||||||
yajlpp::pattern_property_handler("(?<var_name>\\w+)")
|
yajlpp::pattern_property_handler("(?<var_name>\\w+)")
|
||||||
.with_synopsis("<name>")
|
.with_synopsis("<name>")
|
||||||
@ -992,6 +1006,9 @@ static const struct json_path_container ui_handlers = {
|
|||||||
yajlpp::property_handler("theme-defs")
|
yajlpp::property_handler("theme-defs")
|
||||||
.with_description("Theme definitions.")
|
.with_description("Theme definitions.")
|
||||||
.with_children(theme_defs_handlers),
|
.with_children(theme_defs_handlers),
|
||||||
|
yajlpp::property_handler("movement")
|
||||||
|
.with_description("Log file cursor movement mode settings")
|
||||||
|
.with_children(movement_handlers),
|
||||||
yajlpp::property_handler("keymap-defs")
|
yajlpp::property_handler("keymap-defs")
|
||||||
.with_description("Keymap definitions.")
|
.with_description("Keymap definitions.")
|
||||||
.with_children(keymap_defs_handlers),
|
.with_children(keymap_defs_handlers),
|
||||||
|
@ -85,12 +85,22 @@ struct key_map {
|
|||||||
std::map<std::string, key_command> km_seq_to_cmd;
|
std::map<std::string, key_command> km_seq_to_cmd;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum class config_movement_mode : unsigned int {
|
||||||
|
TOP,
|
||||||
|
CURSOR,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct movement_config {
|
||||||
|
config_movement_mode mode;
|
||||||
|
};
|
||||||
|
|
||||||
struct _lnav_config {
|
struct _lnav_config {
|
||||||
top_status_source_cfg lc_top_status_cfg;
|
top_status_source_cfg lc_top_status_cfg;
|
||||||
bool lc_ui_dim_text;
|
bool lc_ui_dim_text;
|
||||||
bool lc_ui_default_colors{true};
|
bool lc_ui_default_colors{true};
|
||||||
std::string lc_ui_keymap;
|
std::string lc_ui_keymap;
|
||||||
std::string lc_ui_theme;
|
std::string lc_ui_theme;
|
||||||
|
movement_config lc_ui_movement;
|
||||||
std::unordered_map<std::string, key_map> lc_ui_keymaps;
|
std::unordered_map<std::string, key_map> lc_ui_keymaps;
|
||||||
std::map<std::string, std::string> lc_ui_key_overrides;
|
std::map<std::string, std::string> lc_ui_key_overrides;
|
||||||
std::map<std::string, std::string> lc_global_vars;
|
std::map<std::string, std::string> lc_global_vars;
|
||||||
|
Loading…
Reference in New Issue
Block a user