commit 99bd4688734d6e4f9c286b39e3288ea5eefde16c parent 5da69b1c49b4090911de1af0e0140a2b75d1a9cb Author: Martin Kloeckner <mjkloeckner@gmail.com> Date: Fri, 15 Mar 2024 01:39:16 -0300 Add colors to selected option Diffstat:
| M | solutions/ej11.cpp | | | 6 | +++--- |
1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/solutions/ej11.cpp b/solutions/ej11.cpp @@ -61,9 +61,9 @@ void reset_input_mode (void) { void print_menu(void) { for(size_t i = 0; i < menu_items; ++i) { - cursor[cursor_pos].assign(((i == cursor_pos) ? " >" : " ")); - cout << cursor[cursor_pos] << menu[i] << (i == menu_items ? "" : "\n") - << flush; + cursor[cursor_pos].assign(((i == cursor_pos) ? " >\033[33m" : " ")); + cout << cursor[cursor_pos] << menu[i] + << (i == menu_items ? "\033[0m" : "\033[0m\n") << flush; } }
