Compare commits

..

No commits in common. "ebfda949ea81ca7590c9cf65fdfeac59bce74636" and "40d98cdbb6bd5aa66897325ab04d3ede51b86ce0" have entirely different histories.

9 changed files with 8 additions and 79 deletions

View File

@ -1,11 +1,3 @@
// _____ _ _____
// |_ _|____ _| ||_ _|_ __
// | |/ _ \ \/ / __|| | \ \ / /
// | | __/> <| |_ | | \ V /
// |_|\___/_/\_\\__||_| \_/
// Author: Love Billenius <lovebillenius@disroot.org>
// License: GPL-3
#include "Command.h" #include "Command.h"
#include <iostream> #include <iostream>

View File

@ -1,11 +1,3 @@
// _____ _ _____
// |_ _|____ _| ||_ _|_ __
// | |/ _ \ \/ / __|| | \ \ / /
// | | __/> <| |_ | | \ V /
// |_|\___/_/\_\\__||_| \_/
// Author: Love Billenius <lovebillenius@disroot.org>
// License: GPL-3
#pragma once #pragma once
#include <string> #include <string>

View File

@ -50,9 +50,7 @@ void italize_numbers(std::string &content, size_t leave_chars = 0) {
void pretty_format_page(std::string &content) { void pretty_format_page(std::string &content) {
content.insert(0, ansi::BOLD); content.insert(0, ansi::BOLD);
size_t line_end = content.find('\n'); const size_t line_end = content.find("\n");
if (line_end == std::string::npos)
line_end = content.size();
content.insert(line_end, ansi::CLEAR); content.insert(line_end, ansi::CLEAR);
italize_numbers(content, line_end + ansi::CLEAR.size()); italize_numbers(content, line_end + ansi::CLEAR.size());

View File

@ -1,11 +1,3 @@
// _____ _ _____
// |_ _|____ _| ||_ _|_ __
// | |/ _ \ \/ / __|| | \ \ / /
// | | __/> <| |_ | | \ V /
// |_|\___/_/\_\\__||_| \_/
// Author: Love Billenius <lovebillenius@disroot.org>
// License: GPL-3
#include "Tui.h" #include "Tui.h"
#include <iostream> #include <iostream>
@ -54,14 +46,7 @@ void Tui::run() {
for (;;) { for (;;) {
std::cout << "Enter a command: "; std::cout << "Enter a command: ";
std::flush(std::cout); std::flush(std::cout);
Command::Command command; const Command::Command command = Command::readCommand();
try {
command = Command::readCommand();
} catch (const Command::NoNumberException &e) {
std::cout << e.what() << std::endl;
continue;
}
bool should_exit = false; bool should_exit = false;
auto visitor = [this, &should_exit]<typename T0>(T0 &&arg) { auto visitor = [this, &should_exit]<typename T0>(T0 &&arg) {

View File

@ -1,11 +1,3 @@
// _____ _ _____
// |_ _|____ _| ||_ _|_ __
// | |/ _ \ \/ / __|| | \ \ / /
// | | __/> <| |_ | | \ V /
// |_|\___/_/\_\\__||_| \_/
// Author: Love Billenius <lovebillenius@disroot.org>
// License: GPL-3
#pragma once #pragma once
#include "Page.hpp" #include "Page.hpp"

View File

@ -1,17 +1,11 @@
// _____ _ _____
// |_ _|____ _| ||_ _|_ __
// | |/ _ \ \/ / __|| | \ \ / /
// | | __/> <| |_ | | \ V /
// |_|\___/_/\_\\__||_| \_/
// Author: Love Billenius <lovebillenius@disroot.org>
// License: GPL-3
#pragma once namespace ansi
{
#include <string> #include <string>
namespace ansi { constexpr std::string_view BOLD = "\033[1m";
constexpr std::string_view BOLD = "\033[1m"; constexpr std::string_view ITALIC = "\033[3m";
constexpr std::string_view ITALIC = "\033[3m"; constexpr std::string_view CLEAR = "\033[0m";
constexpr std::string_view CLEAR = "\033[0m";
} // namespace ansi } // namespace ansi

View File

@ -1,11 +1,3 @@
// _____ _ _____
// |_ _|____ _| ||_ _|_ __
// | |/ _ \ \/ / __|| | \ \ / /
// | | __/> <| |_ | | \ V /
// |_|\___/_/\_\\__||_| \_/
// Author: Love Billenius <lovebillenius@disroot.org>
// License: GPL-3
#include "Page.hpp" #include "Page.hpp"
#include "Tui.h" #include "Tui.h"

View File

@ -1,11 +1,3 @@
// _____ _ _____
// |_ _|____ _| ||_ _|_ __
// | |/ _ \ \/ / __|| | \ \ / /
// | | __/> <| |_ | | \ V /
// |_|\___/_/\_\\__||_| \_/
// Author: Love Billenius <lovebillenius@disroot.org>
// License: GPL-3
#include "stringutil.hpp" #include "stringutil.hpp"
#include <algorithm> #include <algorithm>

View File

@ -1,11 +1,3 @@
// _____ _ _____
// |_ _|____ _| ||_ _|_ __
// | |/ _ \ \/ / __|| | \ \ / /
// | | __/> <| |_ | | \ V /
// |_|\___/_/\_\\__||_| \_/
// Author: Love Billenius <lovebillenius@disroot.org>
// License: GPL-3
#pragma once #pragma once
#include <string> #include <string>