From da66da5fa0a1501e2636f72b157f62f9f51596b5 Mon Sep 17 00:00:00 2001 From: anon Date: Sun, 3 Sep 2023 01:04:56 +0200 Subject: [PATCH] make ctrl('R') (rebuild) globally available --- src/input.c | 23 +++++++++++++++++++++++ src/readline.c | 23 ----------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/input.c b/src/input.c index 3b8d941..34cabde 100644 --- a/src/input.c +++ b/src/input.c @@ -68,6 +68,26 @@ static void catchint(int sig) { longjmp(env, 1); } +static inline bool rebuild_reference() { + if(isuptodate == true) { + postmsg("The -d option prevents rebuilding the symbol database"); + return false; + } + exitcurses(); + freefilelist(); /* remake the source file list */ + makefilelist(); + rebuild(); + if(errorsfound == true) { + errorsfound = false; + askforreturn(); + } + entercurses(); + postmsg(""); /* clear any previous message */ + totallines = 0; + disprefs = 0; + return true; +} + /* unget a character */ void myungetch(int c) { prevchar = c; @@ -229,6 +249,9 @@ static int global_input(const int c) { case '%': verswp_window(); break; + case ctrl('R'): + rebuild_reference(); + break; case ctrl('K'): field = (field + (FIELDS - 1)) % FIELDS; window_change |= CH_MODE; diff --git a/src/readline.c b/src/readline.c index 3bfca9f..ee1794b 100644 --- a/src/readline.c +++ b/src/readline.c @@ -44,9 +44,6 @@ bool interpret(int c) { case KEY_DOWN: next_history_proxy(); break; - case ctrl('R'): - rebuild_reference(); - break; case ESC: case ctrl('X'): process_mouse(); @@ -139,26 +136,6 @@ static void callback_handler(char *line) { } } -static inline int rebuild_reference() { - if(isuptodate == true) { - postmsg("The -d option prevents rebuilding the symbol database"); - return (false); - } - exitcurses(); - freefilelist(); /* remake the source file list */ - makefilelist(); - rebuild(); - if(errorsfound == true) { - errorsfound = false; - askforreturn(); - } - entercurses(); - postmsg(""); /* clear any previous message */ - totallines = 0; - disprefs = 0; - return (true); -} - static inline void previous_history_proxy(){ HIST_ENTRY* i = previous_history(); if(i){