Resolve conflicts.
This commit is contained in:
parent
a27d1d954d
commit
ea073d6e59
@ -353,6 +353,9 @@ A window showing the keyboard operations that can be performed can be
|
|||||||
displayed or not.
|
displayed or not.
|
||||||
.It emacs keys
|
.It emacs keys
|
||||||
Control keys may be given bindings similar to emacs, or not.
|
Control keys may be given bindings similar to emacs, or not.
|
||||||
|
.It 16 bit characters
|
||||||
|
Toggles whether sixteen bit characters are handled as one 16-bit quantities or
|
||||||
|
two 8-bit quantities. This works primarily with the Chinese Big 5 code set.
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
You may set these modes via the initialization file (see below), or with a
|
You may set these modes via the initialization file (see below), or with a
|
||||||
@ -496,10 +499,14 @@ Turn on display of eight bit characters.
|
|||||||
.It noeightbit
|
.It noeightbit
|
||||||
Turn off display of eight bit characters (they are displayed as their decimal
|
Turn off display of eight bit characters (they are displayed as their decimal
|
||||||
value inside angle brackets, e.g., "<220>").
|
value inside angle brackets, e.g., "<220>").
|
||||||
|
.It 16bit
|
||||||
|
Turns on handling of 16-bit characters.
|
||||||
|
.It no16bit
|
||||||
|
Turns off handling of 16-bit characters.
|
||||||
.It emacs
|
.It emacs
|
||||||
Turn on emacs key bindings.
|
Turns on emacs key bindings.
|
||||||
.It noemacs
|
.It noemacs
|
||||||
Turn off emacs key bindings.
|
Turns off emacs key bindings.
|
||||||
.El
|
.El
|
||||||
.Ss "Save Editor Configuration"
|
.Ss "Save Editor Configuration"
|
||||||
When using this entry from the
|
When using this entry from the
|
||||||
@ -538,7 +545,10 @@ Always make a copy of files that cannot be easily reproduced before
|
|||||||
editing. Save files early, and save often.
|
editing. Save files early, and save often.
|
||||||
.Ss "International Code Set Support"
|
.Ss "International Code Set Support"
|
||||||
.Nm Ee
|
.Nm Ee
|
||||||
supports single-byte character code sets (eight-bit clean).
|
supports single-byte character code sets (eight-bit clean), or the
|
||||||
|
Chinese Big-5 code set. (Other multi-byte code sets may function, but the
|
||||||
|
reason Big-5 works is that a two-byte character also takes up two columns on
|
||||||
|
the screen.)
|
||||||
.Sh WARNINGS
|
.Sh WARNINGS
|
||||||
The automatic paragraph formatting operation
|
The automatic paragraph formatting operation
|
||||||
may be too slow for slower systems.
|
may be too slow for slower systems.
|
||||||
@ -558,10 +568,10 @@ This software and documentation contains
|
|||||||
proprietary information which is protected by
|
proprietary information which is protected by
|
||||||
copyright. All rights are reserved.
|
copyright. All rights are reserved.
|
||||||
.Pp
|
.Pp
|
||||||
Copyright (c) 1990, 1991, 1992, 1993, 1995 Hugh Mahon.
|
Copyright (c) 1990, 1991, 1992, 1993, 1995, 1996 Hugh Mahon.
|
||||||
.Sh "SEE ALSO"
|
.Sh "SEE ALSO"
|
||||||
.Xr ispell 1 ,
|
.Xr ispell 1 ,
|
||||||
.Xr lp 1 ,
|
.Xr lpr 1 ,
|
||||||
.Xr spell 1 ,
|
.Xr spell 1 ,
|
||||||
.Xr termcap 5 ,
|
.Xr termcap 5 ,
|
||||||
.Xr terminfo 5 ,
|
.Xr terminfo 5 ,
|
||||||
|
394
usr.bin/ee/ee.c
394
usr.bin/ee/ee.c
@ -64,7 +64,7 @@ char *ee_long_notice[] = {
|
|||||||
"copyright. All rights are reserved."
|
"copyright. All rights are reserved."
|
||||||
};
|
};
|
||||||
|
|
||||||
char *version = "@(#) ee, version 1.3";
|
char *version = "@(#) ee, version 1.4.1";
|
||||||
|
|
||||||
#ifdef NCURSE
|
#ifdef NCURSE
|
||||||
#include "new_curse.h"
|
#include "new_curse.h"
|
||||||
@ -124,7 +124,7 @@ nl_catd catalog;
|
|||||||
#define COMMANDS 2
|
#define COMMANDS 2
|
||||||
|
|
||||||
struct text {
|
struct text {
|
||||||
char *line; /* line of characters */
|
unsigned char *line; /* line of characters */
|
||||||
int line_number; /* line number */
|
int line_number; /* line number */
|
||||||
int line_length; /* actual number of characters in the line */
|
int line_length; /* actual number of characters in the line */
|
||||||
int max_length; /* maximum number of characters the line handles */
|
int max_length; /* maximum number of characters the line handles */
|
||||||
@ -139,7 +139,7 @@ struct text *tmp_line; /* temporary line pointer */
|
|||||||
struct text *srch_line; /* temporary pointer for search routine */
|
struct text *srch_line; /* temporary pointer for search routine */
|
||||||
|
|
||||||
struct files { /* structure to store names of files to be edited*/
|
struct files { /* structure to store names of files to be edited*/
|
||||||
char *name; /* name of file */
|
unsigned char *name; /* name of file */
|
||||||
struct files *next_name;
|
struct files *next_name;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -185,21 +185,25 @@ int local_LINES = 0; /* copy of LINES, to detect when win resizes */
|
|||||||
int local_COLS = 0; /* copy of COLS, to detect when win resizes */
|
int local_COLS = 0; /* copy of COLS, to detect when win resizes */
|
||||||
int curses_initialized = FALSE; /* flag indicating if curses has been started*/
|
int curses_initialized = FALSE; /* flag indicating if curses has been started*/
|
||||||
int emacs_keys_mode = FALSE; /* mode for if emacs key binings are used */
|
int emacs_keys_mode = FALSE; /* mode for if emacs key binings are used */
|
||||||
|
int ee_chinese = FALSE; /* allows handling of multi-byte characters */
|
||||||
|
/* by checking for high bit in a byte the */
|
||||||
|
/* code recognizes a two-byte character */
|
||||||
|
/* sequence */
|
||||||
|
|
||||||
char *point; /* points to current position in line */
|
unsigned char *point; /* points to current position in line */
|
||||||
char *srch_str; /* pointer for search string */
|
unsigned char *srch_str; /* pointer for search string */
|
||||||
char *u_srch_str; /* pointer to non-case sensitive search */
|
unsigned char *u_srch_str; /* pointer to non-case sensitive search */
|
||||||
char *srch_1; /* pointer to start of suspect string */
|
unsigned char *srch_1; /* pointer to start of suspect string */
|
||||||
char *srch_2; /* pointer to next character of string */
|
unsigned char *srch_2; /* pointer to next character of string */
|
||||||
char *srch_3;
|
unsigned char *srch_3;
|
||||||
char *in_file_name = NULL; /* name of input file */
|
unsigned char *in_file_name = NULL; /* name of input file */
|
||||||
char *tmp_file; /* temporary file name */
|
char *tmp_file; /* temporary file name */
|
||||||
char d_char; /* deleted character */
|
unsigned char *d_char; /* deleted character */
|
||||||
char *d_word; /* deleted word */
|
unsigned char *d_word; /* deleted word */
|
||||||
char *d_line; /* deleted line */
|
unsigned char *d_line; /* deleted line */
|
||||||
char in_string[513]; /* buffer for reading a file */
|
char in_string[513]; /* buffer for reading a file */
|
||||||
char *print_command = "lpr"; /* string to use for the print command */
|
unsigned char *print_command = "lpr"; /* string to use for the print command */
|
||||||
char *start_at_line = NULL; /* move to this line at start of session*/
|
unsigned char *start_at_line = NULL; /* move to this line at start of session*/
|
||||||
char *count_text; /* buffer for current position display */
|
char *count_text; /* buffer for current position display */
|
||||||
const char *count_text_default = "===============================================================================";
|
const char *count_text_default = "===============================================================================";
|
||||||
int count_text_len; /* length of the line above */
|
int count_text_len; /* length of the line above */
|
||||||
@ -252,22 +256,22 @@ struct menu_entries {
|
|||||||
struct menu_entries *ptr_argument;
|
struct menu_entries *ptr_argument;
|
||||||
int (*iprocedure)P_((int));
|
int (*iprocedure)P_((int));
|
||||||
void (*nprocedure)P_((void));
|
void (*nprocedure)P_((void));
|
||||||
unsigned int argument;
|
int argument;
|
||||||
};
|
};
|
||||||
|
|
||||||
int main P_((int argc, char *argv[]));
|
int main P_((int argc, char *argv[]));
|
||||||
char *resiz_line P_((int factor, struct text *rline, int rpos));
|
unsigned char *resiz_line P_((int factor, struct text *rline, int rpos));
|
||||||
void insert P_((int character));
|
void insert P_((int character));
|
||||||
void delete P_((int disp));
|
void delete P_((int disp));
|
||||||
void scanline P_((char *pos));
|
void scanline P_((unsigned char *pos));
|
||||||
int tabshift P_((int temp_int));
|
int tabshift P_((int temp_int));
|
||||||
int out_char P_((WINDOW *window, int character, int column));
|
int out_char P_((WINDOW *window, int character, int column));
|
||||||
int len_char P_((int character, int column));
|
int len_char P_((int character, int column));
|
||||||
void draw_line P_((int vertical, int horiz, char *ptr, int t_pos, int length));
|
void draw_line P_((int vertical, int horiz, unsigned char *ptr, int t_pos, int length));
|
||||||
void insert_line P_((int disp));
|
void insert_line P_((int disp));
|
||||||
struct text *txtalloc P_((void));
|
struct text *txtalloc P_((void));
|
||||||
struct files *name_alloc P_((void));
|
struct files *name_alloc P_((void));
|
||||||
char *next_word P_((char *string));
|
unsigned char *next_word P_((unsigned char *string));
|
||||||
void prev_word P_((void));
|
void prev_word P_((void));
|
||||||
void control P_((void));
|
void control P_((void));
|
||||||
void emacs_control P_((void));
|
void emacs_control P_((void));
|
||||||
@ -288,11 +292,11 @@ int scan P_((char *line, int offset, int column));
|
|||||||
char *get_string P_((char *prompt, int advance));
|
char *get_string P_((char *prompt, int advance));
|
||||||
int compare P_((char *string1, char *string2, int sensitive));
|
int compare P_((char *string1, char *string2, int sensitive));
|
||||||
void goto_line P_((char *cmd_str));
|
void goto_line P_((char *cmd_str));
|
||||||
void midscreen P_((int line, char *pnt));
|
void midscreen P_((int line, unsigned char *pnt));
|
||||||
void get_options P_((int numargs, char *arguments[]));
|
void get_options P_((int numargs, char *arguments[]));
|
||||||
void check_fp P_((void));
|
void check_fp P_((void));
|
||||||
void get_file P_((char *file_name));
|
void get_file P_((char *file_name));
|
||||||
void get_line P_((int length, char *in_string, int *append));
|
void get_line P_((int length, unsigned char *in_string, int *append));
|
||||||
void draw_screen P_((void));
|
void draw_screen P_((void));
|
||||||
void finish P_((void));
|
void finish P_((void));
|
||||||
int quit P_((int noverify));
|
int quit P_((int noverify));
|
||||||
@ -348,22 +352,23 @@ void strings_init P_((void));
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
struct menu_entries modes_menu[] = {
|
struct menu_entries modes_menu[] = {
|
||||||
{"", NULL, NULL, NULL, NULL, 0},
|
{"", NULL, NULL, NULL, NULL, 0}, /* title */
|
||||||
{"", NULL, NULL, NULL, NULL, -1},
|
{"", NULL, NULL, NULL, NULL, -1}, /* 1. tabs to spaces */
|
||||||
{"", NULL, NULL, NULL, NULL, -1},
|
{"", NULL, NULL, NULL, NULL, -1}, /* 2. case sensitive search*/
|
||||||
{"", NULL, NULL, NULL, NULL, -1},
|
{"", NULL, NULL, NULL, NULL, -1}, /* 3. margins observed */
|
||||||
{"", NULL, NULL, NULL, NULL, -1},
|
{"", NULL, NULL, NULL, NULL, -1}, /* 4. auto-paragraph */
|
||||||
{"", NULL, NULL, NULL, NULL, -1},
|
{"", NULL, NULL, NULL, NULL, -1}, /* 5. eightbit characters*/
|
||||||
{"", NULL, NULL, NULL, NULL, -1},
|
{"", NULL, NULL, NULL, NULL, -1}, /* 6. info window */
|
||||||
{"", NULL, NULL, NULL, NULL, -1},
|
{"", NULL, NULL, NULL, NULL, -1}, /* 7. emacs key bindings*/
|
||||||
{"", NULL, NULL, NULL, NULL, -1},
|
{"", NULL, NULL, NULL, NULL, -1}, /* 8. right margin */
|
||||||
{"", NULL, NULL, NULL, dump_ee_conf, -1},
|
{"", NULL, NULL, NULL, NULL, -1}, /* 9. chinese text */
|
||||||
{NULL, NULL, NULL, NULL, NULL, -1}
|
{"", NULL, NULL, NULL, dump_ee_conf, -1}, /* 10. save editor config */
|
||||||
|
{NULL, NULL, NULL, NULL, NULL, -1} /* terminator */
|
||||||
};
|
};
|
||||||
|
|
||||||
char *mode_strings[10];
|
char *mode_strings[11];
|
||||||
|
|
||||||
#define NUM_MODES_ITEMS 9
|
#define NUM_MODES_ITEMS 10
|
||||||
|
|
||||||
struct menu_entries config_dump_menu[] = {
|
struct menu_entries config_dump_menu[] = {
|
||||||
{"", NULL, NULL, NULL, NULL, 0},
|
{"", NULL, NULL, NULL, NULL, 0},
|
||||||
@ -426,15 +431,15 @@ struct menu_entries main_menu[] = {
|
|||||||
{NULL, NULL, NULL, NULL, NULL, -1}
|
{NULL, NULL, NULL, NULL, NULL, -1}
|
||||||
};
|
};
|
||||||
|
|
||||||
char *help_text[22];
|
char *help_text[23];
|
||||||
char *control_keys[5];
|
char *control_keys[5];
|
||||||
|
|
||||||
char *emacs_help_text[22];
|
char *emacs_help_text[22];
|
||||||
char *emacs_control_keys[5];
|
char *emacs_control_keys[5];
|
||||||
|
|
||||||
char *command_strings[5];
|
char *command_strings[5];
|
||||||
char *commands[30];
|
char *commands[32];
|
||||||
char *init_strings[20];
|
char *init_strings[22];
|
||||||
|
|
||||||
#define MENU_WARN 1
|
#define MENU_WARN 1
|
||||||
|
|
||||||
@ -533,6 +538,8 @@ char *cancel_string;
|
|||||||
char *menu_too_lrg_msg;
|
char *menu_too_lrg_msg;
|
||||||
char *more_above_str, *more_below_str;
|
char *more_above_str, *more_below_str;
|
||||||
|
|
||||||
|
char *chinese_cmd, *nochinese_cmd;
|
||||||
|
|
||||||
#ifndef __STDC__
|
#ifndef __STDC__
|
||||||
#ifndef HAS_STDLIB
|
#ifndef HAS_STDLIB
|
||||||
extern char *malloc();
|
extern char *malloc();
|
||||||
@ -558,13 +565,13 @@ char *argv[];
|
|||||||
|
|
||||||
count_text_len = strlen(count_text_default) + 1;
|
count_text_len = strlen(count_text_default) + 1;
|
||||||
count_text = malloc(count_text_len);
|
count_text = malloc(count_text_len);
|
||||||
d_char = 0;
|
d_char = malloc(3); /* provide a buffer for multi-byte chars */
|
||||||
d_word = malloc(150);
|
d_word = malloc(150);
|
||||||
*d_word = (char) NULL;
|
*d_word = (char) NULL;
|
||||||
d_line = NULL;
|
d_line = NULL;
|
||||||
dlt_line = txtalloc();
|
dlt_line = txtalloc();
|
||||||
dlt_line->line = d_line;
|
dlt_line->line = d_line;
|
||||||
dlt_line->line_length = 1;
|
dlt_line->line_length = 0;
|
||||||
curr_line = first_line = txtalloc();
|
curr_line = first_line = txtalloc();
|
||||||
curr_line->line = point = malloc(10);
|
curr_line->line = point = malloc(10);
|
||||||
curr_line->line_length = 1;
|
curr_line->line_length = 1;
|
||||||
@ -644,7 +651,10 @@ char *argv[];
|
|||||||
if (in > 255)
|
if (in > 255)
|
||||||
function_key();
|
function_key();
|
||||||
else if ((in == '\10') || (in == 127))
|
else if ((in == '\10') || (in == 127))
|
||||||
|
{
|
||||||
|
in = 8; /* make sure key is set to backspace */
|
||||||
delete(TRUE);
|
delete(TRUE);
|
||||||
|
}
|
||||||
else if ((in > 31) || (in == 9))
|
else if ((in > 31) || (in == 9))
|
||||||
insert(in);
|
insert(in);
|
||||||
else if ((in >= 0) && (in <= 31))
|
else if ((in >= 0) && (in <= 31))
|
||||||
@ -658,13 +668,13 @@ char *argv[];
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
unsigned char *
|
||||||
resiz_line(factor, rline, rpos) /* resize the line to length + factor*/
|
resiz_line(factor, rline, rpos) /* resize the line to length + factor*/
|
||||||
int factor; /* resize factor */
|
int factor; /* resize factor */
|
||||||
struct text *rline; /* position in line */
|
struct text *rline; /* position in line */
|
||||||
int rpos;
|
int rpos;
|
||||||
{
|
{
|
||||||
char *rpoint;
|
unsigned char *rpoint;
|
||||||
int resiz_var;
|
int resiz_var;
|
||||||
|
|
||||||
rline->max_length += factor;
|
rline->max_length += factor;
|
||||||
@ -680,8 +690,8 @@ int character; /* new character */
|
|||||||
{
|
{
|
||||||
int counter;
|
int counter;
|
||||||
int value;
|
int value;
|
||||||
char *temp; /* temporary pointer */
|
unsigned char *temp; /* temporary pointer */
|
||||||
char *temp2; /* temporary pointer */
|
unsigned char *temp2; /* temporary pointer */
|
||||||
|
|
||||||
if ((character == '\011') && (expand_tabs))
|
if ((character == '\011') && (expand_tabs))
|
||||||
{
|
{
|
||||||
@ -763,31 +773,46 @@ void
|
|||||||
delete(disp) /* delete character */
|
delete(disp) /* delete character */
|
||||||
int disp;
|
int disp;
|
||||||
{
|
{
|
||||||
char *tp;
|
unsigned char *tp;
|
||||||
char *temp2;
|
unsigned char *temp2;
|
||||||
struct text *temp_buff;
|
struct text *temp_buff;
|
||||||
int temp_vert;
|
int temp_vert;
|
||||||
int temp_pos;
|
int temp_pos;
|
||||||
|
int del_width = 1;
|
||||||
|
|
||||||
if (point != curr_line->line) /* if not at beginning of line */
|
if (point != curr_line->line) /* if not at beginning of line */
|
||||||
{
|
{
|
||||||
text_changes = TRUE;
|
text_changes = TRUE;
|
||||||
temp2 = tp = point;
|
temp2 = tp = point;
|
||||||
tp--;
|
if ((ee_chinese) && (position >= 2) && (*(point - 2) > 127))
|
||||||
point--;
|
{
|
||||||
if ((*tp >= '\000') && (*tp < ' ')) /* check for TAB */
|
del_width = 2;
|
||||||
|
}
|
||||||
|
tp -= del_width;
|
||||||
|
point -= del_width;
|
||||||
|
position -= del_width;
|
||||||
|
temp_pos = position;
|
||||||
|
curr_line->line_length -= del_width;
|
||||||
|
if ((*tp < ' ') || (*tp >= 127)) /* check for TAB */
|
||||||
scanline(tp);
|
scanline(tp);
|
||||||
else
|
else
|
||||||
--scr_horz;
|
scr_horz -= del_width;
|
||||||
scr_pos = scr_horz;
|
scr_pos = scr_horz;
|
||||||
if (in == 8)
|
if (in == 8)
|
||||||
d_char = *point; /* save deleted character */
|
{
|
||||||
temp_pos = --position;
|
if (del_width == 1)
|
||||||
curr_line->line_length--;
|
*d_char = *point; /* save deleted character */
|
||||||
|
else
|
||||||
|
{
|
||||||
|
d_char[0] = *point;
|
||||||
|
d_char[1] = *(point + 1);
|
||||||
|
}
|
||||||
|
d_char[del_width] = (unsigned char) NULL;
|
||||||
|
}
|
||||||
while (temp_pos <= curr_line->line_length)
|
while (temp_pos <= curr_line->line_length)
|
||||||
{
|
{
|
||||||
temp_pos++;
|
temp_pos++;
|
||||||
*tp= *temp2;
|
*tp = *temp2;
|
||||||
tp++;
|
tp++;
|
||||||
temp2++;
|
temp2++;
|
||||||
}
|
}
|
||||||
@ -809,7 +834,10 @@ int disp;
|
|||||||
renumber_lines(curr_line->next_line, curr_line->line_number + 1);
|
renumber_lines(curr_line->next_line, curr_line->line_number + 1);
|
||||||
temp2 = temp_buff->line;
|
temp2 = temp_buff->line;
|
||||||
if (in == 8)
|
if (in == 8)
|
||||||
d_char = '\n';
|
{
|
||||||
|
d_char[0] = '\n';
|
||||||
|
d_char[1] = (unsigned char) NULL;
|
||||||
|
}
|
||||||
tp = point;
|
tp = point;
|
||||||
temp_pos = 1;
|
temp_pos = 1;
|
||||||
while (temp_pos < temp_buff->line_length)
|
while (temp_pos < temp_buff->line_length)
|
||||||
@ -851,16 +879,16 @@ int disp;
|
|||||||
|
|
||||||
void
|
void
|
||||||
scanline(pos) /* find the proper horizontal position for the pointer */
|
scanline(pos) /* find the proper horizontal position for the pointer */
|
||||||
char *pos;
|
unsigned char *pos;
|
||||||
{
|
{
|
||||||
int temp;
|
int temp;
|
||||||
char *ptr;
|
unsigned char *ptr;
|
||||||
|
|
||||||
ptr = curr_line->line;
|
ptr = curr_line->line;
|
||||||
temp = 0;
|
temp = 0;
|
||||||
while (ptr < pos)
|
while (ptr < pos)
|
||||||
{
|
{
|
||||||
if ((*ptr >= 0) && (*ptr <= 8))
|
if (*ptr <= 8)
|
||||||
temp += 2;
|
temp += 2;
|
||||||
else if (*ptr == 9)
|
else if (*ptr == 9)
|
||||||
temp += tabshift(temp);
|
temp += tabshift(temp);
|
||||||
@ -909,7 +937,7 @@ char character;
|
|||||||
int column;
|
int column;
|
||||||
{
|
{
|
||||||
int i1, i2;
|
int i1, i2;
|
||||||
char *string;
|
unsigned char *string;
|
||||||
char string2[8];
|
char string2[8];
|
||||||
|
|
||||||
if (character == TAB)
|
if (character == TAB)
|
||||||
@ -937,13 +965,13 @@ int column;
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
waddch(window, (unsigned char)character );
|
waddch(window, (char)character );
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
waddch(window, (unsigned char)character);
|
waddch(window, (char)character);
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
for (i2 = 0; (string[i2] != (char) NULL) && (((column+i2+1)-horiz_offset) < last_col); i2++)
|
for (i2 = 0; (string[i2] != (char) NULL) && (((column+i2+1)-horiz_offset) < last_col); i2++)
|
||||||
@ -978,12 +1006,12 @@ void
|
|||||||
draw_line(vertical, horiz, ptr, t_pos, length) /* redraw line from current position */
|
draw_line(vertical, horiz, ptr, t_pos, length) /* redraw line from current position */
|
||||||
int vertical; /* current vertical position on screen */
|
int vertical; /* current vertical position on screen */
|
||||||
int horiz; /* current horizontal position on screen */
|
int horiz; /* current horizontal position on screen */
|
||||||
char *ptr; /* pointer to line */
|
unsigned char *ptr; /* pointer to line */
|
||||||
int t_pos; /* current position (offset in bytes) from bol */
|
int t_pos; /* current position (offset in bytes) from bol */
|
||||||
int length; /* length (in bytes) of line */
|
int length; /* length (in bytes) of line */
|
||||||
{
|
{
|
||||||
int d; /* partial length of special or tab char to display */
|
int d; /* partial length of special or tab char to display */
|
||||||
char *temp; /* temporary pointer to position in line */
|
unsigned char *temp; /* temporary pointer to position in line */
|
||||||
int abs_column; /* offset in screen units from begin of line */
|
int abs_column; /* offset in screen units from begin of line */
|
||||||
int column; /* horizontal position on screen */
|
int column; /* horizontal position on screen */
|
||||||
int row; /* vertical position on screen */
|
int row; /* vertical position on screen */
|
||||||
@ -1012,7 +1040,7 @@ int length; /* length (in bytes) of line */
|
|||||||
wclrtoeol(text_win);
|
wclrtoeol(text_win);
|
||||||
while ((posit < length) && (column <= last_col))
|
while ((posit < length) && (column <= last_col))
|
||||||
{
|
{
|
||||||
if ((*temp < 32) || (*temp == 127))
|
if ((*temp < 32) || (*temp >= 127))
|
||||||
{
|
{
|
||||||
column += len_char(*temp, abs_column);
|
column += len_char(*temp, abs_column);
|
||||||
abs_column += out_char(text_win, *temp, abs_column);
|
abs_column += out_char(text_win, *temp, abs_column);
|
||||||
@ -1037,8 +1065,8 @@ int disp;
|
|||||||
{
|
{
|
||||||
int temp_pos;
|
int temp_pos;
|
||||||
int temp_pos2;
|
int temp_pos2;
|
||||||
char *temp;
|
unsigned char *temp;
|
||||||
char *extra;
|
unsigned char *extra;
|
||||||
struct text *temp_nod;
|
struct text *temp_nod;
|
||||||
|
|
||||||
text_changes = TRUE;
|
text_changes = TRUE;
|
||||||
@ -1117,8 +1145,8 @@ struct files *name_alloc() /* allocate space for file name list node */
|
|||||||
return((struct files *) malloc(sizeof( struct files)));
|
return((struct files *) malloc(sizeof( struct files)));
|
||||||
}
|
}
|
||||||
|
|
||||||
char *next_word(string) /* move to next word in string */
|
unsigned char *next_word(string) /* move to next word in string */
|
||||||
char *string;
|
unsigned char *string;
|
||||||
{
|
{
|
||||||
while ((*string != (char) NULL) && ((*string != 32) && (*string != 9)))
|
while ((*string != (char) NULL) && ((*string != 32) && (*string != 9)))
|
||||||
string++;
|
string++;
|
||||||
@ -1370,6 +1398,11 @@ int disp;
|
|||||||
{
|
{
|
||||||
if (point != curr_line->line) /* if not at begin of line */
|
if (point != curr_line->line) /* if not at begin of line */
|
||||||
{
|
{
|
||||||
|
if ((ee_chinese) && (position >= 2) && (*(point - 2) > 127))
|
||||||
|
{
|
||||||
|
point--;
|
||||||
|
position--;
|
||||||
|
}
|
||||||
point--;
|
point--;
|
||||||
position--;
|
position--;
|
||||||
scanline(point);
|
scanline(point);
|
||||||
@ -1399,6 +1432,12 @@ int disp;
|
|||||||
{
|
{
|
||||||
if (position < curr_line->line_length)
|
if (position < curr_line->line_length)
|
||||||
{
|
{
|
||||||
|
if ((ee_chinese) && (*point > 127) &&
|
||||||
|
((curr_line->line_length - position) >= 2))
|
||||||
|
{
|
||||||
|
point++;
|
||||||
|
position++;
|
||||||
|
}
|
||||||
point++;
|
point++;
|
||||||
position++;
|
position++;
|
||||||
scanline(point);
|
scanline(point);
|
||||||
@ -1435,8 +1474,15 @@ find_pos() /* move to the same column as on other line */
|
|||||||
{
|
{
|
||||||
if (*point == 9)
|
if (*point == 9)
|
||||||
scr_horz += tabshift(scr_horz);
|
scr_horz += tabshift(scr_horz);
|
||||||
else if ((*point >= '\0') && (*point < ' '))
|
else if (*point < ' ')
|
||||||
scr_horz += 2;
|
scr_horz += 2;
|
||||||
|
else if ((ee_chinese) && (*point > 127) &&
|
||||||
|
((curr_line->line_length - position) >= 2))
|
||||||
|
{
|
||||||
|
scr_horz += 2;
|
||||||
|
point++;
|
||||||
|
position++;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
scr_horz++;
|
scr_horz++;
|
||||||
position++;
|
position++;
|
||||||
@ -1696,10 +1742,7 @@ char *cmd_str1;
|
|||||||
{
|
{
|
||||||
wmove(com_win, 0, 0);
|
wmove(com_win, 0, 0);
|
||||||
wclrtoeol(com_win);
|
wclrtoeol(com_win);
|
||||||
if (*point >= '\0')
|
wprintw(com_win, char_str, *point);
|
||||||
wprintw(com_win, char_str, *point);
|
|
||||||
else
|
|
||||||
wprintw(com_win, char_str, (*point + 256));
|
|
||||||
}
|
}
|
||||||
else if (compare(cmd_str, REDRAW, FALSE))
|
else if (compare(cmd_str, REDRAW, FALSE))
|
||||||
redraw();
|
redraw();
|
||||||
@ -1734,6 +1777,20 @@ char *cmd_str1;
|
|||||||
expand_tabs = FALSE;
|
expand_tabs = FALSE;
|
||||||
else if (compare(cmd_str, Exit_string, FALSE))
|
else if (compare(cmd_str, Exit_string, FALSE))
|
||||||
finish();
|
finish();
|
||||||
|
else if (compare(cmd_str, chinese_cmd, FALSE))
|
||||||
|
{
|
||||||
|
ee_chinese = TRUE;
|
||||||
|
#ifdef NCURSE
|
||||||
|
nc_setattrib(A_NC_BIG5);
|
||||||
|
#endif /* NCURSE */
|
||||||
|
}
|
||||||
|
else if (compare(cmd_str, nochinese_cmd, FALSE))
|
||||||
|
{
|
||||||
|
ee_chinese = FALSE;
|
||||||
|
#ifdef NCURSE
|
||||||
|
nc_clearattrib(A_NC_BIG5);
|
||||||
|
#endif /* NCURSE */
|
||||||
|
}
|
||||||
else if (compare(cmd_str, QUIT_string, FALSE))
|
else if (compare(cmd_str, QUIT_string, FALSE))
|
||||||
quit(0);
|
quit(0);
|
||||||
else if (*cmd_str == '!')
|
else if (*cmd_str == '!')
|
||||||
@ -1967,7 +2024,7 @@ char *cmd_str;
|
|||||||
void
|
void
|
||||||
midscreen(line, pnt) /* put current line in middle of screen */
|
midscreen(line, pnt) /* put current line in middle of screen */
|
||||||
int line;
|
int line;
|
||||||
char *pnt;
|
unsigned char *pnt;
|
||||||
{
|
{
|
||||||
struct text *mid_line;
|
struct text *mid_line;
|
||||||
int i;
|
int i;
|
||||||
@ -2221,11 +2278,11 @@ char *file_name;
|
|||||||
void
|
void
|
||||||
get_line(length, in_string, append) /* read string and split into lines */
|
get_line(length, in_string, append) /* read string and split into lines */
|
||||||
int length; /* length of string read by read */
|
int length; /* length of string read by read */
|
||||||
char *in_string; /* string read by read */
|
unsigned char *in_string; /* string read by read */
|
||||||
int *append; /* TRUE if must append more text to end of current line */
|
int *append; /* TRUE if must append more text to end of current line */
|
||||||
{
|
{
|
||||||
char *str1;
|
unsigned char *str1;
|
||||||
char *str2;
|
unsigned char *str2;
|
||||||
int num; /* offset from start of string */
|
int num; /* offset from start of string */
|
||||||
int char_count; /* length of new line (or added portion */
|
int char_count; /* length of new line (or added portion */
|
||||||
int temp_counter; /* temporary counter value */
|
int temp_counter; /* temporary counter value */
|
||||||
@ -2266,7 +2323,7 @@ int *append; /* TRUE if must append more text to end of current line */
|
|||||||
if (tline->next_line != NULL)
|
if (tline->next_line != NULL)
|
||||||
tline->next_line->prev_line = tline;
|
tline->next_line->prev_line = tline;
|
||||||
curr_line = tline;
|
curr_line = tline;
|
||||||
curr_line->line = point = (char *) malloc(char_count);
|
curr_line->line = point = (unsigned char *) malloc(char_count);
|
||||||
curr_line->line_length = char_count;
|
curr_line->line_length = char_count;
|
||||||
curr_line->max_length = char_count;
|
curr_line->max_length = char_count;
|
||||||
}
|
}
|
||||||
@ -2292,7 +2349,7 @@ void
|
|||||||
draw_screen() /* redraw the screen from current postion */
|
draw_screen() /* redraw the screen from current postion */
|
||||||
{
|
{
|
||||||
struct text *temp_line;
|
struct text *temp_line;
|
||||||
char *line_out;
|
unsigned char *line_out;
|
||||||
int temp_vert;
|
int temp_vert;
|
||||||
|
|
||||||
temp_line = curr_line;
|
temp_line = curr_line;
|
||||||
@ -2628,6 +2685,12 @@ del_char() /* delete current character */
|
|||||||
in = 8; /* backspace */
|
in = 8; /* backspace */
|
||||||
if (position < curr_line->line_length) /* if not end of line */
|
if (position < curr_line->line_length) /* if not end of line */
|
||||||
{
|
{
|
||||||
|
if ((ee_chinese) && (*point > 127) &&
|
||||||
|
((curr_line->line_length - position) >= 2))
|
||||||
|
{
|
||||||
|
point++;
|
||||||
|
position++;
|
||||||
|
}
|
||||||
position++;
|
position++;
|
||||||
point++;
|
point++;
|
||||||
scanline(point);
|
scanline(point);
|
||||||
@ -2643,12 +2706,17 @@ del_char() /* delete current character */
|
|||||||
void
|
void
|
||||||
undel_char() /* undelete last deleted character */
|
undel_char() /* undelete last deleted character */
|
||||||
{
|
{
|
||||||
if (d_char == '\n') /* insert line if last del_char deleted eol */
|
if (d_char[0] == '\n') /* insert line if last del_char deleted eol */
|
||||||
insert_line(TRUE);
|
insert_line(TRUE);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
in = d_char;
|
in = d_char[0];
|
||||||
insert(in);
|
insert(in);
|
||||||
|
if (d_char[1] != (unsigned char) NULL)
|
||||||
|
{
|
||||||
|
in = d_char[1];
|
||||||
|
insert(in);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2657,14 +2725,16 @@ del_word() /* delete word in front of cursor */
|
|||||||
{
|
{
|
||||||
int tposit;
|
int tposit;
|
||||||
int difference;
|
int difference;
|
||||||
char *d_word2;
|
unsigned char *d_word2;
|
||||||
char *d_word3;
|
unsigned char *d_word3;
|
||||||
char tmp_char;
|
unsigned char tmp_char[3];
|
||||||
|
|
||||||
if (d_word != NULL)
|
if (d_word != NULL)
|
||||||
free(d_word);
|
free(d_word);
|
||||||
d_word = malloc(curr_line->line_length);
|
d_word = malloc(curr_line->line_length);
|
||||||
tmp_char = d_char;
|
tmp_char[0] = d_char[0];
|
||||||
|
tmp_char[1] = d_char[1];
|
||||||
|
tmp_char[2] = d_char[2];
|
||||||
d_word3 = point;
|
d_word3 = point;
|
||||||
d_word2 = d_word;
|
d_word2 = d_word;
|
||||||
tposit = position;
|
tposit = position;
|
||||||
@ -2697,7 +2767,9 @@ del_word() /* delete word in front of cursor */
|
|||||||
curr_line->line_length -= difference;
|
curr_line->line_length -= difference;
|
||||||
*d_word2 = (char) NULL;
|
*d_word2 = (char) NULL;
|
||||||
draw_line(scr_vert, scr_horz,point,position,curr_line->line_length);
|
draw_line(scr_vert, scr_horz,point,position,curr_line->line_length);
|
||||||
d_char = tmp_char;
|
d_char[0] = tmp_char[0];
|
||||||
|
d_char[1] = tmp_char[1];
|
||||||
|
d_char[2] = tmp_char[2];
|
||||||
text_changes = TRUE;
|
text_changes = TRUE;
|
||||||
formatted = FALSE;
|
formatted = FALSE;
|
||||||
}
|
}
|
||||||
@ -2707,10 +2779,10 @@ undel_word() /* undelete last deleted word */
|
|||||||
{
|
{
|
||||||
int temp;
|
int temp;
|
||||||
int tposit;
|
int tposit;
|
||||||
char *tmp_old_ptr;
|
unsigned char *tmp_old_ptr;
|
||||||
char *tmp_space;
|
unsigned char *tmp_space;
|
||||||
char *tmp_ptr;
|
unsigned char *tmp_ptr;
|
||||||
char *d_word_ptr;
|
unsigned char *d_word_ptr;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
| resize line to handle undeleted word
|
| resize line to handle undeleted word
|
||||||
@ -2767,8 +2839,8 @@ undel_word() /* undelete last deleted word */
|
|||||||
void
|
void
|
||||||
del_line() /* delete from cursor to end of line */
|
del_line() /* delete from cursor to end of line */
|
||||||
{
|
{
|
||||||
char *dl1;
|
unsigned char *dl1;
|
||||||
char *dl2;
|
unsigned char *dl2;
|
||||||
int tposit;
|
int tposit;
|
||||||
|
|
||||||
if (d_line != NULL)
|
if (d_line != NULL)
|
||||||
@ -2800,10 +2872,13 @@ del_line() /* delete from cursor to end of line */
|
|||||||
void
|
void
|
||||||
undel_line() /* undelete last deleted line */
|
undel_line() /* undelete last deleted line */
|
||||||
{
|
{
|
||||||
char *ud1;
|
unsigned char *ud1;
|
||||||
char *ud2;
|
unsigned char *ud2;
|
||||||
int tposit;
|
int tposit;
|
||||||
|
|
||||||
|
if (dlt_line->line_length == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
insert_line(TRUE);
|
insert_line(TRUE);
|
||||||
left(TRUE);
|
left(TRUE);
|
||||||
point = resiz_line(dlt_line->line_length, curr_line, position);
|
point = resiz_line(dlt_line->line_length, curr_line, position);
|
||||||
@ -3190,6 +3265,12 @@ set_up_term() /* set up the terminal for operating with ae */
|
|||||||
last_col = COLS - 1;
|
last_col = COLS - 1;
|
||||||
local_LINES = LINES;
|
local_LINES = LINES;
|
||||||
local_COLS = COLS;
|
local_COLS = COLS;
|
||||||
|
|
||||||
|
#ifdef NCURSE
|
||||||
|
if (ee_chinese)
|
||||||
|
nc_setattrib(A_NC_BIG5);
|
||||||
|
#endif /* NCURSE */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -3243,7 +3324,7 @@ struct menu_entries menu_list[];
|
|||||||
max_width = length;
|
max_width = length;
|
||||||
}
|
}
|
||||||
max_width += 3;
|
max_width += 3;
|
||||||
max_width = max(max_width, strlen(cancel_string));
|
max_width = max(max_width, strlen(menu_cancel_msg));
|
||||||
max_width = max(max_width, max(strlen(more_above_str), strlen(more_below_str)));
|
max_width = max(max_width, max(strlen(more_above_str), strlen(more_below_str)));
|
||||||
max_width += 6;
|
max_width += 6;
|
||||||
|
|
||||||
@ -3464,7 +3545,7 @@ int off_start, vert_size;
|
|||||||
waddstr(menu_win, menu_list[0].item_string);
|
waddstr(menu_win, menu_list[0].item_string);
|
||||||
wmove(menu_win, (max_height - 3), 3);
|
wmove(menu_win, (max_height - 3), 3);
|
||||||
if (menu_list[0].argument != MENU_WARN)
|
if (menu_list[0].argument != MENU_WARN)
|
||||||
waddstr(menu_win, cancel_string);
|
waddstr(menu_win, menu_cancel_msg);
|
||||||
}
|
}
|
||||||
if (!nohighlight)
|
if (!nohighlight)
|
||||||
wstandout(menu_win);
|
wstandout(menu_win);
|
||||||
@ -3741,7 +3822,7 @@ int
|
|||||||
Blank_Line(test_line) /* test if line has any non-space characters */
|
Blank_Line(test_line) /* test if line has any non-space characters */
|
||||||
struct text *test_line;
|
struct text *test_line;
|
||||||
{
|
{
|
||||||
char *line;
|
unsigned char *line;
|
||||||
int length;
|
int length;
|
||||||
|
|
||||||
if (test_line == NULL)
|
if (test_line == NULL)
|
||||||
@ -3779,11 +3860,15 @@ Format() /* format the paragraph according to set margins */
|
|||||||
int status;
|
int status;
|
||||||
int tmp_af;
|
int tmp_af;
|
||||||
int counter;
|
int counter;
|
||||||
char *line;
|
unsigned char *line;
|
||||||
char *tmp_srchstr;
|
unsigned char *tmp_srchstr;
|
||||||
char *temp1, *temp2;
|
unsigned char *temp1, *temp2;
|
||||||
char *temp_dword;
|
unsigned char *temp_dword;
|
||||||
char temp_d_char = d_char;
|
unsigned char temp_d_char[3];
|
||||||
|
|
||||||
|
temp_d_char[0] = d_char[0];
|
||||||
|
temp_d_char[1] = d_char[1];
|
||||||
|
temp_d_char[2] = d_char[2];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
| if observ_margins is not set, or the current line is blank,
|
| if observ_margins is not set, or the current line is blank,
|
||||||
@ -3817,7 +3902,7 @@ Format() /* format the paragraph according to set margins */
|
|||||||
temp_case = case_sen;
|
temp_case = case_sen;
|
||||||
case_sen = TRUE;
|
case_sen = TRUE;
|
||||||
tmp_srchstr = srch_str;
|
tmp_srchstr = srch_str;
|
||||||
temp2 = srch_str = (char *) malloc(1 + curr_line->line_length - position);
|
temp2 = srch_str = (unsigned char *) malloc(1 + curr_line->line_length - position);
|
||||||
if ((*point == ' ') || (*point == '\t'))
|
if ((*point == ' ') || (*point == '\t'))
|
||||||
adv_word();
|
adv_word();
|
||||||
offset -= position;
|
offset -= position;
|
||||||
@ -3978,7 +4063,9 @@ Format() /* format the paragraph according to set margins */
|
|||||||
case_sen = temp_case;
|
case_sen = temp_case;
|
||||||
free(srch_str);
|
free(srch_str);
|
||||||
srch_str = tmp_srchstr;
|
srch_str = tmp_srchstr;
|
||||||
d_char = temp_d_char;
|
d_char[0] = temp_d_char[0];
|
||||||
|
d_char[1] = temp_d_char[1];
|
||||||
|
d_char[2] = temp_d_char[2];
|
||||||
auto_format = tmp_af;
|
auto_format = tmp_af;
|
||||||
|
|
||||||
midscreen(scr_vert, point);
|
midscreen(scr_vert, point);
|
||||||
@ -3986,7 +4073,7 @@ Format() /* format the paragraph according to set margins */
|
|||||||
wrefresh(com_win);
|
wrefresh(com_win);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *init_name[3] = {
|
unsigned char *init_name[3] = {
|
||||||
"/usr/share/misc/init.ee",
|
"/usr/share/misc/init.ee",
|
||||||
NULL,
|
NULL,
|
||||||
".init.ee"
|
".init.ee"
|
||||||
@ -3996,9 +4083,9 @@ void
|
|||||||
ee_init() /* check for init file and read it if it exists */
|
ee_init() /* check for init file and read it if it exists */
|
||||||
{
|
{
|
||||||
FILE *init_file;
|
FILE *init_file;
|
||||||
char *string;
|
unsigned char *string;
|
||||||
char *str1;
|
unsigned char *str1;
|
||||||
char *str2;
|
unsigned char *str2;
|
||||||
char *home;
|
char *home;
|
||||||
int counter;
|
int counter;
|
||||||
int temp_int;
|
int temp_int;
|
||||||
@ -4079,17 +4166,37 @@ ee_init() /* check for init file and read it if it exists */
|
|||||||
else if (compare(str1, EIGHTBIT, FALSE))
|
else if (compare(str1, EIGHTBIT, FALSE))
|
||||||
eightbit = TRUE;
|
eightbit = TRUE;
|
||||||
else if (compare(str1, NOEIGHTBIT, FALSE))
|
else if (compare(str1, NOEIGHTBIT, FALSE))
|
||||||
|
{
|
||||||
eightbit = FALSE;
|
eightbit = FALSE;
|
||||||
|
ee_chinese = FALSE;
|
||||||
|
}
|
||||||
else if (compare(str1, EMACS_string, FALSE))
|
else if (compare(str1, EMACS_string, FALSE))
|
||||||
emacs_keys_mode = TRUE;
|
emacs_keys_mode = TRUE;
|
||||||
else if (compare(str1, NOEMACS_string, FALSE))
|
else if (compare(str1, NOEMACS_string, FALSE))
|
||||||
emacs_keys_mode = FALSE;
|
emacs_keys_mode = FALSE;
|
||||||
|
else if (compare(str1, chinese_cmd, FALSE))
|
||||||
|
{
|
||||||
|
ee_chinese = TRUE;
|
||||||
|
eightbit = TRUE;
|
||||||
|
}
|
||||||
|
else if (compare(str1, nochinese_cmd, FALSE))
|
||||||
|
ee_chinese = FALSE;
|
||||||
}
|
}
|
||||||
fclose(init_file);
|
fclose(init_file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(string);
|
free(string);
|
||||||
free(home);
|
free(home);
|
||||||
|
|
||||||
|
string = getenv("LANG");
|
||||||
|
if (string != NULL)
|
||||||
|
{
|
||||||
|
if (strcmp(string, "zh_TW.big5") == 0)
|
||||||
|
{
|
||||||
|
ee_chinese = TRUE;
|
||||||
|
eightbit = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -4183,6 +4290,7 @@ dump_ee_conf()
|
|||||||
fprintf(init_file, "%s\n", nohighlight ? NOHIGHLIGHT : HIGHLIGHT );
|
fprintf(init_file, "%s\n", nohighlight ? NOHIGHLIGHT : HIGHLIGHT );
|
||||||
fprintf(init_file, "%s\n", eightbit ? EIGHTBIT : NOEIGHTBIT );
|
fprintf(init_file, "%s\n", eightbit ? EIGHTBIT : NOEIGHTBIT );
|
||||||
fprintf(init_file, "%s\n", emacs_keys_mode ? EMACS_string : NOEMACS_string );
|
fprintf(init_file, "%s\n", emacs_keys_mode ? EMACS_string : NOEMACS_string );
|
||||||
|
fprintf(init_file, "%s\n", ee_chinese ? chinese_cmd : nochinese_cmd );
|
||||||
|
|
||||||
fclose(init_file);
|
fclose(init_file);
|
||||||
|
|
||||||
@ -4297,7 +4405,7 @@ first_word_len(test_line)
|
|||||||
struct text *test_line;
|
struct text *test_line;
|
||||||
{
|
{
|
||||||
int counter;
|
int counter;
|
||||||
char *pnt;
|
unsigned char *pnt;
|
||||||
|
|
||||||
if (test_line == NULL)
|
if (test_line == NULL)
|
||||||
return(0);
|
return(0);
|
||||||
@ -4342,12 +4450,17 @@ Auto_Format() /* format the paragraph according to set margins */
|
|||||||
int status;
|
int status;
|
||||||
int counter;
|
int counter;
|
||||||
char not_blank;
|
char not_blank;
|
||||||
char *line;
|
unsigned char *line;
|
||||||
char *tmp_srchstr;
|
unsigned char *tmp_srchstr;
|
||||||
char *temp1, *temp2;
|
unsigned char *temp1, *temp2;
|
||||||
char *temp_dword;
|
unsigned char *temp_dword;
|
||||||
char temp_d_char = d_char;
|
unsigned char temp_d_char[3];
|
||||||
char *tmp_d_line;
|
unsigned char *tmp_d_line;
|
||||||
|
|
||||||
|
|
||||||
|
temp_d_char[0] = d_char[0];
|
||||||
|
temp_d_char[1] = d_char[1];
|
||||||
|
temp_d_char[2] = d_char[2];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
| if observ_margins is not set, or the current line is blank,
|
| if observ_margins is not set, or the current line is blank,
|
||||||
@ -4376,7 +4489,7 @@ Auto_Format() /* format the paragraph according to set margins */
|
|||||||
temp_case = case_sen;
|
temp_case = case_sen;
|
||||||
case_sen = TRUE;
|
case_sen = TRUE;
|
||||||
tmp_srchstr = srch_str;
|
tmp_srchstr = srch_str;
|
||||||
temp2 = srch_str = (char *) malloc(1 + curr_line->line_length - position);
|
temp2 = srch_str = (unsigned char *) malloc(1 + curr_line->line_length - position);
|
||||||
if ((*point == ' ') || (*point == '\t'))
|
if ((*point == ' ') || (*point == '\t'))
|
||||||
adv_word();
|
adv_word();
|
||||||
offset -= position;
|
offset -= position;
|
||||||
@ -4573,7 +4686,9 @@ Auto_Format() /* format the paragraph according to set margins */
|
|||||||
case_sen = temp_case;
|
case_sen = temp_case;
|
||||||
free(srch_str);
|
free(srch_str);
|
||||||
srch_str = tmp_srchstr;
|
srch_str = tmp_srchstr;
|
||||||
d_char = temp_d_char;
|
d_char[0] = temp_d_char[0];
|
||||||
|
d_char[1] = temp_d_char[1];
|
||||||
|
d_char[2] = temp_d_char[2];
|
||||||
auto_format = TRUE;
|
auto_format = TRUE;
|
||||||
dlt_line->line_length = tmp_d_line_length;
|
dlt_line->line_length = tmp_d_line_length;
|
||||||
d_line = tmp_d_line;
|
d_line = tmp_d_line;
|
||||||
@ -4607,6 +4722,8 @@ modes_op()
|
|||||||
(emacs_keys_mode ? ON : OFF));
|
(emacs_keys_mode ? ON : OFF));
|
||||||
sprintf(modes_menu[8].item_string, "%s %d", mode_strings[8],
|
sprintf(modes_menu[8].item_string, "%s %d", mode_strings[8],
|
||||||
right_margin);
|
right_margin);
|
||||||
|
sprintf(modes_menu[9].item_string, "%s %s", mode_strings[9],
|
||||||
|
(ee_chinese ? ON : OFF));
|
||||||
|
|
||||||
ret_value = menu_op(modes_menu);
|
ret_value = menu_op(modes_menu);
|
||||||
|
|
||||||
@ -4628,6 +4745,15 @@ modes_op()
|
|||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
eightbit = !eightbit;
|
eightbit = !eightbit;
|
||||||
|
if (!eightbit)
|
||||||
|
ee_chinese = FALSE;
|
||||||
|
#ifdef NCURSE
|
||||||
|
if (ee_chinese)
|
||||||
|
nc_setattrib(A_NC_BIG5);
|
||||||
|
else
|
||||||
|
nc_clearattrib(A_NC_BIG5);
|
||||||
|
#endif /* NCURSE */
|
||||||
|
|
||||||
redraw();
|
redraw();
|
||||||
wnoutrefresh(text_win);
|
wnoutrefresh(text_win);
|
||||||
break;
|
break;
|
||||||
@ -4652,6 +4778,18 @@ modes_op()
|
|||||||
free(string);
|
free(string);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 9:
|
||||||
|
ee_chinese = !ee_chinese;
|
||||||
|
if (ee_chinese != FALSE)
|
||||||
|
eightbit = TRUE;
|
||||||
|
#ifdef NCURSE
|
||||||
|
if (ee_chinese)
|
||||||
|
nc_setattrib(A_NC_BIG5);
|
||||||
|
else
|
||||||
|
nc_clearattrib(A_NC_BIG5);
|
||||||
|
#endif /* NCURSE */
|
||||||
|
redraw();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -4958,8 +5096,8 @@ strings_init()
|
|||||||
help_text[17] = catgetlocal( 52, "line : display line # 0-9 : go to line \"#\" ");
|
help_text[17] = catgetlocal( 52, "line : display line # 0-9 : go to line \"#\" ");
|
||||||
help_text[18] = catgetlocal( 53, "expand : expand tabs noexpand: do not expand tabs ");
|
help_text[18] = catgetlocal( 53, "expand : expand tabs noexpand: do not expand tabs ");
|
||||||
help_text[19] = catgetlocal( 54, " ");
|
help_text[19] = catgetlocal( 54, " ");
|
||||||
help_text[20] = catgetlocal( 55, " ee [-i] [-e] [-h] [file(s)] ");
|
help_text[20] = catgetlocal( 55, " ee [+#] [-i] [-e] [-h] [file(s)] ");
|
||||||
help_text[21] = catgetlocal( 56, " -i : no information window -e : do not expand tabs -h : no highlight ");
|
help_text[21] = catgetlocal( 56, "+# :go to line # -i :no info window -e : don't expand tabs -h :no highlight");
|
||||||
control_keys[0] = catgetlocal( 57, "^[ (escape) menu ^e search prompt ^y delete line ^u up ^p prev page ");
|
control_keys[0] = catgetlocal( 57, "^[ (escape) menu ^e search prompt ^y delete line ^u up ^p prev page ");
|
||||||
control_keys[1] = catgetlocal( 58, "^a ascii code ^x search ^z undelete line ^d down ^n next page ");
|
control_keys[1] = catgetlocal( 58, "^a ascii code ^x search ^z undelete line ^d down ^n next page ");
|
||||||
control_keys[2] = catgetlocal( 59, "^b bottom of text ^g begin of line ^w delete word ^l left ");
|
control_keys[2] = catgetlocal( 59, "^b bottom of text ^g begin of line ^w delete word ^l left ");
|
||||||
@ -5084,16 +5222,18 @@ strings_init()
|
|||||||
usage4 = catgetlocal( 161, " +# put cursor at line #\n");
|
usage4 = catgetlocal( 161, " +# put cursor at line #\n");
|
||||||
conf_dump_err_msg = catgetlocal( 162, "unable to open .init.ee for writing, no configuration saved!");
|
conf_dump_err_msg = catgetlocal( 162, "unable to open .init.ee for writing, no configuration saved!");
|
||||||
conf_dump_success_msg = catgetlocal( 163, "ee configuration saved in file %s");
|
conf_dump_success_msg = catgetlocal( 163, "ee configuration saved in file %s");
|
||||||
modes_menu[9].item_string = catgetlocal( 164, "save editor configuration");
|
modes_menu[10].item_string = catgetlocal( 164, "save editor configuration");
|
||||||
config_dump_menu[0].item_string = catgetlocal( 165, "save ee configuration");
|
config_dump_menu[0].item_string = catgetlocal( 165, "save ee configuration");
|
||||||
config_dump_menu[1].item_string = catgetlocal( 166, "save in current directory");
|
config_dump_menu[1].item_string = catgetlocal( 166, "save in current directory");
|
||||||
config_dump_menu[2].item_string = catgetlocal( 167, "save in home directory");
|
config_dump_menu[2].item_string = catgetlocal( 167, "save in home directory");
|
||||||
conf_not_saved_msg = catgetlocal( 168, "ee configuration not saved");
|
conf_not_saved_msg = catgetlocal( 168, "ee configuration not saved");
|
||||||
ree_no_file_msg = catgetlocal( 169, "must specify a file when invoking ree");
|
ree_no_file_msg = catgetlocal( 169, "must specify a file when invoking ree");
|
||||||
cancel_string = catgetlocal( 170, "press Esc to cancel");
|
|
||||||
menu_too_lrg_msg = catgetlocal( 180, "menu too large for window");
|
menu_too_lrg_msg = catgetlocal( 180, "menu too large for window");
|
||||||
more_above_str = catgetlocal( 181, "^^more^^");
|
more_above_str = catgetlocal( 181, "^^more^^");
|
||||||
more_below_str = catgetlocal( 182, "VVmoreVV");
|
more_below_str = catgetlocal( 182, "VVmoreVV");
|
||||||
|
mode_strings[9] = catgetlocal( 183, "16 bit characters ");
|
||||||
|
chinese_cmd = catgetlocal( 184, "16BIT");
|
||||||
|
nochinese_cmd = catgetlocal( 185, "NO16BIT");
|
||||||
|
|
||||||
commands[0] = HELP;
|
commands[0] = HELP;
|
||||||
commands[1] = WRITE;
|
commands[1] = WRITE;
|
||||||
@ -5124,7 +5264,9 @@ strings_init()
|
|||||||
commands[26] = "8";
|
commands[26] = "8";
|
||||||
commands[27] = "9";
|
commands[27] = "9";
|
||||||
commands[28] = CHARACTER;
|
commands[28] = CHARACTER;
|
||||||
commands[29] = NULL;
|
commands[29] = chinese_cmd;
|
||||||
|
commands[30] = nochinese_cmd;
|
||||||
|
commands[31] = NULL;
|
||||||
init_strings[0] = CASE;
|
init_strings[0] = CASE;
|
||||||
init_strings[1] = NOCASE;
|
init_strings[1] = NOCASE;
|
||||||
init_strings[2] = EXPAND;
|
init_strings[2] = EXPAND;
|
||||||
@ -5144,7 +5286,9 @@ strings_init()
|
|||||||
init_strings[16] = NOEIGHTBIT;
|
init_strings[16] = NOEIGHTBIT;
|
||||||
init_strings[17] = EMACS_string;
|
init_strings[17] = EMACS_string;
|
||||||
init_strings[18] = NOEMACS_string;
|
init_strings[18] = NOEMACS_string;
|
||||||
init_strings[19] = NULL;
|
init_strings[19] = chinese_cmd;
|
||||||
|
init_strings[20] = nochinese_cmd;
|
||||||
|
init_strings[21] = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
| allocate space for strings here for settings menu
|
| allocate space for strings here for settings menu
|
||||||
|
@ -95,6 +95,7 @@ WINDOW *last_window_refreshed;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define min(a, b) (a < b ? a : b)
|
#define min(a, b) (a < b ? a : b)
|
||||||
|
#define highbitset(a) ((a) & 0x80)
|
||||||
|
|
||||||
#ifndef CAP
|
#ifndef CAP
|
||||||
#define String_Out(table, stack, place) Info_Out(table, stack, place)
|
#define String_Out(table, stack, place) Info_Out(table, stack, place)
|
||||||
@ -514,6 +515,106 @@ struct KEY_STACK {
|
|||||||
struct KEY_STACK *KEY_TOS = NULL;
|
struct KEY_STACK *KEY_TOS = NULL;
|
||||||
struct KEY_STACK *KEY_POINT;
|
struct KEY_STACK *KEY_POINT;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
|
||||||
|
| Not all systems have good terminal information, so we will define
|
||||||
|
| keyboard information here for the most widely used terminal type,
|
||||||
|
| the VT100.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct KEYS vt100[] =
|
||||||
|
{
|
||||||
|
{ 3, "\033[A", 0403 }, /* key up */
|
||||||
|
{ 3, "\033[C", 0405 }, /* key right */
|
||||||
|
{ 3, "\033[D", 0404 }, /* key left */
|
||||||
|
|
||||||
|
{ 4, "\033[6~", 0522 }, /* key next page */
|
||||||
|
{ 4, "\033[5~", 0523 }, /* key prev page */
|
||||||
|
{ 3, "\033[[", 0550 }, /* key end */
|
||||||
|
{ 3, "\033[@", 0406 }, /* key home */
|
||||||
|
{ 4, "\033[2~", 0513 }, /* key insert char */
|
||||||
|
|
||||||
|
{ 3, "\033[y", 0410 }, /* key F0 */
|
||||||
|
{ 3, "\033[P", 0411 }, /* key F1 */
|
||||||
|
{ 3, "\033[Q", 0412 }, /* key F2 */
|
||||||
|
{ 3, "\033[R", 0413 }, /* key F3 */
|
||||||
|
{ 3, "\033[S", 0414 }, /* key F4 */
|
||||||
|
{ 3, "\033[t", 0415 }, /* key F5 */
|
||||||
|
{ 3, "\033[u", 0416 }, /* key F6 */
|
||||||
|
{ 3, "\033[v", 0417 }, /* key F7 */
|
||||||
|
{ 3, "\033[l", 0420 }, /* key F8 */
|
||||||
|
{ 3, "\033[w", 0421 }, /* key F9 */
|
||||||
|
{ 3, "\033[x", 0422 }, /* key F10 */
|
||||||
|
|
||||||
|
{ 5, "\033[10~", 0410 }, /* key F0 */
|
||||||
|
{ 5, "\033[11~", 0411 }, /* key F1 */
|
||||||
|
{ 5, "\033[12~", 0412 }, /* key F2 */
|
||||||
|
{ 5, "\033[13~", 0413 }, /* key F3 */
|
||||||
|
{ 5, "\033[14~", 0414 }, /* key F4 */
|
||||||
|
{ 5, "\033[15~", 0415 }, /* key F5 */
|
||||||
|
{ 5, "\033[17~", 0416 }, /* key F6 */
|
||||||
|
{ 5, "\033[18~", 0417 }, /* key F7 */
|
||||||
|
{ 5, "\033[19~", 0420 }, /* key F8 */
|
||||||
|
{ 5, "\033[20~", 0421 }, /* key F9 */
|
||||||
|
{ 5, "\033[21~", 0422 }, /* key F10 */
|
||||||
|
{ 5, "\033[23~", 0423 }, /* key F11 */
|
||||||
|
{ 5, "\033[24~", 0424 }, /* key F12 */
|
||||||
|
{ 3, "\033[q", 0534 }, /* ka1 upper-left of keypad */
|
||||||
|
{ 3, "\033[s", 0535 }, /* ka3 upper-right of keypad */
|
||||||
|
{ 3, "\033[r", 0536 }, /* kb2 center of keypad */
|
||||||
|
{ 3, "\033[p", 0537 }, /* kc1 lower-left of keypad */
|
||||||
|
{ 3, "\033[n", 0540 }, /* kc3 lower-right of keypad */
|
||||||
|
|
||||||
|
/*
|
||||||
|
| The following are the same keys as above, but with
|
||||||
|
| a different character following the escape char.
|
||||||
|
*/
|
||||||
|
|
||||||
|
{ 3, "\033OA", 0403 }, /* key up */
|
||||||
|
{ 3, "\033OC", 0405 }, /* key right */
|
||||||
|
{ 3, "\033OD", 0404 }, /* key left */
|
||||||
|
{ 3, "\033OB", 0402 }, /* key down */
|
||||||
|
{ 4, "\033O6~", 0522 }, /* key next page */
|
||||||
|
{ 4, "\033O5~", 0523 }, /* key prev page */
|
||||||
|
{ 3, "\033O[", 0550 }, /* key end */
|
||||||
|
{ 3, "\033O@", 0406 }, /* key home */
|
||||||
|
{ 4, "\033O2~", 0513 }, /* key insert char */
|
||||||
|
|
||||||
|
{ 3, "\033Oy", 0410 }, /* key F0 */
|
||||||
|
{ 3, "\033OP", 0411 }, /* key F1 */
|
||||||
|
{ 3, "\033OQ", 0412 }, /* key F2 */
|
||||||
|
{ 3, "\033OR", 0413 }, /* key F3 */
|
||||||
|
{ 3, "\033OS", 0414 }, /* key F4 */
|
||||||
|
{ 3, "\033Ot", 0415 }, /* key F5 */
|
||||||
|
{ 3, "\033Ou", 0416 }, /* key F6 */
|
||||||
|
{ 3, "\033Ov", 0417 }, /* key F7 */
|
||||||
|
{ 3, "\033Ol", 0420 }, /* key F8 */
|
||||||
|
{ 3, "\033Ow", 0421 }, /* key F9 */
|
||||||
|
{ 3, "\033Ox", 0422 }, /* key F10 */
|
||||||
|
|
||||||
|
{ 5, "\033O10~", 0410 }, /* key F0 */
|
||||||
|
{ 5, "\033O11~", 0411 }, /* key F1 */
|
||||||
|
{ 5, "\033O12~", 0412 }, /* key F2 */
|
||||||
|
{ 5, "\033O13~", 0413 }, /* key F3 */
|
||||||
|
{ 5, "\033O14~", 0414 }, /* key F4 */
|
||||||
|
{ 5, "\033O15~", 0415 }, /* key F5 */
|
||||||
|
{ 5, "\033O17~", 0416 }, /* key F6 */
|
||||||
|
{ 5, "\033O18~", 0417 }, /* key F7 */
|
||||||
|
{ 5, "\033O19~", 0420 }, /* key F8 */
|
||||||
|
{ 5, "\033O20~", 0421 }, /* key F9 */
|
||||||
|
{ 5, "\033O21~", 0422 }, /* key F10 */
|
||||||
|
{ 5, "\033O23~", 0423 }, /* key F11 */
|
||||||
|
{ 5, "\033O24~", 0424 }, /* key F12 */
|
||||||
|
{ 3, "\033Oq", 0534 }, /* ka1 upper-left of keypad */
|
||||||
|
{ 3, "\033Os", 0535 }, /* ka3 upper-right of keypad */
|
||||||
|
{ 3, "\033Or", 0536 }, /* kb2 center of keypad */
|
||||||
|
{ 3, "\033Op", 0537 }, /* kc1 lower-left of keypad */
|
||||||
|
{ 3, "\033On", 0540 }, /* kc3 lower-right of keypad */
|
||||||
|
|
||||||
|
{ 0, "", 0 } /* end */
|
||||||
|
};
|
||||||
|
|
||||||
struct Parameters {
|
struct Parameters {
|
||||||
int value;
|
int value;
|
||||||
struct Parameters *next;
|
struct Parameters *next;
|
||||||
@ -537,6 +638,8 @@ int Key_vals[] = {
|
|||||||
|
|
||||||
int attributes_set[9];
|
int attributes_set[9];
|
||||||
|
|
||||||
|
static int nc_attributes = 0; /* global attributes for new_curse to observe */
|
||||||
|
|
||||||
#ifdef SYS5
|
#ifdef SYS5
|
||||||
struct termio Terminal;
|
struct termio Terminal;
|
||||||
struct termio Saved_tty;
|
struct termio Saved_tty;
|
||||||
@ -814,6 +917,14 @@ printf("starting initscr \n");fflush(stdout);
|
|||||||
Fildes = open(Term_File_name, O_RDONLY);
|
Fildes = open(Term_File_name, O_RDONLY);
|
||||||
}
|
}
|
||||||
if (Fildes == -1)
|
if (Fildes == -1)
|
||||||
|
{
|
||||||
|
TERM_PATH = "/usr/share/terminfo";
|
||||||
|
Data_Line_len = 23 + strlen(TERM_PATH) + strlen(TERMINAL_TYPE);
|
||||||
|
Term_File_name = malloc(Data_Line_len);
|
||||||
|
sprintf(Term_File_name, "%s/%c/%s", TERM_PATH, *TERMINAL_TYPE, TERMINAL_TYPE);
|
||||||
|
Fildes = open(Term_File_name, O_RDONLY);
|
||||||
|
}
|
||||||
|
if (Fildes == -1)
|
||||||
{
|
{
|
||||||
free(Term_File_name);
|
free(Term_File_name);
|
||||||
Term_File_name = NULL;
|
Term_File_name = NULL;
|
||||||
@ -865,6 +976,7 @@ printf("starting initscr \n");fflush(stdout);
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
Key_Get();
|
Key_Get();
|
||||||
|
keys_vt100();
|
||||||
LINES = Numbers[li__];
|
LINES = Numbers[li__];
|
||||||
COLS = Numbers[co__];
|
COLS = Numbers[co__];
|
||||||
if ((lines_string = getenv("LINES")) != NULL)
|
if ((lines_string = getenv("LINES")) != NULL)
|
||||||
@ -1112,6 +1224,32 @@ Key_Get() /* create linked list with all key sequences obtained from terminal d
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
| insert information about keys for a vt100 terminal
|
||||||
|
*/
|
||||||
|
|
||||||
|
void
|
||||||
|
keys_vt100()
|
||||||
|
{
|
||||||
|
int counter;
|
||||||
|
int Klen;
|
||||||
|
struct KEY_STACK *Spoint;
|
||||||
|
|
||||||
|
Spoint = KEY_TOS;
|
||||||
|
while (Spoint->next != NULL)
|
||||||
|
Spoint = Spoint->next;
|
||||||
|
for (counter = 0; vt100[counter].length != 0; counter++)
|
||||||
|
{
|
||||||
|
Spoint->next = (struct KEY_STACK *) malloc(sizeof(struct KEY_STACK));
|
||||||
|
Spoint = Spoint->next;
|
||||||
|
Spoint->next = NULL;
|
||||||
|
Spoint->element = &vt100[counter];
|
||||||
|
Klen = strlen(Spoint->element->string);
|
||||||
|
if (Klen > Max_Key_len)
|
||||||
|
Max_Key_len = Klen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef CAP
|
#ifdef CAP
|
||||||
char *
|
char *
|
||||||
String_Get(param) /* read the string */
|
String_Get(param) /* read the string */
|
||||||
@ -2482,6 +2620,7 @@ int flag;
|
|||||||
Repaint_screen = TRUE;
|
Repaint_screen = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
echo() /* turn on echoing */
|
echo() /* turn on echoing */
|
||||||
{
|
{
|
||||||
@ -2649,7 +2788,6 @@ void
|
|||||||
endwin() /* end windows */
|
endwin() /* end windows */
|
||||||
{
|
{
|
||||||
keypad(stdscr, FALSE);
|
keypad(stdscr, FALSE);
|
||||||
free(stdscr);
|
|
||||||
initialized = FALSE;
|
initialized = FALSE;
|
||||||
delwin(curscr);
|
delwin(curscr);
|
||||||
delwin(virtual_scr);
|
delwin(virtual_scr);
|
||||||
@ -3028,6 +3166,11 @@ struct _line *pointer_new, *pointer_old;
|
|||||||
return(changed);
|
return(changed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
| Check if characters were inserted in the middle of a line, and if
|
||||||
|
| so, insert them.
|
||||||
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
check_insert(window, line, offset, pointer_new, pointer_old)
|
check_insert(window, line, offset, pointer_new, pointer_old)
|
||||||
WINDOW *window;
|
WINDOW *window;
|
||||||
@ -3123,8 +3266,13 @@ doupdate()
|
|||||||
char *att1, *att2;
|
char *att1, *att2;
|
||||||
char *c1, *c2;
|
char *c1, *c2;
|
||||||
|
|
||||||
|
char NC_chinese = FALSE; /* flag to indicate handling Chinese */
|
||||||
|
|
||||||
window = virtual_scr;
|
window = virtual_scr;
|
||||||
|
|
||||||
|
if ((nc_attributes & A_NC_BIG5) != 0)
|
||||||
|
NC_chinese = TRUE;
|
||||||
|
|
||||||
if (Repaint_screen)
|
if (Repaint_screen)
|
||||||
{
|
{
|
||||||
if (String_table[cl__])
|
if (String_table[cl__])
|
||||||
@ -3184,7 +3332,7 @@ doupdate()
|
|||||||
curr = top_of_win;
|
curr = top_of_win;
|
||||||
similar = 0;
|
similar = 0;
|
||||||
/*
|
/*
|
||||||
| if the window has lines that are different
|
| if the window has lines that are different, check for scrolling
|
||||||
*/
|
*/
|
||||||
if (diff)
|
if (diff)
|
||||||
{
|
{
|
||||||
@ -3243,10 +3391,10 @@ doupdate()
|
|||||||
if (String_table[cs__]) /* scrolling region */
|
if (String_table[cs__]) /* scrolling region */
|
||||||
{
|
{
|
||||||
list[1] = 0;
|
list[1] = 0;
|
||||||
list[0] = LINES;
|
list[0] = LINES - 1;
|
||||||
String_Out(String_table[cs__], list, 2);
|
String_Out(String_table[cs__], list, 2);
|
||||||
Curr_y = Curr_x = -1;
|
Curr_y = Curr_x = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
top_of_win = curscr->first_line;
|
top_of_win = curscr->first_line;
|
||||||
curr = top_of_win;
|
curr = top_of_win;
|
||||||
@ -3292,7 +3440,7 @@ doupdate()
|
|||||||
if (String_table[cs__]) /* scrolling region */
|
if (String_table[cs__]) /* scrolling region */
|
||||||
{
|
{
|
||||||
list[1] = 0;
|
list[1] = 0;
|
||||||
list[0] = LINES;
|
list[0] = LINES - 1;
|
||||||
String_Out(String_table[cs__], list, 2);
|
String_Out(String_table[cs__], list, 2);
|
||||||
Curr_y = Curr_x = -1;
|
Curr_y = Curr_x = -1;
|
||||||
}
|
}
|
||||||
@ -3320,12 +3468,28 @@ doupdate()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
| Scrolling done, now need to insert, delete, or modify text
|
||||||
|
| within lines.
|
||||||
|
*/
|
||||||
|
|
||||||
for (from_top = 0, curr = curscr->first_line; from_top < window->SR; from_top++)
|
for (from_top = 0, curr = curscr->first_line; from_top < window->SR; from_top++)
|
||||||
curr = curr->next_screen;
|
curr = curr->next_screen;
|
||||||
top_of_win = curr;
|
top_of_win = curr;
|
||||||
for (from_top = 0, curr = top_of_win, virt = window->first_line; from_top < window->Num_lines; from_top++, curr = curr->next_screen, virt = virt->next_screen)
|
for (from_top = 0, curr = top_of_win, virt = window->first_line; from_top < window->Num_lines; from_top++, curr = curr->next_screen, virt = virt->next_screen)
|
||||||
{
|
{
|
||||||
if (((String_table[ic__]) || (String_table[im__])) && (String_table[dc__]) && (curr->row[0] != (char) NULL))
|
|
||||||
|
/*
|
||||||
|
| If either 'insert mode' or 'insert char' are
|
||||||
|
| available, enter the following 'if' statement,
|
||||||
|
| else, need to simply rewrite the contents of the line
|
||||||
|
| at the point where the contents of the line change.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (((String_table[ic__]) || (String_table[im__])) &&
|
||||||
|
(String_table[dc__]) && (curr->row[0] != (char) NULL) &&
|
||||||
|
(!NC_chinese))
|
||||||
{
|
{
|
||||||
j = 0;
|
j = 0;
|
||||||
first_time = TRUE;
|
first_time = TRUE;
|
||||||
@ -3412,6 +3576,14 @@ doupdate()
|
|||||||
{
|
{
|
||||||
while ((c1[j] == c2[j]) && (att1[j] == att2[j]) && (j < window->Num_cols) && (c2[j] != (char) NULL))
|
while ((c1[j] == c2[j]) && (att1[j] == att2[j]) && (j < window->Num_cols) && (c2[j] != (char) NULL))
|
||||||
j++;
|
j++;
|
||||||
|
|
||||||
|
/*
|
||||||
|
| if previous character is an eight bit
|
||||||
|
| char, start redraw from that character
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ((NC_chinese) && (highbitset(c1[j - 1])))
|
||||||
|
j--;
|
||||||
begin_old = j;
|
begin_old = j;
|
||||||
begin_new = j;
|
begin_new = j;
|
||||||
if ((j < window->Num_cols) && (c2[j] != (char) NULL))
|
if ((j < window->Num_cols) && (c2[j] != (char) NULL))
|
||||||
@ -3572,3 +3744,25 @@ int offset;
|
|||||||
Curr_x++;
|
Curr_x++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
|
||||||
|
| The two routines that follow, nc_setattrib(), nc_clearattrib(), are
|
||||||
|
| hacks that notify new_curse to handle characters that have the high
|
||||||
|
| bit set as the first of two bytes of a multi-byte string.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
void
|
||||||
|
nc_setattrib(flag)
|
||||||
|
int flag;
|
||||||
|
{
|
||||||
|
nc_attributes |= flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
nc_clearattrib(flag)
|
||||||
|
int flag;
|
||||||
|
{
|
||||||
|
nc_attributes &= ~flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -37,6 +37,8 @@
|
|||||||
| Copyright (c) 1986, 1987, 1988, 1991, 1995 Hugh Mahon
|
| Copyright (c) 1986, 1987, 1988, 1991, 1995 Hugh Mahon
|
||||||
| All are rights reserved.
|
| All are rights reserved.
|
||||||
|
|
|
|
||||||
|
| $FreeBSD$
|
||||||
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -142,7 +144,8 @@
|
|||||||
#define TRUE 1
|
#define TRUE 1
|
||||||
#define FALSE 0
|
#define FALSE 0
|
||||||
|
|
||||||
#define A_STANDOUT 0001 /* standout mode */
|
#define A_STANDOUT 0001 /* standout mode */
|
||||||
|
#define A_NC_BIG5 0x0100 /* Handle Chinese Big5 characters */
|
||||||
#define SCROLL 1 /* text has been scrolled */
|
#define SCROLL 1 /* text has been scrolled */
|
||||||
#define CLEAR 2 /* window has been cleared */
|
#define CLEAR 2 /* window has been cleared */
|
||||||
#define CHANGE 3 /* window has been changed */
|
#define CHANGE 3 /* window has been changed */
|
||||||
@ -195,6 +198,7 @@ extern int Get_int P_((void));
|
|||||||
extern int INFO_PARSE P_((void));
|
extern int INFO_PARSE P_((void));
|
||||||
extern int AtoI P_((void));
|
extern int AtoI P_((void));
|
||||||
extern void Key_Get P_((void));
|
extern void Key_Get P_((void));
|
||||||
|
extern void keys_vt100 P_((void));
|
||||||
extern struct _line *Screenalloc P_((int columns));
|
extern struct _line *Screenalloc P_((int columns));
|
||||||
extern WINDOW *newwin P_((int lines, int cols, int start_l, int start_c));
|
extern WINDOW *newwin P_((int lines, int cols, int start_l, int start_c));
|
||||||
extern int Operation P_((int Temp_Stack[], int place));
|
extern int Operation P_((int Temp_Stack[], int place));
|
||||||
@ -251,5 +255,7 @@ extern void attribute_on P_((void));
|
|||||||
extern void attribute_off P_((void));
|
extern void attribute_off P_((void));
|
||||||
extern void Char_out P_((int newc, int newatt, char *line, char *attrib, int offset));
|
extern void Char_out P_((int newc, int newatt, char *line, char *attrib, int offset));
|
||||||
|
|
||||||
|
extern void nc_setattrib P_((int));
|
||||||
|
extern void nc_clearattrib P_((int));
|
||||||
#undef P_
|
#undef P_
|
||||||
|
|
||||||
|
@ -5,15 +5,16 @@ $ For ee patchlevel 3
|
|||||||
$
|
$
|
||||||
$ $FreeBSD$
|
$ $FreeBSD$
|
||||||
$
|
$
|
||||||
|
$
|
||||||
$set 1
|
$set 1
|
||||||
$quote "
|
$quote "
|
||||||
1 "modes menu"
|
1 "modes menu"
|
||||||
2 "tabs to spaces "
|
2 "tabs to spaces "
|
||||||
3 "case sensitive search"
|
3 "case sensitive search"
|
||||||
4 "margins observed "
|
4 "margins observed "
|
||||||
5 "auto-paragraph format"
|
5 "auto-paragraph format"
|
||||||
6 "eightbit characters "
|
6 "eightbit characters "
|
||||||
7 "info window "
|
7 "info window "
|
||||||
8 "right margin "
|
8 "right margin "
|
||||||
9 "leave menu"
|
9 "leave menu"
|
||||||
10 "save changes"
|
10 "save changes"
|
||||||
@ -41,7 +42,7 @@ $quote "
|
|||||||
32 "settings"
|
32 "settings"
|
||||||
33 "search"
|
33 "search"
|
||||||
34 "miscellaneous"
|
34 "miscellaneous"
|
||||||
35 "Control keys: "
|
35 "Control keys: "
|
||||||
36 "^a ascii code ^i tab ^r right "
|
36 "^a ascii code ^i tab ^r right "
|
||||||
37 "^b bottom of text ^j newline ^t top of text "
|
37 "^b bottom of text ^j newline ^t top of text "
|
||||||
38 "^c command ^k delete char ^u up "
|
38 "^c command ^k delete char ^u up "
|
||||||
@ -61,8 +62,8 @@ $quote "
|
|||||||
52 "line : display line # 0-9 : go to line \"#\" "
|
52 "line : display line # 0-9 : go to line \"#\" "
|
||||||
53 "expand : expand tabs noexpand: do not expand tabs "
|
53 "expand : expand tabs noexpand: do not expand tabs "
|
||||||
54 " "
|
54 " "
|
||||||
55 " ee [-i] [-e] [-h] [file(s)] "
|
55 " ee [+#] [-i] [-e] [-h] [file(s)] "
|
||||||
56 " -i : no information window -e : do not expand tabs -h : no highlight "
|
56 "+# :go to line # -i :no info window -e : don't expand tabs -h :no highlight"
|
||||||
57 "^[ (escape) menu ^e search prompt ^y delete line ^u up ^p prev page "
|
57 "^[ (escape) menu ^e search prompt ^y delete line ^u up ^p prev page "
|
||||||
58 "^a ascii code ^x search ^z undelete line ^d down ^n next page "
|
58 "^a ascii code ^x search ^z undelete line ^d down ^n next page "
|
||||||
59 "^b bottom of text ^g begin of line ^w delete word ^l left "
|
59 "^b bottom of text ^g begin of line ^w delete word ^l left "
|
||||||
@ -176,7 +177,9 @@ $quote "
|
|||||||
167 "save in home directory"
|
167 "save in home directory"
|
||||||
168 "ee configuration not saved"
|
168 "ee configuration not saved"
|
||||||
169 "must specify a file when invoking ree"
|
169 "must specify a file when invoking ree"
|
||||||
170 "press Esc to cancel"
|
|
||||||
180 "menu too large for window"
|
180 "menu too large for window"
|
||||||
181 "^^more^^"
|
181 "^^more^^"
|
||||||
182 "VVmoreVV"
|
182 "VVmoreVV"
|
||||||
|
183 "16 bit characters "
|
||||||
|
184 "16BIT"
|
||||||
|
185 "NO16BIT"
|
||||||
|
@ -5,15 +5,16 @@ $ For ee patchlevel 3
|
|||||||
$
|
$
|
||||||
$ $FreeBSD$
|
$ $FreeBSD$
|
||||||
$
|
$
|
||||||
|
$
|
||||||
$set 1
|
$set 1
|
||||||
$quote "
|
$quote "
|
||||||
1 "modes menu"
|
1 "modes menu"
|
||||||
2 "tabs to spaces "
|
2 "tabs to spaces "
|
||||||
3 "case sensitive search"
|
3 "case sensitive search"
|
||||||
4 "margins observed "
|
4 "margins observed "
|
||||||
5 "auto-paragraph format"
|
5 "auto-paragraph format"
|
||||||
6 "eightbit characters "
|
6 "eightbit characters "
|
||||||
7 "info window "
|
7 "info window "
|
||||||
8 "right margin "
|
8 "right margin "
|
||||||
9 "leave menu"
|
9 "leave menu"
|
||||||
10 "save changes"
|
10 "save changes"
|
||||||
@ -41,7 +42,7 @@ $quote "
|
|||||||
32 "settings"
|
32 "settings"
|
||||||
33 "search"
|
33 "search"
|
||||||
34 "miscellaneous"
|
34 "miscellaneous"
|
||||||
35 "Control keys: "
|
35 "Control keys: "
|
||||||
36 "^a ascii code ^i tab ^r right "
|
36 "^a ascii code ^i tab ^r right "
|
||||||
37 "^b bottom of text ^j newline ^t top of text "
|
37 "^b bottom of text ^j newline ^t top of text "
|
||||||
38 "^c command ^k delete char ^u up "
|
38 "^c command ^k delete char ^u up "
|
||||||
@ -61,8 +62,8 @@ $quote "
|
|||||||
52 "line : display line # 0-9 : go to line \"#\" "
|
52 "line : display line # 0-9 : go to line \"#\" "
|
||||||
53 "expand : expand tabs noexpand: do not expand tabs "
|
53 "expand : expand tabs noexpand: do not expand tabs "
|
||||||
54 " "
|
54 " "
|
||||||
55 " ee [-i] [-e] [-h] [file(s)] "
|
55 " ee [+#] [-i] [-e] [-h] [file(s)] "
|
||||||
56 " -i : no information window -e : do not expand tabs -h : no highlight "
|
56 "+# :go to line # -i :no info window -e : don't expand tabs -h :no highlight"
|
||||||
57 "^[ (escape) menu ^e search prompt ^y delete line ^u up ^p prev page "
|
57 "^[ (escape) menu ^e search prompt ^y delete line ^u up ^p prev page "
|
||||||
58 "^a ascii code ^x search ^z undelete line ^d down ^n next page "
|
58 "^a ascii code ^x search ^z undelete line ^d down ^n next page "
|
||||||
59 "^b bottom of text ^g begin of line ^w delete word ^l left "
|
59 "^b bottom of text ^g begin of line ^w delete word ^l left "
|
||||||
@ -176,7 +177,9 @@ $quote "
|
|||||||
167 "save in home directory"
|
167 "save in home directory"
|
||||||
168 "ee configuration not saved"
|
168 "ee configuration not saved"
|
||||||
169 "must specify a file when invoking ree"
|
169 "must specify a file when invoking ree"
|
||||||
170 "press Esc to cancel"
|
|
||||||
180 "menu too large for window"
|
180 "menu too large for window"
|
||||||
181 "^^more^^"
|
181 "^^more^^"
|
||||||
182 "VVmoreVV"
|
182 "VVmoreVV"
|
||||||
|
183 "16 bit characters "
|
||||||
|
184 "16BIT"
|
||||||
|
185 "NO16BIT"
|
||||||
|
Loading…
Reference in New Issue
Block a user