it compiles (do not invoke changing)

This commit is contained in:
anon 2023-08-10 15:12:34 +02:00
parent 5cc1a831a6
commit ab7b3e5c85
3 changed files with 27 additions and 28 deletions

View File

@ -254,6 +254,7 @@ int handle_input(const int c);
int dispchar2int(const char c); int dispchar2int(const char c);
int process_mouse(); int process_mouse();
extern int input_mode; extern int input_mode;
int changestring(bool *change);
long seekpage(size_t i); long seekpage(size_t i);
long seekrelline(unsigned i); long seekrelline(unsigned i);

View File

@ -530,8 +530,6 @@ extern const void *const wmode;
extern const void *const wresult; extern const void *const wresult;
extern const void *const *const current_window; extern const void *const *const current_window;
static int changestring(bool *change);
static int static int
change_input(const int c){ change_input(const int c){
MOUSE *p; /* mouse data */ MOUSE *p; /* mouse data */
@ -539,16 +537,16 @@ change_input(const int c){
switch(c){ switch(c){
case '*': /* invert selection */ case '*': /* invert selection */
for(int i = 0; topline + i < nextline; ++i){ //for(int i = 0; topline + i < nextline; ++i){
change[i] = !change[i]; // change[i] = !change[i];
} //}
break; break;
case ctrl('A'): /* mark/unmark all lines */ case ctrl('A'): /* mark/unmark all lines */
for(unsigned i = 0; i < totallines; ++i) { for(unsigned i = 0; i < totallines; ++i) {
change[i] = !change[i]; change[i] = !change[i];
} }
/* show that all have been marked */ /* show that all have been marked */
seekline(totallines); // ?! //seekline(totallines); // ?!
break; break;
case ctrl('X'): /* mouse selection */ case ctrl('X'): /* mouse selection */
if ((p = getmouseaction(DUMMYCHAR)) == NULL) { if ((p = getmouseaction(DUMMYCHAR)) == NULL) {
@ -556,7 +554,7 @@ change_input(const int c){
} }
/* if the button number is a scrollbar tag */ /* if the button number is a scrollbar tag */
if (p->button == '0') { if (p->button == '0') {
scrollbar(p); //scrollbar(p);
break; break;
} }
/* find the selected line */ /* find the selected line */
@ -587,7 +585,7 @@ change_input(const int c){
return 0; return 0;
} }
static int int
changestring(bool *change){ changestring(bool *change){
char newfile[PATHLEN + 1]; /* new file name */ char newfile[PATHLEN + 1]; /* new file name */
char oldfile[PATHLEN + 1]; /* old file name */ char oldfile[PATHLEN + 1]; /* old file name */
@ -634,25 +632,25 @@ changestring(bool *change){
} }
/* output substitute command */ /* output substitute command */
fprintf(script, "%ss/", linenum); /* change */ fprintf(script, "%ss/", linenum); /* change */
for (char *s = Pattern; *s != '\0'; ++s) { //for (char *s = Pattern; *s != '\0'; ++s) {
/* old text */ // /* old text */
if (strchr("/\\[.^*", *s) != NULL) { // if (strchr("/\\[.^*", *s) != NULL) {
putc('\\', script); // putc('\\', script);
} // }
if (caseless == true && isalpha((unsigned char)*s)) { // if (caseless == true && isalpha((unsigned char)*s)) {
putc('[', script); // putc('[', script);
if(islower((unsigned char)*s)) { // if(islower((unsigned char)*s)) {
putc(toupper((unsigned char)*s), script); // putc(toupper((unsigned char)*s), script);
putc(*s, script); // putc(*s, script);
} else { // } else {
putc(*s, script); // putc(*s, script);
putc(tolower((unsigned char)*s), script); // putc(tolower((unsigned char)*s), script);
} // }
putc(']', script); // putc(']', script);
} else { // } else {
putc(*s, script); // putc(*s, script);
} // }
} //}
putc('/', script); /* to */ putc('/', script); /* to */
for (char *s = newpat; *s != '\0'; ++s) { /* new text */ for (char *s = newpat; *s != '\0'; ++s) { /* new text */
if (strchr("/\\&", *s) != NULL) { if (strchr("/\\&", *s) != NULL) {

View File

@ -40,7 +40,7 @@ static void callback_handler(char* line){
search(); search();
break; break;
case INPUT_CHANGE: case INPUT_CHANGE:
changestring(); changestring(NULL);
input_mode = INPUT_NORMAL; input_mode = INPUT_NORMAL;
break; break;
} }