fixed replacing selection

This commit is contained in:
anon 2023-08-13 20:44:46 +02:00
parent 987c69f75c
commit f0d24d3ff6
3 changed files with 9 additions and 69 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@ obj/*.gch
csope csope
**/*.out **/*.out
src/lex.yy.c src/lex.yy.c
main.plist

View File

@ -117,76 +117,15 @@ static inline void display_command_field(void);
static inline void display_results(void); static inline void display_results(void);
static inline void display_tooltip(void); static inline void display_tooltip(void);
/* NOTE: It's declared like this because we dont need a terminating '\00'. */ static const char dispchars[] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
static const char dispchars[] = {'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
'n',
'o',
'p',
'q',
'r',
's',
't',
'u',
'v',
'w',
'x',
'y',
'z',
'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
'K',
'L',
'M',
'N',
'O',
'P',
'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
'Y',
'Z'};
int dispchar2int(const char c) { int dispchar2int(const char c) {
const char fst = dispchars[0]; int i = 0;
const char lst = dispchars[sizeof(dispchars) - 1]; while(dispchars[i] != c){
int r = c - fst; if(dispchars[i] == '\00'){ return -1; }
if(r < 0 || lst < r) { return -1; } ++i;
return r; }
return i;
} }
char lastmsg[MSGLEN + 1]; /* last message displayed */ char lastmsg[MSGLEN + 1]; /* last message displayed */

View File

@ -235,7 +235,7 @@ extern bool onesearch; /* one search only in line mode */
extern char *reflines; /* symbol reference lines file */ extern char *reflines; /* symbol reference lines file */
extern bool do_press_any_key; /* wait for any key to continue */ extern bool do_press_any_key; /* wait for any key to continue */
extern int current_page; extern int current_page;
#define topref current_page *mdisprefs #define topref (current_page * mdisprefs)
void verswp_field(void); void verswp_field(void);
void horswp_field(void); void horswp_field(void);
bool interpret(int c); // XXX: probably rename bool interpret(int c); // XXX: probably rename