ch = getch();
switch (ch) {
+ case 'C' - 64:
case 'Q':
case 'q':
return -1;
" ESC-< 0-G Go to start of file",
" ESC-> G Go to end of file",
" q Return to list of files or exit",
+ " control-C Disable auto-save-on-exit"
" control-L recenter current line",
" control-V SPACE page down",
" ESC-v BACKSPC page up",
int mmode = mode; /* Mode for moving - used when in 'other' pane */
char *modename = "merge";
char **modehelp = merge_help;
+ char *mesg = NULL;
int row, start = 0;
int trow; /* screen-row while searching. If we cannot find,
#define CTRLX(c) ((c)|0x4000)
move(rows, 0);
(void)attrset(A_NORMAL);
+ if (mesg) {
+ attrset(A_REVERSE);
+ addstr(mesg);
+ mesg = NULL;
+ attrset(A_NORMAL);
+ }
if (num >= 0) {
char buf[10];
snprintf(buf, 10, "%d ", num);
tnum = 0;
num = tnum*10 + (c-'0');
break;
+ case 'C'-64:
+ if (replace)
+ mesg = "Autosave disabled";
+ else
+ mesg = "Use 'q' to quit";
+ replace = 0;
+ break;
case 'q':
refresh = 2;
answer = 0;
" On file, visit the file",
" RTN Same as SPC",
" q Quit program",
+ " control-C Disable auto-save-on-exit",
" n,j,DOWN Go to next line",
" p,k,UP Go to previous line",
"",
}
move(0, cols-10); clrtoeol();
break;
+ case 'C'-64:
+ if (replace)
+ mesg = "Save-on-exit disabled. Use 'q' to quit.";
+ else
+ mesg = "Use 'q' to quit.";
+ replace = 0;
+ break;
case 'q':
cnt = 0;
signal(sig, catch);
return;
}
- nocbreak();
+ noraw();
nl();
endwin();
printf("Died on signal %d\n", sig);
signal(SIGBUS, catch);
signal(SIGSEGV, catch);
- initscr(); cbreak(); noecho();
+ initscr(); raw(); noecho();
start_color();
use_default_colors();
if (!has_colors()) {
break;
}
- nocbreak();
+ noraw();
nl();
endwin();
exit(0);