commit 44c141cdedc8c16e3490f67fc3aab4cc541a5de1
Author: Raniconduh <clagv.randomgames@gmail.com>
Date: Mon Jan 31 21:27:14 2022 +0000
diff --git a/include/main.h b/include/main.h
index 0ec4d6e..832fa98 100644
--- a/include/main.h
+++ b/include/main.h
@@ -74 +77 @@
void help(void);
void sig_handler(int);
+
+extern size_t first_f, last_f, cursor;
+
#endif /*_MAIN_H */
diff --git a/include/opts.h b/include/opts.h
index 62bb4c2..13c9890 100644
--- a/include/opts.h
+++ b/include/opts.h
@@ -106 +107 @@
#define ICONS_VAR "icons"
extern bool show_icons;
+#define DOTS_VAR "dots"
extern bool show_dot_files;
#define COLOR_VAR "color"
extern bool color;
diff --git a/src/main.c b/src/main.c
index 8a94b24..bb06c17 100644
--- a/src/main.c
+++ b/src/main.c
@@ -147 +149 @@
#include "var.h"
#include "io.h"
-static size_t first_f, last_f, cursor;
+
+size_t first_f = 0, last_f = 0, cursor = 0;
+
int main(int argc, char ** argv) {
var_init();
diff --git a/src/var.c b/src/var.c
index e3ca065..e6b63fa 100644
--- a/src/var.c
+++ b/src/var.c
@@ -14 +15 @@
#include <stdbool.h>
+#include <ncurses.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
@@ -76 +88 @@
#include "hash.h"
#include "opts.h"
+#include "main.h"
+#include "dir.h"
#include "io.h"
@@ -616 +6417 @@ static void set_long(void * p) {
}
+static void set_dots(void * p) {
+ show_dot_files = *(bool*)p;
+
+ free_dir_entries();
+ list_dir(cwd);
+ cursor = 1;
+ first_f = 0;
+ last_f = LAST_F;
+}
+
+
static void set_dir(void * p) {
dir_color = hextorgb((char*)p);
set_color();
@@ -12211 +13612 @@ static void set_archive(void * p) {
void var_init(void) {
- var_map = map_new(11);
+ var_map = map_new(12);
map_insert(var_map, ICONS_VAR, set_icons);
map_insert(var_map, COLOR_VAR, set_color_f);
map_insert(var_map, LONG_VAR, set_long);
+ map_insert(var_map, DOTS_VAR, set_dots);
map_insert(var_map, DIR_COLOR_VAR, set_dir);
map_insert(var_map, REG_COLOR_VAR, set_reg);