From c7cfd593136671946deb6d6111552270eba2b282 Mon Sep 17 00:00:00 2001 From: Mike Wallio Date: Fri, 23 Oct 2020 11:12:47 -0400 Subject: [PATCH] Make cursor position public state --- include/ftxui/component/input.hpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/ftxui/component/input.hpp b/include/ftxui/component/input.hpp index 92f3d210..9b92b835 100644 --- a/include/ftxui/component/input.hpp +++ b/include/ftxui/component/input.hpp @@ -18,6 +18,7 @@ class Input : public Component { // State. std::wstring content; std::wstring placeholder; + int cursor_position = 0; // State update callback. std::function on_change = [] {}; @@ -26,9 +27,6 @@ class Input : public Component { // Component implementation. Element Render() override; bool OnEvent(Event) override; - - private: - int cursor_position = 0; }; } // namespace ftxui