made configs constant

This commit is contained in:
nova
2025-07-08 00:20:14 +02:00
parent 3f8fdc9e17
commit b77c9a2a29

View File

@ -2,7 +2,7 @@
#include "interactions.h"
#include "sorting.h"
static mimetype mimetype_default_cmd[] = {
static const mimetype mimetype_default_cmd[] = {
/* mimetype shell command
* ^ substring of "file --mime-type -b ./hovered"
* this does mean that this list is checked for completely linear.
@ -17,7 +17,7 @@ static mimetype mimetype_default_cmd[] = {
{ "audio", "mpv" }
};
static binding key_binding[] = {
static const binding key_binding[] = {
/*key action blackmagic comment*/
/*you cannot add bindings that include other bindings in its entirety
* possible: mk, mf
@ -37,10 +37,10 @@ static binding key_binding[] = {
{ "\n", open_with, NULL, "open \"open with\" dialog" }, /* opens the hovered file with an arbitrary command */
{ "r", rename_hovered, NULL, "rename hovered file" }, /* renames currently hovered file/directory */
{ "d", delete, NULL, "delete file" }, /* deletes currently hovered OR selected file/directory
* this means that it does not delete the hovered files if files are already selected */
* this means that it does not delete the hovered files if files are already selected */
{ "G", jump_bottom, NULL, "jump to last file in dir" },
{ "gg", jump_top, NULL, "jump to file 0" },
{ "gg", jump_top, NULL, "jump to first file in dir" },
{ "gh", jump_to_dir, "$HOME", "jump to $HOME" },
{ "gs", jump_to_dir, "$START_PATH", "jump to $START_PATH" },
{ "gd", jump_to_dir, "/dev", "jump to /dev" },
@ -70,5 +70,5 @@ static binding key_binding[] = {
{ "a", toggle_hidden_files, NULL, "toggle hidden files" },
};
static unsigned long binding_count = sizeof(key_binding) / sizeof(binding);
static unsigned long mimetype_default_count = sizeof(mimetype_default_cmd) / sizeof(mimetype);
static const unsigned long binding_count = sizeof(key_binding) / sizeof(binding);
static const unsigned long mimetype_default_count = sizeof(mimetype_default_cmd) / sizeof(mimetype);