From 6c27a97cdfe1c5b7ffcc07ef097dc9ad7a92f180 Mon Sep 17 00:00:00 2001 From: leo-arch Date: Fri, 24 Jan 2025 10:16:23 -0300 Subject: [PATCH] Remove some commented out code --- src/fuzzy_match.c | 2 +- src/init.c | 8 -------- src/jump.c | 3 --- src/keybinds.c | 3 --- src/keybinds.h | 1 - src/main.c | 25 ------------------------- 6 files changed, 1 insertion(+), 41 deletions(-) diff --git a/src/fuzzy_match.c b/src/fuzzy_match.c index d28d2adc..80c4474c 100644 --- a/src/fuzzy_match.c +++ b/src/fuzzy_match.c @@ -51,7 +51,7 @@ utf8nextcodepoint(const char *s) } else if (0xc0 == (0xe0 & *s)) { /* 2-byte utf8 code point (began with 0b110xxxxx) */ return 2; - } else { /* if (0x00 == (0x80 & *s)) { */ + } else { /* (0x00 == (0x80 & *s)) { */ /* 1-byte ascii (began with 0b0xxxxxxx) */ return 1; } diff --git a/src/init.c b/src/init.c index 68e6807f..cdd63413 100644 --- a/src/init.c +++ b/src/init.c @@ -2812,14 +2812,6 @@ check_options(void) hist_status = xargs.history; } -/* if (!conf.wprompt_str) { - if (conf.colorize == 1) - conf.wprompt_str = savestring(DEF_WPROMPT_STR, sizeof(DEF_WPROMPT_STR) - 1); - else - conf.wprompt_str = savestring(DEF_WPROMPT_STR_NO_COLOR, - sizeof(DEF_WPROMPT_STR_NO_COLOR) - 1); - } */ - /* Do no override command line options */ if (xargs.cwd_in_title == UNSET) xargs.cwd_in_title = DEF_CWD_IN_TITLE; diff --git a/src/jump.c b/src/jump.c index f74493c3..752a6b76 100644 --- a/src/jump.c +++ b/src/jump.c @@ -482,8 +482,6 @@ print_jump_table(const int reduce, const time_t now) int days_since_first = 0, hours_since_last = 0; int rank = rank_entry((int)i, now, &days_since_first, &hours_since_last); -// int keep = jump_db[i].keep; -// jump_db[i].keep = 0; if (reduce) { int tmp_rank = rank; @@ -495,7 +493,6 @@ print_jump_table(const int reduce, const time_t now) tmp_jump[i].path = jump_db[i].path; tmp_jump[i].keep = jump_db[i].keep; -// tmp_jump[i].keep = keep; tmp_jump[i].rank = rank; tmp_jump[i].len = jump_db[i].len; tmp_jump[i].visits = jump_db[i].visits; diff --git a/src/keybinds.c b/src/keybinds.c index 444e9708..a4da527e 100644 --- a/src/keybinds.c +++ b/src/keybinds.c @@ -1008,7 +1008,6 @@ my_insert_text(char *text, char *s, const char _s) q[l] = '\0'; l = 0; rl_insert_text(q); -// rl_redisplay(); } continue; } @@ -1029,7 +1028,6 @@ my_insert_text(char *text, char *s, const char _s) * As a workaround, let's reprint the suggestion */ size_t slen = strlen(suggestion_buf); *s = _s ? _s : ' '; -// print_suggestion(suggestion_buf, slen + 1, suggestion.color); print_suggestion(suggestion_buf, slen, suggestion.color); *s = '\0'; } @@ -2923,7 +2921,6 @@ set_hardcoded_keybinds(void) rl_bind_keyseq("\x1bOC", rl_accept_suggestion); /* Bind Alt-Right and Alt-f to accept the first suggested word */ -/* rl_bind_key(('f' | 0200), rl_accept_first_word); */ // Alt-f rl_bind_keyseq("\x1b\x66", rl_accept_first_word); rl_bind_keyseq("\x1b[3C", rl_accept_first_word); rl_bind_keyseq("\x1b\x1b[C", rl_accept_first_word); diff --git a/src/keybinds.h b/src/keybinds.h index 0bc8fa68..63eb3f0c 100644 --- a/src/keybinds.h +++ b/src/keybinds.h @@ -31,7 +31,6 @@ __BEGIN_DECLS -/*void add_func_to_rl(void); */ int keybind_exec_cmd(char *str); int kbinds_function(char **args); int load_keybinds(void); diff --git a/src/main.c b/src/main.c index 0b4a7f85..4940ae0b 100644 --- a/src/main.c +++ b/src/main.c @@ -908,9 +908,6 @@ int inotify_fd = UNSET, inotify_wd = UNSET; int watch = UNSET; unsigned int INOTIFY_MASK = IN_CREATE | IN_DELETE | IN_DELETE_SELF | IN_MOVE | IN_MOVE_SELF -/*#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0) - | IN_DONT_FOLLOW | IN_EXCL_UNLINK | IN_ONLYDIR | IN_MASK_CREATE; -#else */ # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 15) | IN_DONT_FOLLOW | IN_ONLYDIR # endif /* LINUX >= 2.6.15 */ @@ -1104,18 +1101,6 @@ check_working_directory(void) } } -/* Check whether we have a working shell */ -/* -static inline void -check_working_shell(void) -{ - if (access(user.shell, X_OK) == -1) { - err('w', PRINT_PROMPT, _("%s: %s: System shell not found. " - "Please edit the configuration file to specify a working " - "shell.\n"), PROGRAM_NAME, user.shell); - } -} */ - #ifndef _NO_TRASH static inline void init_trash(void) @@ -1244,16 +1229,6 @@ list_files_and_quit(void) exit(EXIT_SUCCESS); /* Never reached. */ } -/* -static void -init_file_flags(void) -{ - flags |= CONFIG_OK; - flags |= HOME_OK; - flags |= SELFILE_OK; - flags |= TRASH_OK; -} */ - /** * ############################# * # MAIN #