make ctrl('R') (rebuild) globally available

This commit is contained in:
anon 2023-09-03 01:04:56 +02:00
parent 52681b138f
commit da66da5fa0
2 changed files with 23 additions and 23 deletions

View File

@ -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;

View File

@ -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){