commit 8b5231167e9d59f40378280e5cf0dd50bee2a604
parent 555fd8d749b0db5f01f9fca70fed31ec3ead6b0c
Author: Andrew Laack <andrew@laack.co>
Date: Sun, 4 Oct 2026 12:14:49 -0500
Move init colors to main
Diffstat:
3 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/include/render.hpp b/include/render.hpp
@@ -34,4 +34,3 @@ struct DrawState {
bool mainLoop(DrawState& ds, Browser& b, int input, int cols, int lines);
void tryVisitSite(DrawState& ds , Browser& b, std::string site);
-void initColors();
diff --git a/src/main.cpp b/src/main.cpp
@@ -10,6 +10,16 @@
#include <unctrl.h>
#include "../vendor/argparse.hpp"
+void initColors() {
+ if(has_colors()) {
+ start_color();
+ use_default_colors();
+ for (int c = 0; c < COLORS && c+1 < COLOR_PAIRS; ++c) {
+ init_pair(c + 1, c, -1);
+ }
+ }
+}
+
int main(int argc, char** argv) {
argparse::ArgumentParser program("foreseen", "0.0.1");
diff --git a/src/render.cpp b/src/render.cpp
@@ -36,16 +36,6 @@ bool isValidUserInput(int uinput) {
}
return false;
}
-void initColors() {
- if(has_colors()) {
- start_color();
- use_default_colors();
- for (int c = 0; c < COLORS && c+1 < COLOR_PAIRS; ++c) {
- init_pair(c + 1, c, -1);
- }
- }
-}
-
void drawInputBox(std::string text, std::string userInput, DrawState& ds) {
move(ds.lines/2-1, ds.columns/4);