From 12d70f9996f669e43f3b66c7ad1e5525c9ed4e56 Mon Sep 17 00:00:00 2001 From: Tim Stack Date: Wed, 14 Dec 2022 20:48:53 -0800 Subject: [PATCH] [config] add missing enum terminator the terminator is needed in the enum_value_t array (I should really make it a real container...) --- docs/schemas/config-v1.schema.json | 3 +-- src/lnav_config.cc | 5 ++++- ...test_cmds.sh_b6a3bb78e9d60e5e1f5ce5b18e40d2f1662707ab.out | 3 +++ .../test_sql.sh_9b03e9f7a1bc35e408b3a17ee90cfdadea164df6.out | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/schemas/config-v1.schema.json b/docs/schemas/config-v1.schema.json index 7539e047..736de5e3 100644 --- a/docs/schemas/config-v1.schema.json +++ b/docs/schemas/config-v1.schema.json @@ -632,8 +632,7 @@ "type": "string", "enum": [ "top", - "cursor", - "" + "cursor" ], "examples": [ "top", diff --git a/src/lnav_config.cc b/src/lnav_config.cc index 5d273fae..6dc32e4c 100644 --- a/src/lnav_config.cc +++ b/src/lnav_config.cc @@ -510,7 +510,10 @@ static const struct json_path_container keymap_defs_handlers = { static const json_path_handler_base::enum_value_t _movement_values[] = { {"top", config_movement_mode::TOP}, - {"cursor", config_movement_mode::CURSOR}}; + {"cursor", config_movement_mode::CURSOR}, + + json_path_handler_base::ENUM_TERMINATOR, +}; static const struct json_path_container movement_handlers = { yajlpp::property_handler("mode") diff --git a/test/expected/test_cmds.sh_b6a3bb78e9d60e5e1f5ce5b18e40d2f1662707ab.out b/test/expected/test_cmds.sh_b6a3bb78e9d60e5e1f5ce5b18e40d2f1662707ab.out index f8284987..67141428 100644 --- a/test/expected/test_cmds.sh_b6a3bb78e9d60e5e1f5ce5b18e40d2f1662707ab.out +++ b/test/expected/test_cmds.sh_b6a3bb78e9d60e5e1f5ce5b18e40d2f1662707ab.out @@ -383,6 +383,9 @@ can always use  q  to pop the top view off of the stack. x Toggle the hiding of log message fields. The hidden fields will be replaced with three bullets and highlighted in yellow. + CTRL-X Toggle the cursor mode. Allows moving the selected + line instead of keeping it fixed at the top of the + current screen. F2 Toggle mouse support. Query diff --git a/test/expected/test_sql.sh_9b03e9f7a1bc35e408b3a17ee90cfdadea164df6.out b/test/expected/test_sql.sh_9b03e9f7a1bc35e408b3a17ee90cfdadea164df6.out index f648fc67..1975999d 100644 --- a/test/expected/test_sql.sh_9b03e9f7a1bc35e408b3a17ee90cfdadea164df6.out +++ b/test/expected/test_sql.sh_9b03e9f7a1bc35e408b3a17ee90cfdadea164df6.out @@ -1,4 +1,4 @@ Min: 0   1-23   24-48   49+ Max: 291690 - Thu Nov 03 00:15:00                + Thu Nov 03 00:15:00                ▲ 70 values in the range 0.00-3788.18  Thu Nov 03 00:20:00