From c13621d1f907837f90d4c8c23f8168b4214c771e Mon Sep 17 00:00:00 2001 From: Mike Wallio Date: Sat, 24 Oct 2020 10:48:59 -0400 Subject: [PATCH] Make cursor position public state (#57) --- 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