Fix format. Try compile on Windows.

This commit is contained in:
ArthurSonzogni
2020-03-22 22:32:44 +01:00
parent 4ff45ee540
commit a402cb4fbb
67 changed files with 615 additions and 569 deletions

View File

@@ -1,5 +1,6 @@
#include "ftxui/component/input.hpp"
#include "ftxui/screen/string.hpp"
#include <algorithm>
namespace ftxui {
@@ -31,13 +32,14 @@ Element Input::Render() {
auto focused =
is_focused ? focus : select;
// clang-format off
return
hbox(
text(part_before_cursor),
text(part_at_cursor) | underlined | focused,
text(part_after_cursor)
) | flex | inverted | frame | main_decorator;
// clang-format off
}
bool Input::OnEvent(Event event) {
cursor_position = std::max(0, std::min<int>(content.size(), cursor_position));