DLR: latest patch
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1221 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
790d362f41
commit
f21cd10a3f
79
ChangeLog
79
ChangeLog
|
@ -3,11 +3,88 @@ CVS Code -
|
||||||
- Translation updates (see po/ChangeLog for details).
|
- Translation updates (see po/ChangeLog for details).
|
||||||
- Upgraded to gettext 0.11.2 (Jordi).
|
- Upgraded to gettext 0.11.2 (Jordi).
|
||||||
Removed intl/ entirely, and a few more tweaks by gettextize.
|
Removed intl/ entirely, and a few more tweaks by gettextize.
|
||||||
|
- i18nized a few strings used in DEBUG mode. (DLR)
|
||||||
|
- Some chars being assigned 0 are now assigned '\0'. (DLR)
|
||||||
|
- Put header files in a more consistent order. (DLR)
|
||||||
|
- Remove some unneeded blank lines and spaces, and make some
|
||||||
|
spacing more consistent. (DLR)
|
||||||
|
- When possible, use iscntrl() to determine whether a character
|
||||||
|
is a control character or not. (DLR)
|
||||||
|
- Miscellaneous typo fixes. (DLR)
|
||||||
|
- files.c:
|
||||||
|
read_file(), read_line():
|
||||||
|
- Rework to properly handle nulls in the input file, fix
|
||||||
|
detection of binary files to properly mark a file as binary if
|
||||||
|
the only binary characters it contains are ASCII 127's, and
|
||||||
|
after reading the last line of a file that doesn't end in a
|
||||||
|
newline, increment totsize. Remove previous kludge to set
|
||||||
|
totsize properly. (DLR)
|
||||||
|
write_file():
|
||||||
|
- Rework to properly handle nulls in the input file. When
|
||||||
|
appending/prepending, don't change the current file's name to
|
||||||
|
the name of the file it's being appended/prepended to. When
|
||||||
|
writing a marked selection to a file, save and restore totsize
|
||||||
|
so it isn't decreased by the size of the selection afterward.
|
||||||
|
(DLR)
|
||||||
|
append_slash_if_dir(), input_tab():
|
||||||
|
- Changed a variable name: lastWasTab -> lastwastab. (DLR)
|
||||||
- global.c:
|
- global.c:
|
||||||
shortcut_init()
|
shortcut_init()
|
||||||
- Rework IFHELP macro (David Benbennick).
|
- Rework IFHELP macro (David Benbennick).
|
||||||
|
- move.c:
|
||||||
|
page_down(), page_up():
|
||||||
|
- Put sanity checks for current_x back in, to avoid rare
|
||||||
|
segfaults (oops). Now, however, they are only called when
|
||||||
|
placewewant is zero instead of being called unconditionally;
|
||||||
|
see changes to winio.c:actual_x_from_start() below. (DLR)
|
||||||
- nanorc.sample:
|
- nanorc.sample:
|
||||||
- Put in much less crappy example regex rules for c-file.
|
- Put in much less crappy example regex rules for c-file.
|
||||||
|
- nano.c:
|
||||||
|
clear_filename():
|
||||||
|
- Remove this function, as it has unneeded functionality, is
|
||||||
|
short enough to be inlined, and is only called in two spots
|
||||||
|
anyway. (DLR)
|
||||||
|
do_int_spell(), do_alt_spell():
|
||||||
|
- Rework to save the marked selection before doing spell checking
|
||||||
|
and restore it afterward. (DLR)
|
||||||
|
main():
|
||||||
|
- Rework to blank out filename manually before doing anything
|
||||||
|
with it, instead of calling clear_filename() in two places.
|
||||||
|
Make startline an int instead of a long, since it's supposed to
|
||||||
|
hold a line number. (DLR)
|
||||||
|
- search.c:
|
||||||
|
findnextstr():
|
||||||
|
- Update the current line at current_x if we don't find a match.
|
||||||
|
(DLR)
|
||||||
|
do_gotopos():
|
||||||
|
- Simplify the sanity check to only put x within the range of the
|
||||||
|
current line; don't call actual_x() anymore. (DLR)
|
||||||
|
- utils.c:
|
||||||
|
- Add sunder() and unsunder(). These functions convert nulls
|
||||||
|
other than the terminating null in strings to newlines and
|
||||||
|
back; they're used to handle null characters in files properly.
|
||||||
|
(DLR)
|
||||||
|
- winio.c:
|
||||||
|
actual_x_from_start():
|
||||||
|
- Overhaul to make cursor placement more like that of Pico: add
|
||||||
|
sanity check for i, and then place i as close to the value of
|
||||||
|
xplus column as possible. This change is most noticeable when
|
||||||
|
moving down through binary files. (DLR)
|
||||||
|
nanogetstr():
|
||||||
|
- After the user presses Enter at the prompt, refresh the edit
|
||||||
|
window in case there's a list of possible filename matches
|
||||||
|
(left over from attempted tab completion) on it. (DLR)
|
||||||
|
update_line():
|
||||||
|
- When marking control characters, make sure the mark moves
|
||||||
|
forward by two characters inctead of one. Rework control
|
||||||
|
character display routine to display newlines within the line
|
||||||
|
(which should never occur under normal circumstances; they will
|
||||||
|
only be there if the line had nulls in it and was unsunder()ed
|
||||||
|
beforehand) as ^@'s. (DLR)
|
||||||
|
do_help():
|
||||||
|
- Add support for the handled keyboard escape sequences in the
|
||||||
|
help menu, as they are needed with some terminals (e.g. xterm
|
||||||
|
with TERM=ansi). (DLR)
|
||||||
- THANKS:
|
- THANKS:
|
||||||
- Completed a bit (Jordi).
|
- Completed a bit (Jordi).
|
||||||
GNU nano 1.1.9 - 05/12/2002
|
GNU nano 1.1.9 - 05/12/2002
|
||||||
|
@ -88,7 +165,7 @@ GNU nano 1.1.9 - 05/12/2002
|
||||||
(David Lawrence Ramsey).
|
(David Lawrence Ramsey).
|
||||||
- winio.c:
|
- winio.c:
|
||||||
edit_add()
|
edit_add()
|
||||||
- Changed some syntax hilight computations for the sake of COLS.
|
- Changed some syntax highlight computations for the sake of COLS.
|
||||||
- Add in the necessary regfree() calls to stop nano from leaking
|
- Add in the necessary regfree() calls to stop nano from leaking
|
||||||
memory like a sieve when using color syntax highlighting :-)
|
memory like a sieve when using color syntax highlighting :-)
|
||||||
botombars(), onekey()
|
botombars(), onekey()
|
||||||
|
|
1
TODO
1
TODO
|
@ -19,7 +19,6 @@ For version 1.4:
|
||||||
- UTF-8 support.
|
- UTF-8 support.
|
||||||
- Undo/Redo key?
|
- Undo/Redo key?
|
||||||
|
|
||||||
|
|
||||||
Old requests:
|
Old requests:
|
||||||
|
|
||||||
For version 1.0:
|
For version 1.0:
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
/* Define this if your curses library has the use_default_colors command */
|
/* Define this if your curses library has the use_default_colors command */
|
||||||
#undef HAVE_USE_DEFAULT_COLORS
|
#undef HAVE_USE_DEFAULT_COLORS
|
||||||
|
|
||||||
/* Define this to have syntax hilighting, requires ENABLE_NANORC too! */
|
/* Define this to have syntax highlighting, requires ENABLE_NANORC too! */
|
||||||
#undef ENABLE_COLOR
|
#undef ENABLE_COLOR
|
||||||
|
|
||||||
/* Define this to enable undoing....something */
|
/* Define this to enable undoing....something */
|
||||||
|
|
6
color.c
6
color.c
|
@ -43,7 +43,7 @@
|
||||||
void color_on(WINDOW *win, int whatever)
|
void color_on(WINDOW *win, int whatever)
|
||||||
{
|
{
|
||||||
/* Temporary fallback, if the color value hasn't been set,
|
/* Temporary fallback, if the color value hasn't been set,
|
||||||
turn on hilighting */
|
turn on highlighting */
|
||||||
if (!colors[whatever - FIRST_COLORNUM].set) {
|
if (!colors[whatever - FIRST_COLORNUM].set) {
|
||||||
wattron(win, A_REVERSE);
|
wattron(win, A_REVERSE);
|
||||||
return;
|
return;
|
||||||
|
@ -78,7 +78,6 @@ void color_off(WINDOW *win, int whatever)
|
||||||
wattroff(win, A_BOLD);
|
wattroff(win, A_BOLD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void colorinit_one(int colortoset, short fg, short bg, int bold)
|
void colorinit_one(int colortoset, short fg, short bg, int bold)
|
||||||
{
|
{
|
||||||
colors[colortoset - FIRST_COLORNUM].fg = fg;
|
colors[colortoset - FIRST_COLORNUM].fg = fg;
|
||||||
|
@ -135,7 +134,7 @@ int do_colorinit(void)
|
||||||
init_pair(i, tmpcolor->fg, tmpcolor->bg);
|
init_pair(i, tmpcolor->fg, tmpcolor->bg);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "Running init_pair with fg = %d and bg = %d\n", tmpcolor->fg, tmpcolor->bg);
|
fprintf(stderr, _("Running init_pair with fg = %d and bg = %d\n"), tmpcolor->fg, tmpcolor->bg);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
tmpcolor->pairnum = i;
|
tmpcolor->pairnum = i;
|
||||||
|
@ -209,4 +208,3 @@ void update_color(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* ENABLE_COLOR */
|
#endif /* ENABLE_COLOR */
|
||||||
|
|
||||||
|
|
4
cut.c
4
cut.c
|
@ -94,7 +94,7 @@ void cut_marked_segment(filestruct * top, int top_x, filestruct * bot,
|
||||||
current_x = top_x;
|
current_x = top_x;
|
||||||
update_cursor();
|
update_cursor();
|
||||||
}
|
}
|
||||||
tmpstr[newsize - 1] = 0;
|
tmpstr[newsize - 1] = '\0';
|
||||||
tmp->data = tmpstr;
|
tmp->data = tmpstr;
|
||||||
add_to_cutbuffer(tmp);
|
add_to_cutbuffer(tmp);
|
||||||
dump_buffer(cutbuffer);
|
dump_buffer(cutbuffer);
|
||||||
|
@ -233,7 +233,7 @@ int do_cut_text(void)
|
||||||
junk = NULL;
|
junk = NULL;
|
||||||
junk = make_new_node(current);
|
junk = make_new_node(current);
|
||||||
junk->data = charalloc(1);
|
junk->data = charalloc(1);
|
||||||
junk->data[0] = 0;
|
junk->data[0] = '\0';
|
||||||
|
|
||||||
add_to_cutbuffer(junk);
|
add_to_cutbuffer(junk);
|
||||||
dump_buffer(cutbuffer);
|
dump_buffer(cutbuffer);
|
||||||
|
|
3
faq.html
3
faq.html
|
@ -342,7 +342,7 @@ install</b>.</font></blockquote>
|
||||||
'gettext' and/or 'gettextdomain'. What can I do about it?</font></h2>
|
'gettext' and/or 'gettextdomain'. What can I do about it?</font></h2>
|
||||||
|
|
||||||
<blockquote><font color="#330000">Try doing a <b>./configure --with-included-gettext</b>
|
<blockquote><font color="#330000">Try doing a <b>./configure --with-included-gettext</b>
|
||||||
and see if that solves your problem. You make need to do a <b>make
|
and see if that solves your problem. You may need to do a <b>make
|
||||||
clean ; make</b> to get it to work fully.</font></blockquote>
|
clean ; make</b> to get it to work fully.</font></blockquote>
|
||||||
|
|
||||||
<h2>
|
<h2>
|
||||||
|
@ -694,6 +694,7 @@ and you should know the answer.</font></blockquote>
|
||||||
<a NAME="8"></a><font color="#330000">8. ChangeLog</font>
|
<a NAME="8"></a><font color="#330000">8. ChangeLog</font>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
<blockquote>2002/05/15 - Typo fix (DLR).</blockquote>
|
||||||
<blockquote>2001/12/26 - Misc. fixes (Aaron S. Hawley, DLR).</blockquote>
|
<blockquote>2001/12/26 - Misc. fixes (Aaron S. Hawley, DLR).</blockquote>
|
||||||
<blockquote>2001/10/02 - Update for Free Translation Project.</blockquote>
|
<blockquote>2001/10/02 - Update for Free Translation Project.</blockquote>
|
||||||
<blockquote>2001/10/02 - Assorted fixes, Debian additions.</blockquote>
|
<blockquote>2001/10/02 - Assorted fixes, Debian additions.</blockquote>
|
||||||
|
|
117
files.c
117
files.c
|
@ -33,7 +33,6 @@
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
|
||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
#include "nano.h"
|
#include "nano.h"
|
||||||
|
|
||||||
|
@ -108,11 +107,15 @@ void new_file(void)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
filestruct *read_line(char *buf, filestruct *prev, int *line1ins)
|
filestruct *read_line(char *buf, filestruct *prev, int *line1ins, int len)
|
||||||
{
|
{
|
||||||
filestruct *fileptr;
|
filestruct *fileptr;
|
||||||
|
|
||||||
fileptr = nmalloc(sizeof(filestruct));
|
fileptr = nmalloc(sizeof(filestruct));
|
||||||
|
|
||||||
|
/* nulls to newlines; len is the string's real length here */
|
||||||
|
unsunder(buf, len);
|
||||||
|
|
||||||
fileptr->data = charalloc(strlen(buf) + 2);
|
fileptr->data = charalloc(strlen(buf) + 2);
|
||||||
strcpy(fileptr->data, buf);
|
strcpy(fileptr->data, buf);
|
||||||
|
|
||||||
|
@ -120,7 +123,7 @@ filestruct *read_line(char *buf, filestruct *prev, int *line1ins)
|
||||||
/* If it's a DOS file (CRLF), and file conversion isn't disabled,
|
/* If it's a DOS file (CRLF), and file conversion isn't disabled,
|
||||||
strip out the CR part */
|
strip out the CR part */
|
||||||
if (!ISSET(NO_CONVERT) && buf[strlen(buf) - 1] == '\r') {
|
if (!ISSET(NO_CONVERT) && buf[strlen(buf) - 1] == '\r') {
|
||||||
fileptr->data[strlen(buf) - 1] = 0;
|
fileptr->data[strlen(buf) - 1] = '\0';
|
||||||
totsize--;
|
totsize--;
|
||||||
|
|
||||||
if (!fileformat)
|
if (!fileformat)
|
||||||
|
@ -158,8 +161,8 @@ filestruct *read_line(char *buf, filestruct *prev, int *line1ins)
|
||||||
|
|
||||||
int read_file(FILE *f, const char *filename, int quiet)
|
int read_file(FILE *f, const char *filename, int quiet)
|
||||||
{
|
{
|
||||||
int num_lines = 0;
|
int num_lines = 0, len = 0;
|
||||||
signed char input; /* current input character */
|
char input; /* current input character */
|
||||||
char *buf;
|
char *buf;
|
||||||
long i = 0, bufx = 128;
|
long i = 0, bufx = 128;
|
||||||
filestruct *fileptr = current, *tmp = NULL;
|
filestruct *fileptr = current, *tmp = NULL;
|
||||||
|
@ -181,28 +184,51 @@ int read_file(FILE *f, const char *filename, int quiet)
|
||||||
while ((input_int = getc(f)) != EOF) {
|
while ((input_int = getc(f)) != EOF) {
|
||||||
input = (char) input_int;
|
input = (char) input_int;
|
||||||
#ifndef NANO_SMALL
|
#ifndef NANO_SMALL
|
||||||
if (!ISSET(NO_CONVERT) && input >= 0 && input <= 31
|
if (!ISSET(NO_CONVERT) && iscntrl((int) input) && input != '\t'
|
||||||
&& input != 127 && input != '\t' && input != '\r'
|
&& input != '\r' && input != '\n') {
|
||||||
&& input != '\n')
|
|
||||||
/* If the file has binary chars in it, don't stupidly
|
/* If the file has binary chars in it, don't stupidly
|
||||||
assume it's a DOS or Mac formatted file! */
|
assume it's a DOS or Mac formatted file! */
|
||||||
SET(NO_CONVERT);
|
SET(NO_CONVERT);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* calculate the total length of the line; it might have nulls in
|
||||||
|
it, so we can't just use strlen() */
|
||||||
|
len++;
|
||||||
|
|
||||||
if (input == '\n') {
|
if (input == '\n') {
|
||||||
fileptr = read_line(buf, fileptr, &line1ins);
|
|
||||||
|
/* don't count the newline in the line length */
|
||||||
|
len--;
|
||||||
|
|
||||||
|
/* read in the line properly */
|
||||||
|
fileptr = read_line(buf, fileptr, &line1ins, len);
|
||||||
|
|
||||||
|
/* reset the line length, in preparation for the next line */
|
||||||
|
len = 0;
|
||||||
|
|
||||||
num_lines++;
|
num_lines++;
|
||||||
buf[0] = 0;
|
buf[0] = '\0';
|
||||||
i = 0;
|
i = 0;
|
||||||
#ifndef NANO_SMALL
|
#ifndef NANO_SMALL
|
||||||
/* If it's a Mac file (no LF just a CR), and file conversion
|
/* If it's a Mac file (no LF just a CR), and file conversion
|
||||||
isn't disabled, handle it! */
|
isn't disabled, handle it! */
|
||||||
} else if (!ISSET(NO_CONVERT) && i > 0 && buf[i-1] == '\r') {
|
} else if (!ISSET(NO_CONVERT) && i > 0 && buf[i - 1] == '\r') {
|
||||||
fileformat = 2;
|
fileformat = 2;
|
||||||
fileptr = read_line(buf, fileptr, &line1ins);
|
|
||||||
|
/* don't count the newline in the line length */
|
||||||
|
len--;
|
||||||
|
|
||||||
|
/* read in the line properly */
|
||||||
|
fileptr = read_line(buf, fileptr, &line1ins, len);
|
||||||
|
|
||||||
|
/* reset the line length, in preparation for the next line */
|
||||||
|
len = 0;
|
||||||
|
|
||||||
num_lines++;
|
num_lines++;
|
||||||
|
totsize++;
|
||||||
buf[0] = input;
|
buf[0] = input;
|
||||||
buf[1] = 0;
|
buf[1] = '\0';
|
||||||
i = 1;
|
i = 1;
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
@ -216,7 +242,7 @@ int read_file(FILE *f, const char *filename, int quiet)
|
||||||
bufx += 128;
|
bufx += 128;
|
||||||
}
|
}
|
||||||
buf[i] = input;
|
buf[i] = input;
|
||||||
buf[i + 1] = 0;
|
buf[i + 1] = '\0';
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
totsize++;
|
totsize++;
|
||||||
|
@ -229,10 +255,14 @@ int read_file(FILE *f, const char *filename, int quiet)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Did we not get a newline but still have stuff to do? */
|
/* Did we not get a newline but still have stuff to do? */
|
||||||
if (buf[0]) {
|
if (len > 0) {
|
||||||
fileptr = read_line(buf, fileptr, &line1ins);
|
|
||||||
|
/* read in the LAST line properly */
|
||||||
|
fileptr = read_line(buf, fileptr, &line1ins, len);
|
||||||
|
|
||||||
num_lines++;
|
num_lines++;
|
||||||
buf[0] = 0;
|
totsize++;
|
||||||
|
buf[0] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Did we even GET a file if we don't already have one? */
|
/* Did we even GET a file if we don't already have one? */
|
||||||
|
@ -450,13 +480,6 @@ int do_insertfile(int loading_file)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Here is a kludge. If the current file is blank (including
|
|
||||||
* after new_file()), then totlines==1 and totsize==0. Thus
|
|
||||||
* after open_pipe() or open_file() below, the totsize is short
|
|
||||||
* by one. */
|
|
||||||
if (totlines==1 && totsize==0)
|
|
||||||
totsize++;
|
|
||||||
|
|
||||||
#ifndef NANO_SMALL
|
#ifndef NANO_SMALL
|
||||||
if (i == NANO_EXTCMD_KEY) {
|
if (i == NANO_EXTCMD_KEY) {
|
||||||
i = open_pipe(answer);
|
i = open_pipe(answer);
|
||||||
|
@ -1212,7 +1235,7 @@ int check_operating_dir(char *currpath, int allow_tabcomp)
|
||||||
* append == 2 means we are prepending instead of overwriting.
|
* append == 2 means we are prepending instead of overwriting.
|
||||||
*
|
*
|
||||||
* nonamechange means don't change the current filename, it is ignored
|
* nonamechange means don't change the current filename, it is ignored
|
||||||
* if tmp == 1.
|
* if tmp == 1 or if we're appending/prepending.
|
||||||
*/
|
*/
|
||||||
int write_file(char *name, int tmp, int append, int nonamechange)
|
int write_file(char *name, int tmp, int append, int nonamechange)
|
||||||
{
|
{
|
||||||
|
@ -1312,7 +1335,7 @@ int write_file(char *name, int tmp, int append, int nonamechange)
|
||||||
|
|
||||||
dump_buffer(fileage);
|
dump_buffer(fileage);
|
||||||
|
|
||||||
f = fdopen(fd, append==1 ? "ab" : "wb");
|
f = fdopen(fd, append == 1 ? "ab" : "wb");
|
||||||
if (!f) {
|
if (!f) {
|
||||||
statusbar(_("Could not open file for writing: %s"),
|
statusbar(_("Could not open file for writing: %s"),
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
|
@ -1326,7 +1349,15 @@ int write_file(char *name, int tmp, int append, int nonamechange)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
data_len = strlen(fileptr->data);
|
data_len = strlen(fileptr->data);
|
||||||
|
|
||||||
|
/* newlines to nulls, just before we write to disk */
|
||||||
|
sunder(fileptr->data);
|
||||||
|
|
||||||
size = fwrite(fileptr->data, 1, data_len, f);
|
size = fwrite(fileptr->data, 1, data_len, f);
|
||||||
|
|
||||||
|
/* nulls to newlines; data_len is the string's real length here */
|
||||||
|
unsunder(fileptr->data, data_len);
|
||||||
|
|
||||||
if (size < data_len) {
|
if (size < data_len) {
|
||||||
statusbar(_("Could not open file for writing: %s"),
|
statusbar(_("Could not open file for writing: %s"),
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
|
@ -1354,7 +1385,15 @@ int write_file(char *name, int tmp, int append, int nonamechange)
|
||||||
int data_len;
|
int data_len;
|
||||||
|
|
||||||
data_len = strlen(fileptr->data);
|
data_len = strlen(fileptr->data);
|
||||||
|
|
||||||
|
/* newlines to nulls, just before we write to disk */
|
||||||
|
sunder(fileptr->data);
|
||||||
|
|
||||||
size = fwrite(fileptr->data, 1, data_len, f);
|
size = fwrite(fileptr->data, 1, data_len, f);
|
||||||
|
|
||||||
|
/* nulls to newlines; data_len is the string's real length here */
|
||||||
|
unsunder(fileptr->data, data_len);
|
||||||
|
|
||||||
if (size < data_len) {
|
if (size < data_len) {
|
||||||
statusbar(_("Could not open file for writing: %s"),
|
statusbar(_("Could not open file for writing: %s"),
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
|
@ -1486,7 +1525,7 @@ int write_file(char *name, int tmp, int append, int nonamechange)
|
||||||
statusbar(_("Could not set permissions %o on %s: %s"),
|
statusbar(_("Could not set permissions %o on %s: %s"),
|
||||||
mask, realname, strerror(errno));
|
mask, realname, strerror(errno));
|
||||||
|
|
||||||
if (!tmp) {
|
if (!tmp && !append) {
|
||||||
if (!nonamechange)
|
if (!nonamechange)
|
||||||
filename = mallocstrcpy(filename, realname);
|
filename = mallocstrcpy(filename, realname);
|
||||||
|
|
||||||
|
@ -1589,9 +1628,9 @@ int do_writeout(char *path, int exiting, int append)
|
||||||
TOGGLE(MAC_FILE);
|
TOGGLE(MAC_FILE);
|
||||||
return(do_writeout(answer, exiting, append));
|
return(do_writeout(answer, exiting, append));
|
||||||
} else if (i == NANO_PREPEND_KEY)
|
} else if (i == NANO_PREPEND_KEY)
|
||||||
return(do_writeout(answer, exiting, append==2 ? 0 : 2));
|
return(do_writeout(answer, exiting, append == 2 ? 0 : 2));
|
||||||
else if (i == NANO_APPEND_KEY)
|
else if (i == NANO_APPEND_KEY)
|
||||||
return(do_writeout(answer, exiting, append==1 ? 0 : 1));
|
return(do_writeout(answer, exiting, append == 1 ? 0 : 1));
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, _("filename is %s"), answer);
|
fprintf(stderr, _("filename is %s"), answer);
|
||||||
|
@ -1622,6 +1661,7 @@ int do_writeout(char *path, int exiting, int append)
|
||||||
filestruct *fileagebak = fileage;
|
filestruct *fileagebak = fileage;
|
||||||
filestruct *filebotbak = filebot;
|
filestruct *filebotbak = filebot;
|
||||||
filestruct *cutback = cutbuffer;
|
filestruct *cutback = cutbuffer;
|
||||||
|
long totsizebak = totsize;
|
||||||
int oldmod = 0;
|
int oldmod = 0;
|
||||||
cutbuffer = NULL;
|
cutbuffer = NULL;
|
||||||
|
|
||||||
|
@ -1648,6 +1688,7 @@ int do_writeout(char *path, int exiting, int append)
|
||||||
fileage = fileagebak;
|
fileage = fileagebak;
|
||||||
filebot = filebotbak;
|
filebot = filebotbak;
|
||||||
cutbuffer = cutback;
|
cutbuffer = cutback;
|
||||||
|
totsize = totsizebak;
|
||||||
if (oldmod)
|
if (oldmod)
|
||||||
set_modified();
|
set_modified();
|
||||||
} else
|
} else
|
||||||
|
@ -1708,7 +1749,7 @@ char *real_dir_from_tilde(char *buf)
|
||||||
;
|
;
|
||||||
|
|
||||||
find_user = mallocstrcpy(find_user, &buf[1]);
|
find_user = mallocstrcpy(find_user, &buf[1]);
|
||||||
find_user[i - 1] = 0;
|
find_user[i - 1] = '\0';
|
||||||
|
|
||||||
for (userdata = getpwent(); userdata != NULL &&
|
for (userdata = getpwent(); userdata != NULL &&
|
||||||
strcmp(userdata->pw_name, find_user);
|
strcmp(userdata->pw_name, find_user);
|
||||||
|
@ -1732,7 +1773,7 @@ char *real_dir_from_tilde(char *buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tack a slash onto the string we're completing if it's a directory */
|
/* Tack a slash onto the string we're completing if it's a directory */
|
||||||
int append_slash_if_dir(char *buf, int *lastWasTab, int *place)
|
int append_slash_if_dir(char *buf, int *lastwastab, int *place)
|
||||||
{
|
{
|
||||||
char *dirptr;
|
char *dirptr;
|
||||||
struct stat fileinfo;
|
struct stat fileinfo;
|
||||||
|
@ -1746,7 +1787,7 @@ int append_slash_if_dir(char *buf, int *lastWasTab, int *place)
|
||||||
strncat(buf, "/", 1);
|
strncat(buf, "/", 1);
|
||||||
*place += 1;
|
*place += 1;
|
||||||
/* now we start over again with # of tabs so far */
|
/* now we start over again with # of tabs so far */
|
||||||
*lastWasTab = 0;
|
*lastwastab = 0;
|
||||||
ret = 1;
|
ret = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1844,7 +1885,7 @@ char **cwd_tab_completion(char *buf, int *num_matches)
|
||||||
tmp++;
|
tmp++;
|
||||||
|
|
||||||
strncpy(dirName, buf, tmp - buf + 1);
|
strncpy(dirName, buf, tmp - buf + 1);
|
||||||
dirName[tmp - buf] = 0;
|
dirName[tmp - buf] = '\0';
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -1933,7 +1974,7 @@ char **cwd_tab_completion(char *buf, int *num_matches)
|
||||||
/* This function now has an arg which refers to how much the
|
/* This function now has an arg which refers to how much the
|
||||||
* statusbar (place) should be advanced, i.e. the new cursor pos.
|
* statusbar (place) should be advanced, i.e. the new cursor pos.
|
||||||
*/
|
*/
|
||||||
char *input_tab(char *buf, int place, int *lastWasTab, int *newplace, int *list)
|
char *input_tab(char *buf, int place, int *lastwastab, int *newplace, int *list)
|
||||||
{
|
{
|
||||||
/* Do TAB completion */
|
/* Do TAB completion */
|
||||||
static int num_matches = 0, match_matches = 0;
|
static int num_matches = 0, match_matches = 0;
|
||||||
|
@ -1944,10 +1985,10 @@ char *input_tab(char *buf, int place, int *lastWasTab, int *newplace, int *list)
|
||||||
|
|
||||||
*list = 0;
|
*list = 0;
|
||||||
|
|
||||||
if (*lastWasTab == FALSE) {
|
if (*lastwastab == FALSE) {
|
||||||
char *tmp, *copyto, *matchBuf;
|
char *tmp, *copyto, *matchBuf;
|
||||||
|
|
||||||
*lastWasTab = 1;
|
*lastwastab = 1;
|
||||||
|
|
||||||
/* Make a local copy of the string -- up to the position of the
|
/* Make a local copy of the string -- up to the position of the
|
||||||
cursor */
|
cursor */
|
||||||
|
@ -2006,7 +2047,7 @@ char *input_tab(char *buf, int place, int *lastWasTab, int *newplace, int *list)
|
||||||
tmp = buf;
|
tmp = buf;
|
||||||
|
|
||||||
if (!strcmp(tmp, matches[0]))
|
if (!strcmp(tmp, matches[0]))
|
||||||
is_dir = append_slash_if_dir(buf, lastWasTab, newplace);
|
is_dir = append_slash_if_dir(buf, lastwastab, newplace);
|
||||||
|
|
||||||
if (is_dir)
|
if (is_dir)
|
||||||
break;
|
break;
|
||||||
|
@ -2028,7 +2069,7 @@ char *input_tab(char *buf, int place, int *lastWasTab, int *newplace, int *list)
|
||||||
*newplace = 0;
|
*newplace = 0;
|
||||||
|
|
||||||
/* Is it a directory? */
|
/* Is it a directory? */
|
||||||
append_slash_if_dir(buf, lastWasTab, newplace);
|
append_slash_if_dir(buf, lastwastab, newplace);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
2
global.c
2
global.c
|
@ -23,8 +23,8 @@
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include "nano.h"
|
|
||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
|
#include "nano.h"
|
||||||
|
|
||||||
#ifdef ENABLE_NLS
|
#ifdef ENABLE_NLS
|
||||||
#include <libintl.h>
|
#include <libintl.h>
|
||||||
|
|
7
move.c
7
move.c
|
@ -112,9 +112,10 @@ int do_down(void)
|
||||||
{
|
{
|
||||||
wrap_reset();
|
wrap_reset();
|
||||||
if (current->next != NULL) {
|
if (current->next != NULL) {
|
||||||
update_line(current->prev, 0);
|
|
||||||
if (placewewant > 0)
|
if (placewewant > 0)
|
||||||
current_x = actual_x(current->next, placewewant);
|
current_x = actual_x(current->next, placewewant);
|
||||||
|
else if (current_x > strlen(current->next->data))
|
||||||
|
current_x = strlen(current->next->data);
|
||||||
} else {
|
} else {
|
||||||
UNSET(KEEP_CUTBUFFER);
|
UNSET(KEEP_CUTBUFFER);
|
||||||
check_statblank();
|
check_statblank();
|
||||||
|
@ -155,7 +156,6 @@ void page_up(void)
|
||||||
current_y = 0;
|
current_y = 0;
|
||||||
|
|
||||||
update_cursor();
|
update_cursor();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int do_page_up(void)
|
int do_page_up(void)
|
||||||
|
@ -182,13 +182,14 @@ int do_page_up(void)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int do_up(void)
|
int do_up(void)
|
||||||
{
|
{
|
||||||
wrap_reset();
|
wrap_reset();
|
||||||
if (current->prev != NULL) {
|
if (current->prev != NULL) {
|
||||||
if (placewewant > 0)
|
if (placewewant > 0)
|
||||||
current_x = actual_x(current->prev, placewewant);
|
current_x = actual_x(current->prev, placewewant);
|
||||||
|
else if (current_x > strlen(current->prev->data))
|
||||||
|
current_x = strlen(current->prev->data);
|
||||||
}
|
}
|
||||||
if (current_y > 0)
|
if (current_y > 0)
|
||||||
current_y--;
|
current_y--;
|
||||||
|
|
2
nano.1
2
nano.1
|
@ -66,7 +66,7 @@ Set the size (width) of a tab.
|
||||||
Show the current version number and author.
|
Show the current version number and author.
|
||||||
.TP
|
.TP
|
||||||
.B \-Y (\-\-syntax=[str])
|
.B \-Y (\-\-syntax=[str])
|
||||||
Specify a specific syntax hilighting from the .nanorc to use (if available).
|
Specify a specific syntax highlighting from the .nanorc to use (if available).
|
||||||
.TP
|
.TP
|
||||||
.B \-c (\-\-const)
|
.B \-c (\-\-const)
|
||||||
Constantly show the cursor position.
|
Constantly show the cursor position.
|
||||||
|
|
|
@ -91,7 +91,7 @@ Show the current version number and author.
|
||||||
<DT><B>-Y (--syntax=[str])</B>
|
<DT><B>-Y (--syntax=[str])</B>
|
||||||
|
|
||||||
<DD>
|
<DD>
|
||||||
Specify a specific syntax hilighting from the .nanorc to use (if available).
|
Specify a specific syntax highlighting from the .nanorc to use (if available).
|
||||||
<DT><B>-c (--const)</B>
|
<DT><B>-c (--const)</B>
|
||||||
|
|
||||||
<DD>
|
<DD>
|
||||||
|
|
76
nano.c
76
nano.c
|
@ -39,7 +39,6 @@
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
#include "nano.h"
|
#include "nano.h"
|
||||||
|
|
||||||
|
@ -213,14 +212,6 @@ void print_view_warning(void)
|
||||||
statusbar(_("Key illegal in VIEW mode"));
|
statusbar(_("Key illegal in VIEW mode"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear_filename(void)
|
|
||||||
{
|
|
||||||
if (filename != NULL)
|
|
||||||
free(filename);
|
|
||||||
filename = charalloc(1);
|
|
||||||
filename[0] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Initialize global variables - no better way for now. If
|
/* Initialize global variables - no better way for now. If
|
||||||
save_cutbuffer is nonzero, don't set cutbuffer to NULL. */
|
save_cutbuffer is nonzero, don't set cutbuffer to NULL. */
|
||||||
void global_init(int save_cutbuffer)
|
void global_init(int save_cutbuffer)
|
||||||
|
@ -253,7 +244,7 @@ void global_init(int save_cutbuffer)
|
||||||
|
|
||||||
hblank = charalloc(COLS + 1);
|
hblank = charalloc(COLS + 1);
|
||||||
memset(hblank, ' ', COLS);
|
memset(hblank, ' ', COLS);
|
||||||
hblank[COLS] = 0;
|
hblank[COLS] = '\0';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -468,7 +459,7 @@ void null_at(char **data, int index)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Ahh! Damn dereferencing */
|
/* Ahh! Damn dereferencing */
|
||||||
(*data)[index] = 0;
|
(*data)[index] = '\0';
|
||||||
align(data);
|
align(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1367,6 +1358,9 @@ int do_int_spell_fix(char *word)
|
||||||
char *prevanswer = NULL, *save_search = NULL, *save_replace = NULL;
|
char *prevanswer = NULL, *save_search = NULL, *save_replace = NULL;
|
||||||
filestruct *begin;
|
filestruct *begin;
|
||||||
int i = 0, j = 0, beginx, beginx_top, reverse_search_set;
|
int i = 0, j = 0, beginx, beginx_top, reverse_search_set;
|
||||||
|
#ifndef NANO_SMALL
|
||||||
|
int mark_set;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* save where we are */
|
/* save where we are */
|
||||||
begin = current;
|
begin = current;
|
||||||
|
@ -1376,6 +1370,12 @@ int do_int_spell_fix(char *word)
|
||||||
reverse_search_set = ISSET(REVERSE_SEARCH);
|
reverse_search_set = ISSET(REVERSE_SEARCH);
|
||||||
UNSET(REVERSE_SEARCH);
|
UNSET(REVERSE_SEARCH);
|
||||||
|
|
||||||
|
#ifndef NANO_SMALL
|
||||||
|
/* Make sure the marking highlight is off during Spell Check */
|
||||||
|
mark_set = ISSET(MARK_ISSET);
|
||||||
|
UNSET(MARK_ISSET);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* save the current search/replace strings */
|
/* save the current search/replace strings */
|
||||||
search_init_globals();
|
search_init_globals();
|
||||||
save_search = mallocstrcpy(save_search, last_search);
|
save_search = mallocstrcpy(save_search, last_search);
|
||||||
|
@ -1438,6 +1438,12 @@ int do_int_spell_fix(char *word)
|
||||||
if (reverse_search_set)
|
if (reverse_search_set)
|
||||||
SET(REVERSE_SEARCH);
|
SET(REVERSE_SEARCH);
|
||||||
|
|
||||||
|
#ifndef NANO_SMALL
|
||||||
|
/* restore marking highlight */
|
||||||
|
if (mark_set)
|
||||||
|
SET(MARK_ISSET);
|
||||||
|
#endif
|
||||||
|
|
||||||
edit_update(current, CENTER);
|
edit_update(current, CENTER);
|
||||||
|
|
||||||
if (i == -1)
|
if (i == -1)
|
||||||
|
@ -1451,8 +1457,7 @@ int do_int_speller(char *tempfile_name)
|
||||||
{
|
{
|
||||||
char *read_buff, *read_buff_ptr, *read_buff_word;
|
char *read_buff, *read_buff_ptr, *read_buff_word;
|
||||||
size_t pipe_buff_size, read_buff_size, read_buff_read, bytesread;
|
size_t pipe_buff_size, read_buff_size, read_buff_read, bytesread;
|
||||||
int in_fd[2], tempfile_fd;
|
int in_fd[2], tempfile_fd, spell_status;
|
||||||
int spell_status;
|
|
||||||
pid_t pid_spell;
|
pid_t pid_spell;
|
||||||
|
|
||||||
/* Create a pipe to spell program */
|
/* Create a pipe to spell program */
|
||||||
|
@ -1583,12 +1588,25 @@ int do_alt_speller(char *file_name)
|
||||||
{
|
{
|
||||||
int alt_spell_status, lineno_cur = current->lineno;
|
int alt_spell_status, lineno_cur = current->lineno;
|
||||||
int x_cur = current_x, y_cur = current_y, pww_cur = placewewant;
|
int x_cur = current_x, y_cur = current_y, pww_cur = placewewant;
|
||||||
|
#ifndef NANO_SMALL
|
||||||
|
int mark_set = 0, mbb_lineno_cur, mbx_cur;
|
||||||
|
#endif
|
||||||
|
|
||||||
pid_t pid_spell;
|
pid_t pid_spell;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
static int arglen = 3;
|
static int arglen = 3;
|
||||||
static char **spellargs = (char **) NULL;
|
static char **spellargs = (char **) NULL;
|
||||||
|
|
||||||
|
#ifndef NANO_SMALL
|
||||||
|
mark_set = ISSET(MARK_ISSET);
|
||||||
|
if (mark_set) {
|
||||||
|
/* Save the marking position */
|
||||||
|
mbb_lineno_cur = mark_beginbuf->lineno;
|
||||||
|
mbx_cur = mark_beginx;
|
||||||
|
UNSET(MARK_ISSET);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
endwin();
|
endwin();
|
||||||
|
|
||||||
/* Set up an argument list to pass the execvp function */
|
/* Set up an argument list to pass the execvp function */
|
||||||
|
@ -1635,6 +1653,15 @@ int do_alt_speller(char *file_name)
|
||||||
global_init(1);
|
global_init(1);
|
||||||
open_file(file_name, 0, 1);
|
open_file(file_name, 0, 1);
|
||||||
|
|
||||||
|
#ifndef NANO_SMALL
|
||||||
|
if (mark_set) {
|
||||||
|
/* Restore the marking position */
|
||||||
|
do_gotopos(mbb_lineno_cur, mbx_cur, y_cur, 0);
|
||||||
|
mark_beginbuf = current;
|
||||||
|
SET(MARK_ISSET);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* go back to the old position, mark the file as modified, and make
|
/* go back to the old position, mark the file as modified, and make
|
||||||
sure that the titlebar is refreshed */
|
sure that the titlebar is refreshed */
|
||||||
do_gotopos(lineno_cur, x_cur, y_cur, pww_cur);
|
do_gotopos(lineno_cur, x_cur, y_cur, pww_cur);
|
||||||
|
@ -2043,7 +2070,7 @@ void handle_sigwinch(int s)
|
||||||
|
|
||||||
hblank = nrealloc(hblank, COLS + 1);
|
hblank = nrealloc(hblank, COLS + 1);
|
||||||
memset(hblank, ' ', COLS);
|
memset(hblank, ' ', COLS);
|
||||||
hblank[COLS] = 0;
|
hblank[COLS] = '\0';
|
||||||
|
|
||||||
#ifdef HAVE_RESIZETERM
|
#ifdef HAVE_RESIZETERM
|
||||||
resizeterm(LINES, COLS);
|
resizeterm(LINES, COLS);
|
||||||
|
@ -2788,7 +2815,7 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int optchr;
|
int optchr;
|
||||||
int kbinput; /* Input from keyboard */
|
int kbinput; /* Input from keyboard */
|
||||||
long startline = 0; /* Line to try and start at */
|
int startline = 0; /* Line to try and start at */
|
||||||
int keyhandled; /* Have we handled the keystroke yet? */
|
int keyhandled; /* Have we handled the keystroke yet? */
|
||||||
int modify_control_seq;
|
int modify_control_seq;
|
||||||
char *argv0;
|
char *argv0;
|
||||||
|
@ -3022,6 +3049,11 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Clear the filename we'll be using */
|
||||||
|
filename = charalloc(1);
|
||||||
|
filename[0] = '\0';
|
||||||
|
|
||||||
|
/* See if we were invoked with the name "pico" */
|
||||||
argv0 = strrchr(argv[0], '/');
|
argv0 = strrchr(argv[0], '/');
|
||||||
if ((argv0 && strstr(argv0, "pico"))
|
if ((argv0 && strstr(argv0, "pico"))
|
||||||
|| (!argv0 && strstr(argv[0], "pico")))
|
|| (!argv0 && strstr(argv[0], "pico")))
|
||||||
|
@ -3029,23 +3061,17 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
/* See if there's a non-option in argv (first non-option is the
|
/* See if there's a non-option in argv (first non-option is the
|
||||||
filename, if +LINE is not given) */
|
filename, if +LINE is not given) */
|
||||||
if (argc == 1 || argc <= optind)
|
if (argc > 1 && argc > optind) {
|
||||||
clear_filename();
|
|
||||||
else {
|
|
||||||
/* Look for the +line flag... */
|
/* Look for the +line flag... */
|
||||||
if (argv[optind][0] == '+') {
|
if (argv[optind][0] == '+') {
|
||||||
startline = atoi(&argv[optind][1]);
|
startline = atoi(&argv[optind][1]);
|
||||||
optind++;
|
optind++;
|
||||||
if (argc == 1 || argc <= optind)
|
if (argc > 1 && argc > optind)
|
||||||
clear_filename();
|
|
||||||
else
|
|
||||||
filename = mallocstrcpy(filename, argv[optind]);
|
filename = mallocstrcpy(filename, argv[optind]);
|
||||||
|
|
||||||
} else
|
} else
|
||||||
filename = mallocstrcpy(filename, argv[optind]);
|
filename = mallocstrcpy(filename, argv[optind]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* First back up the old settings so they can be restored, duh */
|
/* First back up the old settings so they can be restored, duh */
|
||||||
tcgetattr(0, &oldterm);
|
tcgetattr(0, &oldterm);
|
||||||
|
|
||||||
|
@ -3138,7 +3164,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
kbinput = wgetch(edit);
|
kbinput = wgetch(edit);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "AHA! %c (%d)\n", kbinput, kbinput);
|
fprintf(stderr, _("AHA! %c (%d)\n"), kbinput, kbinput);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (kbinput == 27) { /* Grab Alt-key stuff first */
|
if (kbinput == 27) { /* Grab Alt-key stuff first */
|
||||||
|
@ -3421,7 +3447,7 @@ int main(int argc, char *argv[])
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "I got %c (%d)!\n", kbinput, kbinput);
|
fprintf(stderr, _("I got %c (%d)!\n"), kbinput, kbinput);
|
||||||
#endif
|
#endif
|
||||||
/* We no longer stop unhandled sequences so that people with
|
/* We no longer stop unhandled sequences so that people with
|
||||||
odd character sets can type... */
|
odd character sets can type... */
|
||||||
|
|
|
@ -105,4 +105,3 @@
|
||||||
#
|
#
|
||||||
# syntax "mutt"
|
# syntax "mutt"
|
||||||
# color green "^>.*"
|
# color green "^>.*"
|
||||||
|
|
||||||
|
|
4
proto.h
4
proto.h
|
@ -171,10 +171,12 @@ int do_left(void);
|
||||||
int do_right(void);
|
int do_right(void);
|
||||||
int check_wildcard_match(const char *text, const char *pattern);
|
int check_wildcard_match(const char *text, const char *pattern);
|
||||||
|
|
||||||
char *input_tab(char *buf, int place, int *lastWasTab, int *newplace, int *list);
|
char *input_tab(char *buf, int place, int *lastwastab, int *newplace, int *list);
|
||||||
char *real_dir_from_tilde(char *buf);
|
char *real_dir_from_tilde(char *buf);
|
||||||
|
|
||||||
void signal_init(void);
|
void signal_init(void);
|
||||||
|
void unsunder(char *str, int true_len);
|
||||||
|
void sunder(char *str);
|
||||||
void lowercase(char *src);
|
void lowercase(char *src);
|
||||||
void blank_bottombars(void);
|
void blank_bottombars(void);
|
||||||
void check_wrap(filestruct * inptr);
|
void check_wrap(filestruct * inptr);
|
||||||
|
|
14
rcfile.c
14
rcfile.c
|
@ -221,7 +221,7 @@ void parse_syntax(FILE * rcstream, char *buf, char *ptr)
|
||||||
tmpsyntax = syntaxes;
|
tmpsyntax = syntaxes;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Starting a new syntax type\n");
|
_("Starting a new syntax type\n"));
|
||||||
fprintf(stderr, "string val=%s\n", nameptr);
|
fprintf(stderr, "string val=%s\n", nameptr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -229,7 +229,7 @@ void parse_syntax(FILE * rcstream, char *buf, char *ptr)
|
||||||
for (tmpsyntax = syntaxes;
|
for (tmpsyntax = syntaxes;
|
||||||
tmpsyntax->next != NULL; tmpsyntax = tmpsyntax->next);
|
tmpsyntax->next != NULL; tmpsyntax = tmpsyntax->next);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "Adding new syntax after 1st\n");
|
fprintf(stderr, _("Adding new syntax after 1st\n"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
tmpsyntax->next = nmalloc(sizeof(syntaxtype));
|
tmpsyntax->next = nmalloc(sizeof(syntaxtype));
|
||||||
|
@ -345,17 +345,17 @@ void parse_colors(FILE * rcstream, char *buf, char *ptr)
|
||||||
tmpcolor = tmpsyntax->color;
|
tmpcolor = tmpsyntax->color;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Starting a new colorstring for fg %d bg %d\n",
|
_("Starting a new colorstring for fg %d bg %d\n"),
|
||||||
fg, bg);
|
fg, bg);
|
||||||
fprintf(stderr, "string val=%s\n", tmp);
|
fprintf(stderr, _("string val=%s\n"), tmp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
for (tmpcolor = tmpsyntax->color;
|
for (tmpcolor = tmpsyntax->color;
|
||||||
tmpcolor->next != NULL; tmpcolor = tmpcolor->next);
|
tmpcolor->next != NULL; tmpcolor = tmpcolor->next);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "Adding new entry for fg %d bg %d\n", fg, bg);
|
fprintf(stderr, _("Adding new entry for fg %d bg %d\n"), fg, bg);
|
||||||
fprintf(stderr, "string val=%s\n", tmp);
|
fprintf(stderr, _("string val=%s\n"), tmp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
tmpcolor->next = nmalloc(sizeof(colortype));
|
tmpcolor->next = nmalloc(sizeof(colortype));
|
||||||
|
@ -387,7 +387,7 @@ void parse_colors(FILE * rcstream, char *buf, char *ptr)
|
||||||
beginning = ptr;
|
beginning = ptr;
|
||||||
ptr = parse_next_regex(ptr);
|
ptr = parse_next_regex(ptr);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "For end part, beginning = \"%s\"\n",
|
fprintf(stderr, _("For end part, beginning = \"%s\"\n"),
|
||||||
beginning);
|
beginning);
|
||||||
#endif
|
#endif
|
||||||
tmp = NULL;
|
tmp = NULL;
|
||||||
|
|
13
search.c
13
search.c
|
@ -221,7 +221,7 @@ void not_found_msg(char *str)
|
||||||
char *foo = NULL;
|
char *foo = NULL;
|
||||||
|
|
||||||
foo = mallocstrcpy(foo, str);
|
foo = mallocstrcpy(foo, str);
|
||||||
foo[COLS / 2] = 0;
|
foo[COLS / 2] = '\0';
|
||||||
statusbar(_("\"%s...\" not found"), foo);
|
statusbar(_("\"%s...\" not found"), foo);
|
||||||
|
|
||||||
free(foo);
|
free(foo);
|
||||||
|
@ -274,6 +274,7 @@ filestruct *findnextstr(int quiet, int bracket_mode, filestruct * begin, int beg
|
||||||
if (search_last_line) {
|
if (search_last_line) {
|
||||||
if (!quiet)
|
if (!quiet)
|
||||||
not_found_msg(needle);
|
not_found_msg(needle);
|
||||||
|
update_line(fileptr, current_x);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -571,7 +572,7 @@ char *replace_line(void)
|
||||||
|
|
||||||
/* Head of Original Line */
|
/* Head of Original Line */
|
||||||
strncpy(copy, current->data, current_x);
|
strncpy(copy, current->data, current_x);
|
||||||
copy[current_x] = 0;
|
copy[current_x] = '\0';
|
||||||
|
|
||||||
/* Replacement Text */
|
/* Replacement Text */
|
||||||
if (!ISSET(USE_REGEXP))
|
if (!ISSET(USE_REGEXP))
|
||||||
|
@ -863,11 +864,9 @@ void do_gotopos(int line, int pos_x, int pos_y, int pos_placewewant)
|
||||||
current_y = pos_y;
|
current_y = pos_y;
|
||||||
do_gotoline(line, 1);
|
do_gotoline(line, 1);
|
||||||
|
|
||||||
/* recalculate the x-coordinate and place we want, just in case their
|
/* make sure that the x-coordinate is sane here */
|
||||||
values are insane; if they aren't, they won't be changed by this */
|
if (pos_x > strlen(current->data))
|
||||||
current_x = pos_x;
|
pos_x = strlen(current->data);
|
||||||
pos_placewewant = xplustabs();
|
|
||||||
pos_x = actual_x(current, pos_placewewant);
|
|
||||||
|
|
||||||
/* set the rest of the coordinates up */
|
/* set the rest of the coordinates up */
|
||||||
current_x = pos_x;
|
current_x = pos_x;
|
||||||
|
|
32
utils.c
32
utils.c
|
@ -19,16 +19,14 @@
|
||||||
* *
|
* *
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include "config.h"
|
||||||
#include "nano.h"
|
|
||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
|
#include "nano.h"
|
||||||
|
|
||||||
#ifdef ENABLE_NLS
|
#ifdef ENABLE_NLS
|
||||||
#include <libintl.h>
|
#include <libintl.h>
|
||||||
|
@ -52,6 +50,32 @@ int num_of_digits(int n)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* For non-null-terminated lines. A line, by definition, shouldn't
|
||||||
|
normally have newlines in it, so encode its nulls as newlines. */
|
||||||
|
void unsunder(char *str, int true_len)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
if (strlen(str) < true_len) {
|
||||||
|
for (i = 0; i < true_len; i++) {
|
||||||
|
if (str[i] == '\0')
|
||||||
|
str[i] = '\n';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* For non-null-terminated lines. A line, by definition, shouldn't
|
||||||
|
normally have newlines in it, so decode its newlines into nulls. */
|
||||||
|
void sunder(char *str)
|
||||||
|
{
|
||||||
|
int i, true_len = strlen(str);
|
||||||
|
if (strchr(str, '\n')) {
|
||||||
|
for (i = 0; i < true_len; i++) {
|
||||||
|
if (str[i] == '\n')
|
||||||
|
str[i] = '\0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Lower case a string - must be null terminated */
|
/* Lower case a string - must be null terminated */
|
||||||
void lowercase(char *src)
|
void lowercase(char *src)
|
||||||
{
|
{
|
||||||
|
|
101
winio.c
101
winio.c
|
@ -19,13 +19,13 @@
|
||||||
* *
|
* *
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <ctype.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include "config.h"
|
||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
#include "nano.h"
|
#include "nano.h"
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ int xpt(filestruct * fileptr, int index)
|
||||||
} else if (fileptr->data[i] & 0x80)
|
} else if (fileptr->data[i] & 0x80)
|
||||||
/* Make 8 bit chars only 1 column! */
|
/* Make 8 bit chars only 1 column! */
|
||||||
;
|
;
|
||||||
else if (fileptr->data[i] < 32 || fileptr->data[i] == 127)
|
else if (iscntrl((int) fileptr->data[i]))
|
||||||
tabs++;
|
tabs++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,11 +114,25 @@ int actual_x_from_start(filestruct * fileptr, int xplus, int start)
|
||||||
tot += tabsize - (tot % tabsize);
|
tot += tabsize - (tot % tabsize);
|
||||||
} else if (fileptr->data[i] & 0x80)
|
} else if (fileptr->data[i] & 0x80)
|
||||||
tot++; /* Make 8 bit chars only 1 column (again) */
|
tot++; /* Make 8 bit chars only 1 column (again) */
|
||||||
else if (fileptr->data[i] < 32 || fileptr->data[i] == 127) {
|
else if (iscntrl((int) fileptr->data[i])) {
|
||||||
i++;
|
i++;
|
||||||
tot += 2;
|
tot += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (i > strlen(fileptr->data))
|
||||||
|
i = strlen(fileptr->data);
|
||||||
|
|
||||||
|
/* see if we're in the x-plus-tabs column of xplus; if not, look
|
||||||
|
for the closest column to it */
|
||||||
|
if (xpt(fileptr, i) < xplus) {
|
||||||
|
while (xpt(fileptr, i) < xplus && i < strlen(fileptr->data))
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
else if (xpt(fileptr, i) > xplus) {
|
||||||
|
while (xpt(fileptr, i) > xplus && i > start)
|
||||||
|
i--;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, _("actual_x_from_start for xplus=%d returned %d\n"),
|
fprintf(stderr, _("actual_x_from_start for xplus=%d returned %d\n"),
|
||||||
xplus, i);
|
xplus, i);
|
||||||
|
@ -151,7 +165,7 @@ int strnlenpt(char *buf, int size)
|
||||||
} else if (buf[i] & 0x80)
|
} else if (buf[i] & 0x80)
|
||||||
/* Make 8 bit chars only 1 column! */
|
/* Make 8 bit chars only 1 column! */
|
||||||
;
|
;
|
||||||
else if (buf[i] < 32 || buf[i] == 127)
|
else if (iscntrl((int) buf[i]))
|
||||||
tabs++;
|
tabs++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,7 +206,6 @@ void blank_bottombars(void)
|
||||||
|
|
||||||
for (; i <= 2; i++)
|
for (; i <= 2; i++)
|
||||||
mvwaddstr(bottomwin, i, 0, hblank);
|
mvwaddstr(bottomwin, i, 0, hblank);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void blank_edit(void)
|
void blank_edit(void)
|
||||||
|
@ -275,7 +288,7 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut *s,
|
||||||
|
|
||||||
slen = length_of_list(s);
|
slen = length_of_list(s);
|
||||||
inputbuf = charalloc(strlen(def) + 1);
|
inputbuf = charalloc(strlen(def) + 1);
|
||||||
inputbuf[0] = 0;
|
inputbuf[0] = '\0';
|
||||||
|
|
||||||
x_left = strlen(buf);
|
x_left = strlen(buf);
|
||||||
x = strlen(def) + x_left;
|
x = strlen(def) + x_left;
|
||||||
|
@ -363,7 +376,7 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut *s,
|
||||||
memmove(inputbuf + (x - x_left),
|
memmove(inputbuf + (x - x_left),
|
||||||
inputbuf + (x - x_left) + 1,
|
inputbuf + (x - x_left) + 1,
|
||||||
strlen(inputbuf) - (x - x_left) - 1);
|
strlen(inputbuf) - (x - x_left) - 1);
|
||||||
inputbuf[strlen(inputbuf) - 1] = 0;
|
inputbuf[strlen(inputbuf) - 1] = '\0';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NANO_CONTROL_K:
|
case NANO_CONTROL_K:
|
||||||
|
@ -376,12 +389,12 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut *s,
|
||||||
case NANO_CONTROL_H:
|
case NANO_CONTROL_H:
|
||||||
if (strlen(inputbuf) > 0) {
|
if (strlen(inputbuf) > 0) {
|
||||||
if (x == (x_left + strlen(inputbuf)))
|
if (x == (x_left + strlen(inputbuf)))
|
||||||
inputbuf[strlen(inputbuf) - 1] = 0;
|
inputbuf[strlen(inputbuf) - 1] = '\0';
|
||||||
else if (x - x_left) {
|
else if (x - x_left) {
|
||||||
memmove(inputbuf + (x - x_left) - 1,
|
memmove(inputbuf + (x - x_left) - 1,
|
||||||
inputbuf + (x - x_left),
|
inputbuf + (x - x_left),
|
||||||
strlen(inputbuf) - (x - x_left));
|
strlen(inputbuf) - (x - x_left));
|
||||||
inputbuf[strlen(inputbuf) - 1] = 0;
|
inputbuf[strlen(inputbuf) - 1] = '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (x > strlen(buf))
|
if (x > strlen(buf))
|
||||||
|
@ -447,7 +460,7 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut *s,
|
||||||
memmove(inputbuf + (x - x_left),
|
memmove(inputbuf + (x - x_left),
|
||||||
inputbuf + (x - x_left) + 1,
|
inputbuf + (x - x_left) + 1,
|
||||||
strlen(inputbuf) - (x - x_left) - 1);
|
strlen(inputbuf) - (x - x_left) - 1);
|
||||||
inputbuf[strlen(inputbuf) - 1] = 0;
|
inputbuf[strlen(inputbuf) - 1] = '\0';
|
||||||
}
|
}
|
||||||
goto skip_tilde;
|
goto skip_tilde;
|
||||||
case '4':
|
case '4':
|
||||||
|
@ -504,6 +517,13 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut *s,
|
||||||
nanoget_repaint(buf, inputbuf, x);
|
nanoget_repaint(buf, inputbuf, x);
|
||||||
wrefresh(bottomwin);
|
wrefresh(bottomwin);
|
||||||
}
|
}
|
||||||
|
#ifndef DISABLE_TABCOMP
|
||||||
|
/* if we've done tab completion, there might be a list of filename
|
||||||
|
matches on the edit window at this point; make sure they're
|
||||||
|
cleared off */
|
||||||
|
if (list)
|
||||||
|
edit_refresh();
|
||||||
|
#endif
|
||||||
|
|
||||||
answer = mallocstrcpy(answer, inputbuf);
|
answer = mallocstrcpy(answer, inputbuf);
|
||||||
free(inputbuf);
|
free(inputbuf);
|
||||||
|
@ -817,7 +837,7 @@ void edit_add(filestruct * fileptr, int yval, int start, int virt_cur_x,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "Match! (%d chars) \"%s\"\n",
|
fprintf(stderr, _("Match! (%d chars) \"%s\"\n"),
|
||||||
colormatches[0].rm_eo - colormatches[0].rm_so,
|
colormatches[0].rm_eo - colormatches[0].rm_so,
|
||||||
&fileptr->data[k + colormatches[0].rm_so]);
|
&fileptr->data[k + colormatches[0].rm_so]);
|
||||||
#endif
|
#endif
|
||||||
|
@ -830,7 +850,7 @@ void edit_add(filestruct * fileptr, int yval, int start, int virt_cur_x,
|
||||||
paintlen =
|
paintlen =
|
||||||
colormatches[0].rm_eo - colormatches[0].rm_so;
|
colormatches[0].rm_eo - colormatches[0].rm_so;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "paintlen (%d) = eo (%d) - so (%d)\n",
|
fprintf(stderr, _("paintlen (%d) = eo (%d) - so (%d)\n"),
|
||||||
paintlen, colormatches[0].rm_eo, colormatches[0].rm_so);
|
paintlen, colormatches[0].rm_eo, colormatches[0].rm_so);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -838,7 +858,7 @@ void edit_add(filestruct * fileptr, int yval, int start, int virt_cur_x,
|
||||||
else {
|
else {
|
||||||
paintlen = COLS - k - colormatches[0].rm_so - 1;
|
paintlen = COLS - k - colormatches[0].rm_so - 1;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "paintlen (%d) = COLS (%d) - k (%d), - rm.so (%d) - 1\n",
|
fprintf(stderr, _("paintlen (%d) = COLS (%d) - k (%d), - rm.so (%d) - 1\n"),
|
||||||
paintlen, COLS, k, colormatches[0].rm_so);
|
paintlen, COLS, k, colormatches[0].rm_so);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -941,7 +961,7 @@ void edit_add(filestruct * fileptr, int yval, int start, int virt_cur_x,
|
||||||
&fileptr->data[start + smatch],
|
&fileptr->data[start + smatch],
|
||||||
ematch - smatch);
|
ematch - smatch);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "start = %d, smatch = %d, ematch = %d\n", start,
|
fprintf(stderr, _("start = %d, smatch = %d, ematch = %d\n"), start,
|
||||||
smatch, ematch);
|
smatch, ematch);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1181,12 +1201,31 @@ void update_line(filestruct * fileptr, int index)
|
||||||
if (i < mark_beginx)
|
if (i < mark_beginx)
|
||||||
virt_mark_beginx--;
|
virt_mark_beginx--;
|
||||||
} else if (realdata[i] == 127) {
|
} else if (realdata[i] == 127) {
|
||||||
/* Treat control characters as ^symbol (ASCII 1 - 31, 127) */
|
/* Treat control characters as ^symbol (ASCII 1 - 31 omitting
|
||||||
|
10, 127) */
|
||||||
fileptr->data[pos++] = '^';
|
fileptr->data[pos++] = '^';
|
||||||
fileptr->data[pos++] = '?';
|
fileptr->data[pos++] = '?';
|
||||||
} else if (realdata[i] >= 1 && realdata[i] <= 31) {
|
if (i < current_x)
|
||||||
|
virt_cur_x++;
|
||||||
|
if (i < mark_beginx)
|
||||||
|
virt_mark_beginx++;
|
||||||
|
} else if (realdata[i] >= 1 && realdata[i] <= 31 && realdata[i] != 10) {
|
||||||
fileptr->data[pos++] = '^';
|
fileptr->data[pos++] = '^';
|
||||||
fileptr->data[pos++] = realdata[i] + 64;
|
fileptr->data[pos++] = realdata[i] + 64;
|
||||||
|
if (i < current_x)
|
||||||
|
virt_cur_x++;
|
||||||
|
if (i < mark_beginx)
|
||||||
|
virt_mark_beginx++;
|
||||||
|
} else if (realdata[i] == 10) {
|
||||||
|
/* Treat newlines (ASCII 10's) embedded in a line as encoded
|
||||||
|
nulls (ASCII 0's); the line in question should be run
|
||||||
|
through unsunder() before reaching here */
|
||||||
|
fileptr->data[pos++] = '^';
|
||||||
|
fileptr->data[pos++] = '@';
|
||||||
|
if (i < current_x)
|
||||||
|
virt_cur_x++;
|
||||||
|
if (i < mark_beginx)
|
||||||
|
virt_mark_beginx++;
|
||||||
} else {
|
} else {
|
||||||
fileptr->data[pos++] = realdata[i];
|
fileptr->data[pos++] = realdata[i];
|
||||||
}
|
}
|
||||||
|
@ -1741,9 +1780,36 @@ int do_help(void)
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
case 27:
|
||||||
|
kbinput = wgetch(edit);
|
||||||
|
switch(kbinput) {
|
||||||
|
case '[':
|
||||||
|
kbinput = wgetch(edit);
|
||||||
|
switch(kbinput) {
|
||||||
|
case '5': /* Alt-[-5 = Page Up */
|
||||||
|
wgetch(edit);
|
||||||
|
goto do_pageupkey;
|
||||||
|
break;
|
||||||
|
case 'V': /* Alt-[-V = Page Up in Hurd Console */
|
||||||
|
case 'I': /* Alt-[-I = Page Up - FreeBSD Console */
|
||||||
|
goto do_pageupkey;
|
||||||
|
break;
|
||||||
|
case '6': /* Alt-[-6 = Page Down */
|
||||||
|
wgetch(edit);
|
||||||
|
goto do_pagedownkey;
|
||||||
|
break;
|
||||||
|
case 'U': /* Alt-[-U = Page Down in Hurd Console */
|
||||||
|
case 'G': /* Alt-[-G = Page Down - FreeBSD Console */
|
||||||
|
goto do_pagedownkey;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case NANO_NEXTPAGE_KEY:
|
case NANO_NEXTPAGE_KEY:
|
||||||
case NANO_NEXTPAGE_FKEY:
|
case NANO_NEXTPAGE_FKEY:
|
||||||
case KEY_NPAGE:
|
case KEY_NPAGE:
|
||||||
|
do_pagedownkey:
|
||||||
if (!no_more) {
|
if (!no_more) {
|
||||||
blank_edit();
|
blank_edit();
|
||||||
page++;
|
page++;
|
||||||
|
@ -1752,6 +1818,7 @@ int do_help(void)
|
||||||
case NANO_PREVPAGE_KEY:
|
case NANO_PREVPAGE_KEY:
|
||||||
case NANO_PREVPAGE_FKEY:
|
case NANO_PREVPAGE_FKEY:
|
||||||
case KEY_PPAGE:
|
case KEY_PPAGE:
|
||||||
|
do_pageupkey:
|
||||||
if (page > 1) {
|
if (page > 1) {
|
||||||
no_more = 0;
|
no_more = 0;
|
||||||
blank_edit();
|
blank_edit();
|
||||||
|
|
Loading…
Reference in New Issue