Compare commits

...

2 Commits

Author SHA1 Message Date
26294ba596 rebuild the reference after replacing 2023-09-03 01:07:22 +02:00
da66da5fa0 make ctrl('R') (rebuild) globally available 2023-09-03 01:07:22 +02:00
2 changed files with 24 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;
@ -380,6 +403,7 @@ int change_input(const int c) {
free(change);
input_mode = INPUT_NORMAL;
horswp_window();
rebuild_reference();
search(newpat);
break;
default:

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