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 <iostream>

View File

@ -1,11 +1,3 @@
// _____ _ _____
// |_ _|____ _| ||_ _|_ __
// | |/ _ \ \/ / __|| | \ \ / /
// | | __/> <| |_ | | \ V /
// |_|\___/_/\_\\__||_| \_/
// Author: Love Billenius <lovebillenius@disroot.org>
// License: GPL-3
#pragma once
#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) {
content.insert(0, ansi::BOLD);
size_t line_end = content.find('\n');
if (line_end == std::string::npos)
line_end = content.size();
const size_t line_end = content.find("\n");
content.insert(line_end, ansi::CLEAR);
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 <iostream>
@ -54,14 +46,7 @@ void Tui::run() {
for (;;) {
std::cout << "Enter a command: ";
std::flush(std::cout);
Command::Command command;
try {
command = Command::readCommand();
} catch (const Command::NoNumberException &e) {
std::cout << e.what() << std::endl;
continue;
}
const Command::Command command = Command::readCommand();
bool should_exit = false;
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
#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>
namespace ansi {
constexpr std::string_view BOLD = "\033[1m";
constexpr std::string_view ITALIC = "\033[3m";
constexpr std::string_view CLEAR = "\033[0m";
} // namespace ansi

View File

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

View File

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

View File

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