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); 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 */ /* unget a character */
void myungetch(int c) { void myungetch(int c) {
prevchar = c; prevchar = c;
@ -229,6 +249,9 @@ static int global_input(const int c) {
case '%': case '%':
verswp_window(); verswp_window();
break; break;
case ctrl('R'):
rebuild_reference();
break;
case ctrl('K'): case ctrl('K'):
field = (field + (FIELDS - 1)) % FIELDS; field = (field + (FIELDS - 1)) % FIELDS;
window_change |= CH_MODE; window_change |= CH_MODE;
@ -380,6 +403,7 @@ int change_input(const int c) {
free(change); free(change);
input_mode = INPUT_NORMAL; input_mode = INPUT_NORMAL;
horswp_window(); horswp_window();
rebuild_reference();
search(newpat); search(newpat);
break; break;
default: default:

View File

@ -44,9 +44,6 @@ bool interpret(int c) {
case KEY_DOWN: case KEY_DOWN:
next_history_proxy(); next_history_proxy();
break; break;
case ctrl('R'):
rebuild_reference();
break;
case ESC: case ESC:
case ctrl('X'): case ctrl('X'):
process_mouse(); 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(){ static inline void previous_history_proxy(){
HIST_ENTRY* i = previous_history(); HIST_ENTRY* i = previous_history();
if(i){ if(i){