Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
423cbfd743 | ||
|
|
5577aec4e8 | ||
|
|
18f8be0058 | ||
|
|
f8163dc2e7 | ||
|
|
f0f63a82fb | ||
|
|
a547fd1e0e | ||
|
|
6306a11ad6 | ||
|
|
9541f2a1d3 | ||
|
|
d56bd79daf | ||
|
|
e49f123cc0 | ||
|
|
4c780be883 | ||
|
|
220e7fb132 | ||
|
|
756f220a26 | ||
|
|
cf7c9936ad | ||
|
|
9babaf3b38 | ||
|
|
340d6e50c2 | ||
|
|
dabc3cb0df | ||
|
|
e10debd14b | ||
|
|
f1d33d30ce | ||
|
|
8c81d23a7e | ||
|
|
8d458043d1 | ||
|
|
5286ccbaf9 | ||
|
|
ba96f7afac | ||
|
|
a2efc36799 | ||
|
|
e5935973f9 | ||
|
|
13415991e8 | ||
|
|
b7ea9d45bb | ||
|
|
0286ba436e | ||
|
|
c86f714a15 | ||
|
|
9b45ff54ac | ||
|
|
2b78429248 | ||
|
|
c87a411624 | ||
|
|
141c1274c4 | ||
|
|
11b0011b1f | ||
|
|
b4dc9e0944 | ||
|
|
81b1eea10f | ||
|
|
7dc14e81d7 | ||
|
|
4dbcc3cd9e |
@@ -224,3 +224,4 @@ distribution.
|
||||
If December 1997 seems to be old, you may fetch a more recent copy
|
||||
of this `ABOUT-NLS' file on most GNU archive sites.
|
||||
|
||||
$Id$
|
||||
|
||||
1
AUTHORS
1
AUTHORS
@@ -1,3 +1,4 @@
|
||||
$Id$
|
||||
This file lists people who have made significant contribution to the nano
|
||||
editor. Please see the ChangeLog for specific changes by author.
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
8
BUGS
8
BUGS
@@ -51,6 +51,10 @@
|
||||
written out to disk when saved..... (37). [FIXED]
|
||||
- Page up and page down do not work the same way as Pico (# of lines). (38)
|
||||
[FIXED]
|
||||
- When doing a search and the marker is set, the screen does not always
|
||||
properly update the inverted text (39). [FIXED]
|
||||
- Searches for a string that only exist on one line multiple times will
|
||||
fail after finding the last occurance (discovered by Ken Tyler) (40). [FIXED]
|
||||
** Open BUGS **
|
||||
|
||||
- Marked cutting sometimes leaves a newline in the file unintelligently,
|
||||
@@ -63,3 +67,7 @@
|
||||
causes a random segfault (16) [FIXED?]
|
||||
- In replace, there is no way to accept the default replace string. (27)
|
||||
- totsize problems still abound in do_justify (33)
|
||||
- Alt-Z is current broken to toggle suspend. I guess I still don't know
|
||||
signals very well =-) (41).
|
||||
|
||||
$Id$
|
||||
|
||||
74
ChangeLog
74
ChangeLog
@@ -1,3 +1,75 @@
|
||||
nano-0.9.17 - 09/04/2000
|
||||
- General
|
||||
- New shortcuts to toggle certain options that are normally only
|
||||
flags via Alt/Meta. See Alt-C,E,I,K,M,P,X,Z. New struct called
|
||||
toggles in nano.h, toggle_init(), toggle_init_one() in global.c
|
||||
called from shortcut_init(), and do_toggle in nano.c. Also
|
||||
moved the signal code into a separate function in nano.c called
|
||||
signal_init(). Moved "struct sigaction act"into a static in
|
||||
nano.c.
|
||||
- Changed from Alt-key symbol (@) which is completely nonstandard
|
||||
to the *nix "Meta" symbol (M-). Changed help_init to show
|
||||
the M-key usage and the help text to explain keys whcih generate
|
||||
Meta. Moved the toggle Meta keystrokes to the first column
|
||||
instead of the third as they are the primary keystrokes for the
|
||||
functions. Thanks Mini editor team :->
|
||||
- Changed last_search and last_replace vars to statically
|
||||
allocated (hence nulled) and moved to search.c (Matt Kraai).
|
||||
- global.c:
|
||||
toggle_init()
|
||||
- Changed "No auto wrap" and "No help mode" to "Auto wrap" and
|
||||
"Help mode". See the change to do_toggle() below.
|
||||
- nano.c:
|
||||
do_mouse()
|
||||
- Patch for handling lines w/tabs and mouse better (Ben Roberts).
|
||||
do_wrap()
|
||||
- Made wrapping code less ambitious.
|
||||
do_toggle()
|
||||
- Added checks for no help and no wrap mode, and print opposite
|
||||
enable/disable message.
|
||||
do_suspend(), do_cont():
|
||||
- New functions, handle suspend signal in a Pico-like manner and
|
||||
work with Meta-Z.
|
||||
- winio.c:
|
||||
total_refresh()
|
||||
- Added edit_refresh() call to actually update the screen if messy.
|
||||
edit_refresh_clearok()
|
||||
- New function, does a total update for edit refresh, needed to fix
|
||||
lack of reversed text on searching with MARK_ISSET.
|
||||
onekey()
|
||||
- Off by one error fix (Rocco Corsi).
|
||||
update_line()
|
||||
- Added check for binary data >= 1 and <= 26, and use ^+letter
|
||||
to display it. Should fix editing text files with binary
|
||||
data in them. Placing of the cursor seems to be a bit screwed
|
||||
though...
|
||||
- search.c:
|
||||
search_abort()
|
||||
- Now calls edit_refresh_clearok when MARK_ISSET to handle screen
|
||||
ugliness bug (reported by Ken Tyler).
|
||||
findnextstr():
|
||||
- Added reset for placewewant (Ben Roberts).
|
||||
- Fixed check for string that only occurs on the same line failing
|
||||
(discovered by Ken Tyler).
|
||||
|
||||
nano-0.9.16 - 08/09/2000
|
||||
- cut.c:
|
||||
do_cut_text()
|
||||
- Fixed getting locked into cutbuffer on cutting first line of file.
|
||||
- Added check_statblank().
|
||||
- Check for fileptr == filebot, if so return, we shouldn't bother
|
||||
cutting the magic line.
|
||||
do_uncut_text()
|
||||
- Added check_statblank().
|
||||
- nano.c:
|
||||
main()
|
||||
- Changed tabsize long arg to actually accept an argument *sigh*.
|
||||
- po/Makefile.in.in:
|
||||
- Patch to handle $DESTDIR (orig by Dan Harnett contributed by
|
||||
Christian Weisgerber)
|
||||
- configure.in:
|
||||
- New (and severally revised =) slang test code (Albert Chin-A-Young)
|
||||
|
||||
nano-0.9.15 - 08/03/2000
|
||||
- Changed edit_update call to take arguments TOP, CENTER or BOTTOM.
|
||||
Affects many many functions. Removed functions edit_update_top and
|
||||
@@ -884,3 +956,5 @@ nano 0.7.6 - 01/15/2000
|
||||
0.2 Read in data to buffer, bound keystrokes to stub functions,
|
||||
initial cursor movement on screen. Initial autoconf support.
|
||||
0.1 Initial program setup w/ncurses
|
||||
|
||||
$Id$
|
||||
|
||||
2
INSTALL
2
INSTALL
@@ -180,3 +180,5 @@ operates.
|
||||
script, and exit.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options.
|
||||
|
||||
$Id$
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
## $Id$
|
||||
bin_PROGRAMS = nano
|
||||
nano_SOURCES = cut.c \
|
||||
files.c \
|
||||
|
||||
16
NEWS
16
NEWS
@@ -1,3 +1,17 @@
|
||||
09/04/2000 - Nano 0.9.17, the Labor Day release, is released after a
|
||||
quiet spell (almost an entire month since last release!)
|
||||
New features include better (not yet perfect) binary
|
||||
display support and toggle support for most of the program
|
||||
flags (M-c, M-i, M-z, M-x, M-p, M-w, M-m, M-k and M-e for
|
||||
-c, -i, -x, -p, -w, -k, and -R).
|
||||
|
||||
08/09/2000 - Nano 0.9.16, after some struggling, is release. This release
|
||||
should fix a few of the holes that 0.9.15 dug. The
|
||||
"cutting text on the first line" bug is fixed, as is the
|
||||
"cutting text on the last line" bug. Nice symmetry there
|
||||
huh? Also the --tabsize argument should now work as well
|
||||
as by using -T.
|
||||
|
||||
08/03/2000 - Nano 0.9.15 is the "I cant think of a release description"
|
||||
release. There are the usual gala of display bugfixes,
|
||||
a for the the nasty bug in -k mode that could create a
|
||||
@@ -250,3 +264,5 @@
|
||||
http://faculty.plattsburgh.edu/astyanax/nano. Please
|
||||
update your bookmarks, tell your friends, and all that
|
||||
jazz.
|
||||
|
||||
$Id$
|
||||
|
||||
2
README
2
README
@@ -80,3 +80,5 @@ Current Status
|
||||
can guess, I'm not much of an emacs fan ;)
|
||||
|
||||
Chris Allegretta (chrisa@asty.org)
|
||||
|
||||
$Id$
|
||||
|
||||
3
TODO
3
TODO
@@ -11,9 +11,12 @@ Current Version:
|
||||
- Rewrite edit_refresh, if at all possible [DONE]
|
||||
- Implement justify function [DONE]
|
||||
- Cut to end of line [DONE]
|
||||
- Unjustify command (^U after ^J)
|
||||
|
||||
For Next Version:
|
||||
- Undo/Redo key?
|
||||
- single line scroll up/down?
|
||||
- Color syntax highlighting? (certainly seems like there's a demand for it.)
|
||||
- .nanorc ?????
|
||||
|
||||
$Id$
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Define this if you have the wresize function in your ncurses-type library */
|
||||
#undef HAVE_WRESIZE
|
||||
|
||||
|
||||
100
configure.in
100
configure.in
@@ -1,6 +1,7 @@
|
||||
# $Id$
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(nano.c)
|
||||
AM_INIT_AUTOMAKE(nano, 0.9.15-cvs)
|
||||
AM_INIT_AUTOMAKE(nano, 0.9.16-cvs)
|
||||
AM_CONFIG_HEADER(config.h:config.h.in)
|
||||
ALL_LINGUAS="es de fr it id fi"
|
||||
|
||||
@@ -25,44 +26,75 @@ CURSES_LIB_NAME=""
|
||||
AC_ARG_WITH(slang,
|
||||
[ --with-slang[=DIR] Use the slang library instead of curses],
|
||||
[ case "$with_slang" in
|
||||
yes)
|
||||
AC_MSG_RESULT(yes)
|
||||
|
||||
AC_CHECK_HEADER(slcurses.h,
|
||||
AC_CHECK_LIB(slang, SLcurses_newwin,
|
||||
[AC_DEFINE(USE_SLANG) slang_support=yes
|
||||
CURSES_LIB="-lslang" CURSES_LIB_NAME=slang]),
|
||||
AC_MSG_ERROR([
|
||||
*** The header file slcurses.h was not found. If you wish to use
|
||||
*** slang support this header file is required. Please either
|
||||
*** install a version of slang that includes the slcurses.h file or
|
||||
*** do not call the configure script with --with-slang
|
||||
]))
|
||||
;;
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(yes)
|
||||
|
||||
# Needed for AC_CHECK_HEADERS and AC_CHECK_LIB to look at
|
||||
# alternate readline path
|
||||
_ldflags=${LDFLAGS}
|
||||
_cppflags=${CPPFLAGS}
|
||||
|
||||
# Add additional search path
|
||||
LDFLAGS="-L$with_slang/lib $LDFLAGS"
|
||||
CPPFLAGS="-I$with_slang/include $CPPFLAGS"
|
||||
if test "$with_slang" != "yes"; then
|
||||
# Add additional search path
|
||||
LDFLAGS="-L$with_slang/lib $LDFLAGS"
|
||||
CPPFLAGS="-I$with_slang/include $CPPFLAGS"
|
||||
fi
|
||||
|
||||
AC_CHECK_HEADER(slcurses.h,
|
||||
AC_CHECK_LIB(slang, SLcurses_newwin,
|
||||
[AC_DEFINE(USE_SLANG) slang_support=yes
|
||||
CURSES_LIB="-L${with_slang}/lib -lslang"
|
||||
CURSES_LIB_NAME=slang],
|
||||
AC_MSG_ERROR([
|
||||
*** The slang library was not found or the version you have installed
|
||||
*** is incorrect.
|
||||
])),
|
||||
AC_MSG_CHECKING(for SLtt_initialize in -lslang)
|
||||
_libs=$LIBS
|
||||
LIBS="$LIBS -lslang"
|
||||
AC_TRY_RUN([
|
||||
#include <stdio.h>
|
||||
#include <slcurses.h>
|
||||
int main () { SLtt_initialize (NULL); return 0; }],
|
||||
[AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(USE_SLANG)
|
||||
slang_support=yes
|
||||
if test "$with_slang" != "yes"; then
|
||||
CURSES_LIB="-L${with_slang}/lib -lslang"
|
||||
else
|
||||
CURSES_LIB="-lslang"
|
||||
fi
|
||||
CURSES_LIB_NAME=slang], [
|
||||
AC_MSG_RESULT(no)
|
||||
# We might need the term library
|
||||
for termlib in ncurses curses termcap terminfo termlib; do
|
||||
AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
|
||||
test -n "$tcap" && break
|
||||
done
|
||||
|
||||
AC_MSG_CHECKING(for SLtt_initialize in -lslang $tcap)
|
||||
LIBS="$LIBS $tcap"
|
||||
AC_TRY_RUN([
|
||||
#include <stdio.h>
|
||||
#include <slcurses.h>
|
||||
int main () { SLtt_initialize (NULL); return 0; }],
|
||||
[AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(USE_SLANG)
|
||||
slang_support=yes
|
||||
if test "$with_slang" != "yes"; then
|
||||
CURSES_LIB="-L${with_slang}/lib -lslang $tcap"
|
||||
else
|
||||
CURSES_LIB="-lslang $tcap"
|
||||
fi
|
||||
CURSES_LIB_NAME=slang], [
|
||||
AC_MSG_RESULT(no)
|
||||
# We might need the math library
|
||||
AC_MSG_CHECKING(for SLtt_initialize in -lslang $tcap -lm)
|
||||
LIBS="$LIBS -lm"
|
||||
AC_TRY_RUN([
|
||||
#include <stdio.h>
|
||||
#include <slcurses.h>
|
||||
int main () { SLtt_initialize (NULL); return 0; }],
|
||||
[AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(USE_SLANG)
|
||||
slang_support=yes
|
||||
if test "$with_slang" != "yes"; then
|
||||
CURSES_LIB="-L${with_slang}/lib -lslang $tcap -lm"
|
||||
else
|
||||
CURSES_LIB="-lslang $tcap -lm"
|
||||
fi
|
||||
CURSES_LIB_NAME=slang],
|
||||
[AC_MSG_RESULT(no)])])]),
|
||||
AC_MSG_ERROR([
|
||||
*** The header file slcurses.h was not found. If you wish to use
|
||||
*** slang support this header file is required. Please either
|
||||
@@ -70,7 +102,11 @@ AC_ARG_WITH(slang,
|
||||
*** do not call the configure script with --with-slang
|
||||
]))
|
||||
|
||||
LDFLAGS=${_ldflags}
|
||||
test "${_libs+set}" = "set" && LIBS=$_libs
|
||||
|
||||
if test "$with_slang" != "yes"; then
|
||||
LDFLAGS=${_ldflags}
|
||||
fi
|
||||
;;
|
||||
esac], AC_MSG_RESULT(no))
|
||||
|
||||
|
||||
24
cut.c
24
cut.c
@@ -1,3 +1,4 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* cut.c *
|
||||
* *
|
||||
@@ -135,6 +136,7 @@ int do_cut_text(void)
|
||||
int newsize, cuttingtoend = 0;
|
||||
#endif
|
||||
|
||||
check_statblank();
|
||||
if (fileptr == NULL || fileptr->data == NULL)
|
||||
return 0;
|
||||
|
||||
@@ -148,6 +150,11 @@ int do_cut_text(void)
|
||||
fprintf(stderr, _("Blew away cutbuffer =)\n"));
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Must let cutbuffer get blown away first before we do this... */
|
||||
if (fileptr == filebot)
|
||||
return 0;
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
if (ISSET(CUT_TO_END) && !ISSET(MARK_ISSET)) {
|
||||
if (current_x == strlen(current->data))
|
||||
@@ -223,8 +230,8 @@ int do_cut_text(void)
|
||||
totsize--; /* get the newline */
|
||||
totlines--;
|
||||
fileptr->prev = NULL;
|
||||
edit_update(fileage, CENTER);
|
||||
current = fileptr;
|
||||
edit_update(fileage, CENTER);
|
||||
} else {
|
||||
add_to_cutbuffer(fileptr);
|
||||
fileage = make_new_node(NULL);
|
||||
@@ -241,18 +248,8 @@ int do_cut_text(void)
|
||||
current = fileptr->next;
|
||||
totlines--;
|
||||
totsize--; /* get the newline */
|
||||
} else {
|
||||
/* we're deleteing the last line
|
||||
and replacing it with a dummy line,
|
||||
so totlines is the same */
|
||||
tmp = fileptr->prev;
|
||||
tmp->next = make_new_node(tmp);
|
||||
tmp = tmp->next;
|
||||
tmp->data = nmalloc(1);
|
||||
strcpy(tmp->data, "");
|
||||
current = tmp;
|
||||
filebot = tmp;
|
||||
}
|
||||
} /* No longer an else here, because we never get here anymore...
|
||||
No need to cut the magic line, as it's empty */
|
||||
|
||||
add_to_cutbuffer(fileptr);
|
||||
}
|
||||
@@ -284,6 +281,7 @@ int do_uncut_text(void)
|
||||
int i;
|
||||
|
||||
wrap_reset();
|
||||
check_statblank();
|
||||
if (cutbuffer == NULL || fileptr == NULL)
|
||||
return 0; /* AIEEEEEEEEEEEE */
|
||||
|
||||
|
||||
9
faq.html
9
faq.html
@@ -183,7 +183,7 @@ nano was developed).</font></blockquote>
|
||||
of nano?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">The current version of nano *should*
|
||||
be 0.9.15. Of course you should always check the nano hompage to
|
||||
be 0.9.16. Of course you should always check the nano hompage to
|
||||
see what the latest and greatest version is.</font></blockquote>
|
||||
|
||||
<h2>
|
||||
@@ -300,7 +300,7 @@ isn't hard. Unpack the nano source with a command like:</font>
|
||||
<p><b><font color="#330000">tar -zxvf nano-x.y.z.tar.gz</font></b>
|
||||
<p><font color="#330000">If you get error messages about the -z option,
|
||||
try this:</font>
|
||||
<p><b><font color="#330000">gunzip -d nano-x.y.z.tar.gz | tar xvf -</font></b>
|
||||
<p><b><font color="#330000">gzip -dc nano-x.y.z.tar.gz | tar xvf -</font></b>
|
||||
<p><font color="#330000">(again, where x.y.z is the version number in question).
|
||||
Then you need to run configure with any options you might want (if any).</font>
|
||||
<p><font color="#330000">The average case is this:</font>
|
||||
@@ -473,7 +473,7 @@ also licensed under the GPL.</font></blockquote>
|
||||
their license?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">You're really not asking the right person
|
||||
here. I (Chris) waited along time to see if UW would change their
|
||||
here. I (Chris) waited a long time to see if UW would change their
|
||||
license because of the amount of high quality software being released and
|
||||
developed under the GPL without being taken advantage of by malicious corporate
|
||||
entities or other baddies, but no such luck so far.</font></blockquote>
|
||||
@@ -541,6 +541,7 @@ and you should know the answer.</font></blockquote>
|
||||
<a NAME="8"></a>8. ChangeLog</h1>
|
||||
|
||||
<blockquote>06/31/2000 - Initial framework.</blockquote>
|
||||
|
||||
<P>
|
||||
$Id$
|
||||
</body>
|
||||
</html>
|
||||
|
||||
1
files.c
1
files.c
@@ -1,3 +1,4 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* files.c *
|
||||
* *
|
||||
|
||||
54
global.c
54
global.c
@@ -1,3 +1,4 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* global.c *
|
||||
* *
|
||||
@@ -38,7 +39,7 @@ int center_x = 0, center_y = 0; /* Center of screen */
|
||||
WINDOW *edit; /* The file portion of the editor */
|
||||
WINDOW *topwin; /* Top line of screen */
|
||||
WINDOW *bottomwin; /* Bottom buffer */
|
||||
char *filename; /* Name of the file */
|
||||
char filename[PATH_MAX]; /* Name of the file */
|
||||
int editwinrows = 0; /* How many rows long is the edit
|
||||
window? */
|
||||
filestruct *current; /* Current buffer pointer */
|
||||
@@ -53,7 +54,7 @@ filestruct *editbot = NULL; /* Same for the bottom */
|
||||
filestruct *filebot = NULL; /* Last node in the file struct */
|
||||
filestruct *cutbuffer = NULL; /* A place to store cut text */
|
||||
|
||||
char *answer; /* Answer str to many questions */
|
||||
char answer[132]; /* Answer str to many questions */
|
||||
int totlines = 0; /* Total number of lines in the file */
|
||||
int totsize = 0; /* Total number of bytes in the file */
|
||||
int placewewant = 0; /* The collum we'd like the cursor
|
||||
@@ -77,6 +78,7 @@ shortcut goto_list[GOTO_LIST_LEN];
|
||||
shortcut writefile_list[WRITEFILE_LIST_LEN];
|
||||
shortcut help_list[HELP_LIST_LEN];
|
||||
shortcut spell_list[SPELL_LIST_LEN];
|
||||
toggle toggles[TOGGLE_LEN];
|
||||
|
||||
/* Regular expressions */
|
||||
|
||||
@@ -98,6 +100,52 @@ void sc_init_one(shortcut * s, int key, char *desc, char *help, int alt,
|
||||
s->func = func;
|
||||
}
|
||||
|
||||
/* Initialize the toggles in the same manner */
|
||||
void toggle_init_one(toggle * t, int val, char *desc, int flag)
|
||||
{
|
||||
t->val = val;
|
||||
t->desc = desc;
|
||||
t->flag = flag;
|
||||
}
|
||||
|
||||
void toggle_init(void)
|
||||
{
|
||||
#ifndef NANO_SMALL
|
||||
char *toggle_const_msg, *toggle_autoindent_msg, *toggle_suspend_msg,
|
||||
*toggle_nohelp_msg, *toggle_picomode_msg, *toggle_mouse_msg,
|
||||
*toggle_cuttoend_msg, *toggle_regexp_msg, *toggle_wrap_msg;
|
||||
|
||||
toggle_const_msg = _("Constant cursor position");
|
||||
toggle_autoindent_msg = _("Auto indent");
|
||||
toggle_suspend_msg = _("Suspend");
|
||||
toggle_nohelp_msg = _("Help mode");
|
||||
toggle_picomode_msg = _("Pico messages");
|
||||
toggle_mouse_msg = _("Mouse support");
|
||||
toggle_cuttoend_msg = _("Cut to end");
|
||||
toggle_regexp_msg = _("Regular expressions");
|
||||
toggle_wrap_msg = _("Auto wrap");
|
||||
|
||||
toggle_init_one(&toggles[0], TOGGLE_CONST_KEY, toggle_const_msg,
|
||||
CONSTUPDATE);
|
||||
toggle_init_one(&toggles[1], TOGGLE_AUTOINDENT_KEY, toggle_autoindent_msg,
|
||||
AUTOINDENT);
|
||||
toggle_init_one(&toggles[2], TOGGLE_SUSPEND_KEY, toggle_suspend_msg,
|
||||
SUSPEND);
|
||||
toggle_init_one(&toggles[3], TOGGLE_NOHELP_KEY, toggle_nohelp_msg,
|
||||
NO_HELP);
|
||||
toggle_init_one(&toggles[4], TOGGLE_PICOMODE_KEY, toggle_picomode_msg,
|
||||
PICO_MSGS);
|
||||
toggle_init_one(&toggles[5], TOGGLE_WRAP_KEY, toggle_wrap_msg,
|
||||
NO_WRAP);
|
||||
toggle_init_one(&toggles[6], TOGGLE_MOUSE_KEY, toggle_mouse_msg,
|
||||
USE_MOUSE);
|
||||
toggle_init_one(&toggles[7], TOGGLE_CUTTOEND_KEY, toggle_cuttoend_msg,
|
||||
CUT_TO_END);
|
||||
toggle_init_one(&toggles[8], TOGGLE_REGEXP_KEY, toggle_regexp_msg,
|
||||
USE_REGEXP);
|
||||
#endif
|
||||
}
|
||||
|
||||
void shortcut_init(void)
|
||||
{
|
||||
char *nano_help_msg = "", *nano_writeout_msg = "", *nano_exit_msg = "",
|
||||
@@ -149,7 +197,6 @@ void shortcut_init(void)
|
||||
nano_cancel_msg = _("Cancel the current function");
|
||||
#endif
|
||||
|
||||
|
||||
if (ISSET(PICO_MSGS))
|
||||
sc_init_one(&main_list[0], NANO_HELP_KEY, _("Get Help"),
|
||||
nano_help_msg, 0, 0, 0, VIEW, do_help);
|
||||
@@ -339,4 +386,5 @@ void shortcut_init(void)
|
||||
sc_init_one(&spell_list[1], NANO_CANCEL_KEY, _("Cancel"),
|
||||
nano_cancel_msg, 0, 0, 0, VIEW, 0);
|
||||
|
||||
toggle_init();
|
||||
}
|
||||
|
||||
1
move.c
1
move.c
@@ -1,3 +1,4 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* move.c *
|
||||
* *
|
||||
|
||||
239
nano.c
239
nano.c
@@ -1,3 +1,4 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* nano.c *
|
||||
* *
|
||||
@@ -58,13 +59,12 @@
|
||||
#endif
|
||||
|
||||
/* Former globals, now static */
|
||||
char *last_search = "\0"; /* Last string we searched for */
|
||||
char *last_replace = "\0"; /* Last replacement string */
|
||||
int fill = 0; /* Fill - where to wrap lines, basically */
|
||||
static char *alt_speller; /* Alternative spell command */
|
||||
struct termios oldterm; /* The user's original term settings */
|
||||
static char *help_text_init = "";
|
||||
/* Initial message, not including shortcuts */
|
||||
static struct sigaction act; /* For all out fun signal handlers */
|
||||
|
||||
/* What we do when we're all set to exit */
|
||||
RETSIGTYPE finish(int sigage)
|
||||
@@ -147,10 +147,6 @@ void global_init(void)
|
||||
for (i = 0; i <= COLS - 1; i++)
|
||||
hblank[i] = ' ';
|
||||
hblank[i] = 0;
|
||||
last_search = nmalloc(132);
|
||||
last_replace = nmalloc(132);
|
||||
answer = nmalloc(132);
|
||||
|
||||
}
|
||||
|
||||
void init_help_msg(void)
|
||||
@@ -170,9 +166,11 @@ void init_help_msg(void)
|
||||
"The bottom two lines show the most commonly used shortcuts "
|
||||
"in the editor.\n\n "
|
||||
"The notation for shortcuts is as follows: Control-key "
|
||||
"sequences are notated with a caret (^) symbol. Alt-key "
|
||||
"sequences are notated with an at (@) symbol. The following "
|
||||
"keystrokes are available in the main editor window. "
|
||||
"sequences are notated with a caret (^) symbol and are entered "
|
||||
"with the Control (Ctrl) key. Escape-key sequences are notated "
|
||||
"with the Meta (M) symbol and can be entered using either the "
|
||||
"Esc, Alt or Meta key depending on your keyboard setup. The "
|
||||
"following keystrokes are available in the main editor window. "
|
||||
"Optional keys are shown in parentheses:\n\n");
|
||||
#endif
|
||||
|
||||
@@ -818,18 +816,6 @@ void do_wrap(filestruct * inptr, char input_char)
|
||||
free(temp->data);
|
||||
free(temp);
|
||||
|
||||
|
||||
/* The next line line may need to be wrapped as well. */
|
||||
current_y = old_y + 1;
|
||||
current_x = strlen(inptr->next->data);
|
||||
while (current_x >= 0) {
|
||||
if (isspace(inptr->next->data[current_x])
|
||||
&& (current_x < fill)) break;
|
||||
current_x--;
|
||||
}
|
||||
if (current_x >= 0)
|
||||
check_wrap(inptr->next, ' ');
|
||||
|
||||
current_x = old_x;
|
||||
current_y = old_y;
|
||||
}
|
||||
@@ -1154,6 +1140,7 @@ int do_exit(void)
|
||||
void do_mouse(void)
|
||||
{
|
||||
MEVENT mevent;
|
||||
int foo = 0, tab_found = 0;
|
||||
|
||||
if (getmouse(&mevent) == ERR)
|
||||
return;
|
||||
@@ -1196,6 +1183,23 @@ void do_mouse(void)
|
||||
}
|
||||
}
|
||||
current_x = mevent.x;
|
||||
placewewant = current_x;
|
||||
while(foo < current_x) {
|
||||
if(current->data[foo] == NANO_CONTROL_I) {
|
||||
current_x -= tabsize - (foo % tabsize);
|
||||
tab_found = 1;
|
||||
} else if(current->data[foo] & 0x80)
|
||||
;
|
||||
else if(current->data[foo] < 32)
|
||||
current_x--;
|
||||
foo++;
|
||||
}
|
||||
/* This is where tab_found comes in. I can't figure out why,
|
||||
* but without it any line with a tab will place the cursor
|
||||
* one character behind. Whatever, this fixes it. */
|
||||
if(tab_found == 1)
|
||||
current_x++;
|
||||
|
||||
if (current_x > strlen(current->data))
|
||||
current_x = strlen(current->data);
|
||||
|
||||
@@ -1213,6 +1217,29 @@ RETSIGTYPE handle_hup(int signal)
|
||||
finish(1);
|
||||
}
|
||||
|
||||
/* What do we do when we catch the suspend signal */
|
||||
RETSIGTYPE do_suspend(int signal)
|
||||
{
|
||||
|
||||
act.sa_handler = SIG_DFL;
|
||||
sigemptyset(&act.sa_mask);
|
||||
sigaction(SIGTSTP, &act, NULL);
|
||||
|
||||
endwin();
|
||||
fprintf(stderr,"\n\n\n\n\nUse \"fg\" to return to nano\n");
|
||||
raise(SIGTSTP);
|
||||
}
|
||||
|
||||
/* Restore the suspend handler when we come back into the prog */
|
||||
RETSIGTYPE do_cont(int signal)
|
||||
{
|
||||
|
||||
act.sa_handler = do_suspend;
|
||||
sigemptyset(&act.sa_mask);
|
||||
sigaction(SIGTSTP, &act, NULL);
|
||||
initscr();
|
||||
total_refresh();
|
||||
}
|
||||
|
||||
void handle_sigwinch(int s)
|
||||
{
|
||||
@@ -1283,6 +1310,52 @@ void handle_sigwinch(int s)
|
||||
#endif
|
||||
}
|
||||
|
||||
void signal_init(void)
|
||||
{
|
||||
|
||||
/* Trap SIGINT and SIGQUIT cuz we want them to do useful things. */
|
||||
memset(&act, 0, sizeof(struct sigaction));
|
||||
act.sa_handler = SIG_IGN;
|
||||
sigaction(SIGINT, &act, NULL);
|
||||
|
||||
if (!ISSET(SUSPEND)) {
|
||||
sigaction(SIGTSTP, &act, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
act.sa_handler = do_suspend;
|
||||
sigaction(SIGTSTP, &act, NULL);
|
||||
|
||||
act.sa_handler = do_cont;
|
||||
sigaction (SIGCONT, &act, NULL);
|
||||
}
|
||||
|
||||
|
||||
/* Trap SIGHUP cuz we want to write the file out. */
|
||||
act.sa_handler = handle_hup;
|
||||
sigaction(SIGHUP, &act, NULL);
|
||||
|
||||
act.sa_handler = handle_sigwinch;
|
||||
sigaction(SIGWINCH, &act, NULL);
|
||||
|
||||
}
|
||||
|
||||
void mouse_init(void)
|
||||
{
|
||||
#ifndef NANO_SMALL
|
||||
#ifdef NCURSES_MOUSE_VERSION
|
||||
if (ISSET(USE_MOUSE)) {
|
||||
mousemask(BUTTON1_RELEASED, NULL);
|
||||
mouseinterval(50);
|
||||
}
|
||||
else {
|
||||
mousemask(0, NULL);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
int do_tab(void)
|
||||
{
|
||||
do_char('\t');
|
||||
@@ -1495,6 +1568,11 @@ void help_init(void)
|
||||
if (main_list[i].help != NULL)
|
||||
allocsize += strlen(main_list[i].help) + 15;
|
||||
|
||||
/* And for the toggle list, we also allocate space for extra text. */
|
||||
for (i = 0; i <= TOGGLE_LEN - 1; i++)
|
||||
if (toggles[i].desc != NULL)
|
||||
allocsize += strlen(toggles[i].desc) + 30;
|
||||
|
||||
allocsize += strlen(help_text_init);
|
||||
|
||||
if (help_text != NULL)
|
||||
@@ -1507,7 +1585,7 @@ void help_init(void)
|
||||
strcpy(help_text, help_text_init);
|
||||
|
||||
/* Now add our shortcut info */
|
||||
for (i = 0; i < MAIN_LIST_LEN; i++) {
|
||||
for (i = 0; i < MAIN_LIST_LEN - 1; i++) {
|
||||
sofar = snprintf(buf, BUFSIZ, "^%c ", main_list[i].val + 64);
|
||||
|
||||
if (main_list[i].misc1 > KEY_F0 && main_list[i].misc1 <= KEY_F(64))
|
||||
@@ -1517,26 +1595,84 @@ void help_init(void)
|
||||
sofar += snprintf(&buf[sofar], BUFSIZ - sofar, " ");
|
||||
|
||||
if (main_list[i].altval > 0)
|
||||
sofar += snprintf(&buf[sofar], BUFSIZ - sofar, "(@%c) ",
|
||||
sofar += snprintf(&buf[sofar], BUFSIZ - sofar, "(M-%c) ",
|
||||
main_list[i].altval - 32);
|
||||
else
|
||||
sofar += snprintf(&buf[sofar], BUFSIZ - sofar, " ");
|
||||
|
||||
|
||||
if (main_list[i].help != NULL)
|
||||
snprintf(&buf[sofar], BUFSIZ - sofar, "%s", main_list[i].help);
|
||||
|
||||
|
||||
strcat(help_text, buf);
|
||||
strcat(help_text, "\n");
|
||||
}
|
||||
|
||||
/* And the toggles... */
|
||||
for (i = 0; i <= TOGGLE_LEN - 1; i++) {
|
||||
sofar = snprintf(buf, BUFSIZ,
|
||||
"M-%c ", toggles[i].val - 32 );
|
||||
|
||||
if (toggles[i].desc != NULL)
|
||||
snprintf(&buf[sofar], BUFSIZ - sofar, "%s enable/disable",
|
||||
toggles[i].desc);
|
||||
|
||||
strcat(help_text, buf);
|
||||
strcat(help_text, "\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void do_toggle(int which)
|
||||
{
|
||||
#ifndef NANO_SMALL
|
||||
char *enabled = "enabled";
|
||||
char *disabled = "disabled";
|
||||
|
||||
|
||||
if (ISSET(toggles[which].flag)) {
|
||||
if (toggles[which].val == TOGGLE_NOHELP_KEY ||
|
||||
toggles[which].val == TOGGLE_WRAP_KEY)
|
||||
statusbar("%s %s", toggles[which].desc, enabled);
|
||||
else
|
||||
statusbar("%s %s", toggles[which].desc, disabled);
|
||||
UNSET(toggles[which].flag);
|
||||
} else {
|
||||
if (toggles[which].val == TOGGLE_NOHELP_KEY ||
|
||||
toggles[which].val == TOGGLE_WRAP_KEY)
|
||||
statusbar("%s %s", toggles[which].desc, disabled);
|
||||
else
|
||||
statusbar("%s %s", toggles[which].desc, enabled);
|
||||
SET(toggles[which].flag);
|
||||
}
|
||||
switch (toggles[which].val) {
|
||||
case TOGGLE_PICOMODE_KEY:
|
||||
shortcut_init();
|
||||
display_main_list();
|
||||
break;
|
||||
case TOGGLE_SUSPEND_KEY:
|
||||
signal_init();
|
||||
break;
|
||||
case TOGGLE_MOUSE_KEY:
|
||||
mouse_init();
|
||||
break;
|
||||
case TOGGLE_NOHELP_KEY:
|
||||
handle_sigwinch(1);
|
||||
break;
|
||||
}
|
||||
SET(DISABLE_CURPOS);
|
||||
|
||||
#else
|
||||
nano_small_msg();
|
||||
#endif
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int optchr;
|
||||
int kbinput; /* Input from keyboard */
|
||||
long startline = 0; /* Line to try and start at */
|
||||
struct sigaction act; /* For our lovely signals */
|
||||
int keyhandled = 0; /* Have we handled the keystroke yet? */
|
||||
int tmpkey = 0, i;
|
||||
char *argv0;
|
||||
@@ -1564,7 +1700,7 @@ int main(int argc, char *argv[])
|
||||
{"mouse", 0, 0, 'm'},
|
||||
{"pico", 0, 0, 'p'},
|
||||
{"nofollow", 0, 0, 'l'},
|
||||
{"tabsize", 0, 0, 'T'},
|
||||
{"tabsize", 1, 0, 'T'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif
|
||||
@@ -1667,9 +1803,6 @@ int main(int argc, char *argv[])
|
||||
|| (!argv0 && strstr(argv[0], "pico")))
|
||||
SET(PICO_MSGS);
|
||||
|
||||
filename = nmalloc(PATH_MAX);
|
||||
strcpy(filename, "");
|
||||
|
||||
/* See if there's a non-option in argv (first non-option is the
|
||||
filename, if +LINE is not given) */
|
||||
if (argc == 1 || argc <= optind)
|
||||
@@ -1711,22 +1844,7 @@ int main(int argc, char *argv[])
|
||||
shortcut_init();
|
||||
init_help_msg();
|
||||
help_init();
|
||||
|
||||
/* Trap SIGINT and SIGQUIT cuz we want them to do useful things. */
|
||||
memset(&act, 0, sizeof(struct sigaction));
|
||||
act.sa_handler = SIG_IGN;
|
||||
sigaction(SIGINT, &act, NULL);
|
||||
sigaction(SIGQUIT, &act, NULL);
|
||||
|
||||
if (!ISSET(SUSPEND))
|
||||
sigaction(SIGTSTP, &act, NULL);
|
||||
|
||||
/* Trap SIGHUP cuz we want to write the file out. */
|
||||
act.sa_handler = handle_hup;
|
||||
sigaction(SIGHUP, &act, NULL);
|
||||
|
||||
act.sa_handler = handle_sigwinch;
|
||||
sigaction(SIGWINCH, &act, NULL);
|
||||
signal_init();
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, _("Main: set up windows\n"));
|
||||
@@ -1736,14 +1854,7 @@ int main(int argc, char *argv[])
|
||||
edit = newwin(editwinrows, COLS, 2, 0);
|
||||
keypad(edit, TRUE);
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
#ifdef NCURSES_MOUSE_VERSION
|
||||
if (ISSET(USE_MOUSE)) {
|
||||
mousemask(BUTTON1_RELEASED, NULL);
|
||||
mouseinterval(50);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
mouse_init();
|
||||
|
||||
/* And the other windows */
|
||||
topwin = newwin(2, COLS, 0, 0);
|
||||
@@ -1837,9 +1948,19 @@ int main(int argc, char *argv[])
|
||||
for (i = 0; i <= MAIN_LIST_LEN - 1; i++)
|
||||
if (kbinput == main_list[i].altval ||
|
||||
kbinput == main_list[i].altval - 32) {
|
||||
kbinput = main_list[i].val;
|
||||
break;
|
||||
kbinput = main_list[i].val;
|
||||
break;
|
||||
}
|
||||
#ifndef NANO_SMALL
|
||||
/* And for toggle switches */
|
||||
for (i = 0; i <= TOGGLE_LEN - 1 && !keyhandled; i++)
|
||||
if (kbinput == toggles[i].val ||
|
||||
kbinput == toggles[i].val - 32) {
|
||||
do_toggle(i);
|
||||
keyhandled = 1;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, _("I got Alt-%c! (%d)\n"), kbinput,
|
||||
kbinput);
|
||||
@@ -1849,7 +1970,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
/* Look through the main shortcut list to see if we've hit a
|
||||
shortcut key */
|
||||
for (i = 0; i < MAIN_LIST_LEN; i++) {
|
||||
for (i = 0; i < MAIN_LIST_LEN && !keyhandled; i++) {
|
||||
if (kbinput == main_list[i].val ||
|
||||
(main_list[i].misc1 && kbinput == main_list[i].misc1) ||
|
||||
(main_list[i].misc2 && kbinput == main_list[i].misc2)) {
|
||||
@@ -1890,8 +2011,12 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
do_char(kbinput);
|
||||
}
|
||||
if (ISSET(CONSTUPDATE))
|
||||
do_cursorpos();
|
||||
if (ISSET(CONSTUPDATE)) {
|
||||
if (ISSET(DISABLE_CURPOS))
|
||||
UNSET(DISABLE_CURPOS);
|
||||
else
|
||||
do_cursorpos();
|
||||
}
|
||||
|
||||
reset_cursor();
|
||||
wrefresh(edit);
|
||||
|
||||
26
nano.h
26
nano.h
@@ -1,3 +1,4 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* nano.h *
|
||||
* *
|
||||
@@ -81,6 +82,14 @@ typedef struct shortcut {
|
||||
char *help; /* Help file entry text */
|
||||
} shortcut;
|
||||
|
||||
typedef struct toggle {
|
||||
int val; /* Sequence to toggle the key. Should only need 1 */
|
||||
char *desc; /* Description for when toggle is, uh, toggled,
|
||||
e.g. "Pico Messages", we'll append Enabled or
|
||||
Disabled */
|
||||
int flag; /* What flag actually gets toggled */
|
||||
} toggle;
|
||||
|
||||
/* Bitwise flags so we can save space (or more correctly, not waste it) */
|
||||
|
||||
#define MODIFIED (1<<0)
|
||||
@@ -101,6 +110,7 @@ typedef struct shortcut {
|
||||
#define REGEXP_COMPILED (1<<15)
|
||||
#define TEMP_OPT (1<<16)
|
||||
#define CUT_TO_END (1<<17)
|
||||
#define DISABLE_CURPOS (1<<18)
|
||||
|
||||
/* Control key sequences, chaning these would be very very bad */
|
||||
|
||||
@@ -216,6 +226,16 @@ know what you're doing */
|
||||
#define NANO_ENTER_KEY NANO_CONTROL_M
|
||||
#define NANO_FROMSEARCHTOGOTO_KEY NANO_CONTROL_T
|
||||
|
||||
#define TOGGLE_CONST_KEY NANO_ALT_C
|
||||
#define TOGGLE_AUTOINDENT_KEY NANO_ALT_I
|
||||
#define TOGGLE_SUSPEND_KEY NANO_ALT_Z
|
||||
#define TOGGLE_NOHELP_KEY NANO_ALT_X
|
||||
#define TOGGLE_PICOMODE_KEY NANO_ALT_P
|
||||
#define TOGGLE_MOUSE_KEY NANO_ALT_M
|
||||
#define TOGGLE_CUTTOEND_KEY NANO_ALT_K
|
||||
#define TOGGLE_REGEXP_KEY NANO_ALT_E
|
||||
#define TOGGLE_WRAP_KEY NANO_ALT_W
|
||||
|
||||
#define MAIN_LIST_LEN 26
|
||||
#define MAIN_VISIBLE 12
|
||||
#define WHEREIS_LIST_LEN 6
|
||||
@@ -225,6 +245,12 @@ know what you're doing */
|
||||
#define HELP_LIST_LEN 3
|
||||
#define SPELL_LIST_LEN 3
|
||||
|
||||
#ifndef SMALL_NANO
|
||||
#define TOGGLE_LEN 9
|
||||
#else
|
||||
#define TOGGLE_LEN 6
|
||||
#endif
|
||||
|
||||
#define VIEW 1
|
||||
#define NOVIEW 0
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
$Id$
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# $Id$
|
||||
# Makefile for program source directory in GNU NLS utilities package.
|
||||
# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
|
||||
#
|
||||
@@ -111,9 +112,9 @@ install-data: install-data-@USE_NLS@
|
||||
install-data-no: all
|
||||
install-data-yes: all
|
||||
if test -r "$(MKINSTALLDIRS)"; then \
|
||||
$(MKINSTALLDIRS) $(datadir); \
|
||||
$(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
|
||||
else \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(datadir); \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \
|
||||
fi
|
||||
@catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
@@ -125,27 +126,30 @@ install-data-yes: all
|
||||
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
|
||||
dir=$$destdir/$$lang/LC_MESSAGES; \
|
||||
if test -r "$(MKINSTALLDIRS)"; then \
|
||||
$(MKINSTALLDIRS) $$dir; \
|
||||
$(MKINSTALLDIRS) $(DESTDIR)$$dir; \
|
||||
else \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$$dir; \
|
||||
fi; \
|
||||
if test -r $$cat; then \
|
||||
$(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
|
||||
echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
|
||||
$(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT); \
|
||||
echo "installing $$cat as" \
|
||||
"$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
|
||||
else \
|
||||
$(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
|
||||
$(INSTALL_DATA) $(srcdir)/$$cat \
|
||||
$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT); \
|
||||
echo "installing $(srcdir)/$$cat as" \
|
||||
"$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
|
||||
"$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
|
||||
fi; \
|
||||
if test -r $$cat.m; then \
|
||||
$(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
|
||||
echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
|
||||
$(INSTALL_DATA) $$cat.m $(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT).m; \
|
||||
echo "installing $$cat.m as" \
|
||||
"$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
|
||||
else \
|
||||
if test -r $(srcdir)/$$cat.m ; then \
|
||||
$(INSTALL_DATA) $(srcdir)/$$cat.m \
|
||||
$$dir/$(PACKAGE)$(INSTOBJEXT).m; \
|
||||
$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT).m; \
|
||||
echo "installing $(srcdir)/$$cat as" \
|
||||
"$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
|
||||
"$(DESTDIR)$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
|
||||
else \
|
||||
true; \
|
||||
fi; \
|
||||
@@ -153,12 +157,12 @@ install-data-yes: all
|
||||
done
|
||||
if test "$(PACKAGE)" = "gettext"; then \
|
||||
if test -r "$(MKINSTALLDIRS)"; then \
|
||||
$(MKINSTALLDIRS) $(gettextsrcdir); \
|
||||
$(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
|
||||
else \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
|
||||
fi; \
|
||||
$(INSTALL_DATA) $(srcdir)/Makefile.in.in \
|
||||
$(gettextsrcdir)/Makefile.in.in; \
|
||||
$(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# $Id$
|
||||
# List of source files containing translatable strings.
|
||||
|
||||
# Package source files
|
||||
|
||||
345
po/cat-id-tbl.c
345
po/cat-id-tbl.c
@@ -28,71 +28,80 @@ const struct _msg_ent _msg_tbl[] = {
|
||||
{"File Name to write", 19},
|
||||
{"filename is %s", 20},
|
||||
{"File exists, OVERWRITE ?", 21},
|
||||
{"Invoke the help menu", 22},
|
||||
{"Write the current file to disk", 23},
|
||||
{"Exit from nano", 24},
|
||||
{"Goto a specific line number", 25},
|
||||
{"Justify the current paragraph", 26},
|
||||
{"Replace text within the editor", 27},
|
||||
{"Insert another file into the current one", 28},
|
||||
{"Search for text within the editor", 29},
|
||||
{"Move to the previous screen", 30},
|
||||
{"Move to the next screen", 31},
|
||||
{"Cut the current line and store it in the cutbuffer", 32},
|
||||
{"Uncut from the cutbuffer into the current line", 33},
|
||||
{"Show the posititon of the cursor", 34},
|
||||
{"Invoke the spell checker (if available)", 35},
|
||||
{"Move up one line", 36},
|
||||
{"Move down one line", 37},
|
||||
{"Move forward one character", 38},
|
||||
{"Move back one character", 39},
|
||||
{"Move to the beginning of the current line", 40},
|
||||
{"Move to the end of the current line", 41},
|
||||
{"Go to the first line of the file", 42},
|
||||
{"Go to the last line of the file", 43},
|
||||
{"Refresh (redraw) the current screen", 44},
|
||||
{"Mark text at the current cursor location", 45},
|
||||
{"Delete the character under the cursor", 46},
|
||||
{"Delete the character to the left of the cursor", 47},
|
||||
{"Insert a tab character", 48},
|
||||
{"Insert a carriage return at the cursor position", 49},
|
||||
{"Make the current search or replace case (in)sensitive", 50},
|
||||
{"Cancel the current function", 51},
|
||||
{"Get Help", 52},
|
||||
{"WriteOut", 53},
|
||||
{"Exit", 54},
|
||||
{"Goto Line", 55},
|
||||
{"Justify", 56},
|
||||
{"Replace", 57},
|
||||
{"Read File", 58},
|
||||
{"Where Is", 59},
|
||||
{"Prev Page", 60},
|
||||
{"Next Page", 61},
|
||||
{"Cut Text", 62},
|
||||
{"UnCut Txt", 63},
|
||||
{"Cur Pos", 64},
|
||||
{"To Spell", 65},
|
||||
{"Up", 66},
|
||||
{"Down", 67},
|
||||
{"Forward", 68},
|
||||
{"Back", 69},
|
||||
{"Home", 70},
|
||||
{"End", 71},
|
||||
{"Refresh", 72},
|
||||
{"Mark Text", 73},
|
||||
{"Delete", 74},
|
||||
{"Backspace", 75},
|
||||
{"Tab", 76},
|
||||
{"Enter", 77},
|
||||
{"First Line", 78},
|
||||
{"Last Line", 79},
|
||||
{"Case Sens", 80},
|
||||
{"Cancel", 81},
|
||||
{"No Replace", 82},
|
||||
{"Constant cursor position", 22},
|
||||
{"Auto indent", 23},
|
||||
{"Suspend", 24},
|
||||
{"Help mode", 25},
|
||||
{"Pico messages", 26},
|
||||
{"Mouse support", 27},
|
||||
{"Cut to end", 28},
|
||||
{"Regular expressions", 29},
|
||||
{"Auto wrap", 30},
|
||||
{"Invoke the help menu", 31},
|
||||
{"Write the current file to disk", 32},
|
||||
{"Exit from nano", 33},
|
||||
{"Goto a specific line number", 34},
|
||||
{"Justify the current paragraph", 35},
|
||||
{"Replace text within the editor", 36},
|
||||
{"Insert another file into the current one", 37},
|
||||
{"Search for text within the editor", 38},
|
||||
{"Move to the previous screen", 39},
|
||||
{"Move to the next screen", 40},
|
||||
{"Cut the current line and store it in the cutbuffer", 41},
|
||||
{"Uncut from the cutbuffer into the current line", 42},
|
||||
{"Show the posititon of the cursor", 43},
|
||||
{"Invoke the spell checker (if available)", 44},
|
||||
{"Move up one line", 45},
|
||||
{"Move down one line", 46},
|
||||
{"Move forward one character", 47},
|
||||
{"Move back one character", 48},
|
||||
{"Move to the beginning of the current line", 49},
|
||||
{"Move to the end of the current line", 50},
|
||||
{"Go to the first line of the file", 51},
|
||||
{"Go to the last line of the file", 52},
|
||||
{"Refresh (redraw) the current screen", 53},
|
||||
{"Mark text at the current cursor location", 54},
|
||||
{"Delete the character under the cursor", 55},
|
||||
{"Delete the character to the left of the cursor", 56},
|
||||
{"Insert a tab character", 57},
|
||||
{"Insert a carriage return at the cursor position", 58},
|
||||
{"Make the current search or replace case (in)sensitive", 59},
|
||||
{"Cancel the current function", 60},
|
||||
{"Get Help", 61},
|
||||
{"WriteOut", 62},
|
||||
{"Exit", 63},
|
||||
{"Goto Line", 64},
|
||||
{"Justify", 65},
|
||||
{"Replace", 66},
|
||||
{"Read File", 67},
|
||||
{"Where Is", 68},
|
||||
{"Prev Page", 69},
|
||||
{"Next Page", 70},
|
||||
{"Cut Text", 71},
|
||||
{"UnCut Txt", 72},
|
||||
{"Cur Pos", 73},
|
||||
{"To Spell", 74},
|
||||
{"Up", 75},
|
||||
{"Down", 76},
|
||||
{"Forward", 77},
|
||||
{"Back", 78},
|
||||
{"Home", 79},
|
||||
{"End", 80},
|
||||
{"Refresh", 81},
|
||||
{"Mark Text", 82},
|
||||
{"Delete", 83},
|
||||
{"Backspace", 84},
|
||||
{"Tab", 85},
|
||||
{"Enter", 86},
|
||||
{"First Line", 87},
|
||||
{"Last Line", 88},
|
||||
{"Case Sens", 89},
|
||||
{"Cancel", 90},
|
||||
{"No Replace", 91},
|
||||
{"\
|
||||
\n\
|
||||
Buffer written to 'nano.save'\n", 83},
|
||||
{"Key illegal in VIEW mode", 84},
|
||||
Buffer written to 'nano.save'\n", 92},
|
||||
{"Key illegal in VIEW mode", 93},
|
||||
{"\
|
||||
nano help text\n\
|
||||
\n\
|
||||
@@ -105,114 +114,116 @@ bottom and shows important messages. The bottom two lines show the most \
|
||||
commonly used shortcuts in the editor.\n\
|
||||
\n\
|
||||
The notation for shortcuts is as follows: Control-key sequences are notated \
|
||||
with a caret (^) symbol. Alt-key sequences are notated with an at (@) \
|
||||
symbol. The following keystrokes are available in the main editor window. \
|
||||
Optional keys are shown in parentheses:\n\
|
||||
\n", 85},
|
||||
{"free_node(): free'd a node, YAY!\n", 86},
|
||||
{"free_node(): free'd last node.\n", 87},
|
||||
with a caret (^) symbol and are entered with the Control (Ctrl) key. \
|
||||
Escape-key sequences are notated with the Meta (M) symbol and can be entered \
|
||||
using either the Esc, Alt or Meta key depending on your keyboard setup. The \
|
||||
following keystrokes are available in the main editor window. Optional keys \
|
||||
are shown in parentheses:\n\
|
||||
\n", 94},
|
||||
{"free_node(): free'd a node, YAY!\n", 95},
|
||||
{"free_node(): free'd last node.\n", 96},
|
||||
{"\
|
||||
Usage: nano [GNU long option] [option] +LINE <file>\n\
|
||||
\n", 88},
|
||||
{"Option\t\tLong option\t\tMeaning\n", 89},
|
||||
{" -T \t\t--tabsize=[num]\t\tSet width of a tab to num\n", 90},
|
||||
{" -R\t\t--regexp\t\tUse regular expressions for search\n", 91},
|
||||
{" -V \t\t--version\t\tPrint version information and exit\n", 92},
|
||||
{" -c \t\t--const\t\t\tConstantly show cursor position\n", 93},
|
||||
{" -h \t\t--help\t\t\tShow this message\n", 94},
|
||||
{" -k \t\t--cut\t\t\tLet ^K cut from cursor to end of line\n", 95},
|
||||
{" -i \t\t--autoindent\t\tAutomatically indent new lines\n", 96},
|
||||
{" -l \t\t--nofollow\t\tDon't follow symbolic links, overwrite.\n", 97},
|
||||
{" -m \t\t--mouse\t\t\tEnable mouse\n", 98},
|
||||
\n", 97},
|
||||
{"Option\t\tLong option\t\tMeaning\n", 98},
|
||||
{" -T \t\t--tabsize=[num]\t\tSet width of a tab to num\n", 99},
|
||||
{" -R\t\t--regexp\t\tUse regular expressions for search\n", 100},
|
||||
{" -V \t\t--version\t\tPrint version information and exit\n", 101},
|
||||
{" -c \t\t--const\t\t\tConstantly show cursor position\n", 102},
|
||||
{" -h \t\t--help\t\t\tShow this message\n", 103},
|
||||
{" -k \t\t--cut\t\t\tLet ^K cut from cursor to end of line\n", 104},
|
||||
{" -i \t\t--autoindent\t\tAutomatically indent new lines\n", 105},
|
||||
{" -l \t\t--nofollow\t\tDon't follow symbolic links, overwrite.\n", 106},
|
||||
{" -m \t\t--mouse\t\t\tEnable mouse\n", 107},
|
||||
{"\
|
||||
-r [#cols] \t--fill=[#cols]\t\tSet fill cols to (wrap lines at) #cols\n", 99},
|
||||
{" -p\t \t--pico\t\t\tMake bottom 2 lines more Pico-like\n", 100},
|
||||
{" -s [prog] \t--speller=[prog]\tEnable alternate speller\n", 101},
|
||||
{" -t \t\t--tempfile\t\tAuto save on exit, don't prompt\n", 102},
|
||||
{" -v \t\t--view\t\t\tView (read only) mode\n", 103},
|
||||
{" -w \t\t--nowrap\t\tDon't wrap long lines\n", 104},
|
||||
{" -x \t\t--nohelp\t\tDon't show help window\n", 105},
|
||||
{" -z \t\t--suspend\t\tEnable suspend\n", 106},
|
||||
{" +LINE\t\t\t\t\tStart at line number LINE\n", 107},
|
||||
-r [#cols] \t--fill=[#cols]\t\tSet fill cols to (wrap lines at) #cols\n", 108},
|
||||
{" -p\t \t--pico\t\t\tMake bottom 2 lines more Pico-like\n", 109},
|
||||
{" -s [prog] \t--speller=[prog]\tEnable alternate speller\n", 110},
|
||||
{" -t \t\t--tempfile\t\tAuto save on exit, don't prompt\n", 111},
|
||||
{" -v \t\t--view\t\t\tView (read only) mode\n", 112},
|
||||
{" -w \t\t--nowrap\t\tDon't wrap long lines\n", 113},
|
||||
{" -x \t\t--nohelp\t\tDon't show help window\n", 114},
|
||||
{" -z \t\t--suspend\t\tEnable suspend\n", 115},
|
||||
{" +LINE\t\t\t\t\tStart at line number LINE\n", 116},
|
||||
{"\
|
||||
Usage: nano [option] +LINE <file>\n\
|
||||
\n", 108},
|
||||
{"Option\t\tMeaning\n", 109},
|
||||
{" -T [num]\tSet width of a tab to num\n", 110},
|
||||
{" -R\t\tUse regular expressions for search\n", 111},
|
||||
{" -V \t\tPrint version information and exit\n", 112},
|
||||
{" -c \t\tConstantly show cursor position\n", 113},
|
||||
{" -h \t\tShow this message\n", 114},
|
||||
{" -k \t\tLet ^K cut from cursor to end of line\n", 115},
|
||||
{" -i \t\tAutomatically indent new lines\n", 116},
|
||||
{" -l \t\tDon't follow symbolic links, overwrite.\n", 117},
|
||||
{" -m \t\tEnable mouse\n", 118},
|
||||
{" -r [#cols] \tSet fill cols to (wrap lines at) #cols\n", 119},
|
||||
{" -s [prog] \tEnable alternate speller\n", 120},
|
||||
{" -p \t\tMake bottom 2 lines more Pico-like\n", 121},
|
||||
{" -t \t\tAuto save on exit, don't prompt\n", 122},
|
||||
{" -v \t\tView (read only) mode\n", 123},
|
||||
{" -w \t\tDon't wrap long lines\n", 124},
|
||||
{" -x \t\tDon't show help window\n", 125},
|
||||
{" -z \t\tEnable suspend\n", 126},
|
||||
{" +LINE\t\tStart at line number LINE\n", 127},
|
||||
{" nano version %s by Chris Allegretta (compiled %s, %s)\n", 128},
|
||||
{" Email: nano@asty.org\tWeb: http://www.asty.org/nano\n", 129},
|
||||
{"Mark Set", 130},
|
||||
{"Mark UNset", 131},
|
||||
{"check_wrap called with inptr->data=\"%s\"\n", 132},
|
||||
{"current->data now = \"%s\"\n", 133},
|
||||
{"After, data = \"%s\"\n", 134},
|
||||
{"Error deleting tempfile, ack!", 135},
|
||||
{"Could not create a temporary filename: %s", 136},
|
||||
{"Could not invoke spell program \"%s\"", 137},
|
||||
{"Could not invoke \"ispell\"", 138},
|
||||
{"Finished checking spelling", 139},
|
||||
{"Save modified buffer (ANSWERING \"No\" WILL DESTROY CHANGES) ? ", 140},
|
||||
{"Cannot resize top win", 141},
|
||||
{"Cannot move top win", 142},
|
||||
{"Cannot resize edit win", 143},
|
||||
{"Cannot move edit win", 144},
|
||||
{"Cannot resize bottom win", 145},
|
||||
{"Cannot move bottom win", 146},
|
||||
{"Main: set up windows\n", 147},
|
||||
{"Main: bottom win\n", 148},
|
||||
{"Main: open file\n", 149},
|
||||
{"I got Alt-[-%c! (%d)\n", 150},
|
||||
{"I got Alt-%c! (%d)\n", 151},
|
||||
{"Case Sensitive Regexp Search%s%s", 152},
|
||||
{"Regexp Search%s%s", 153},
|
||||
{"Case Sensitive Search%s%s", 154},
|
||||
{"Search%s%s", 155},
|
||||
{" (to replace)", 156},
|
||||
{"Search Cancelled", 157},
|
||||
{"Search Wrapped", 158},
|
||||
{"Replaced %d occurences", 159},
|
||||
{"Replaced 1 occurence", 160},
|
||||
{"Replace Cancelled", 161},
|
||||
{"Replace with [%s]", 162},
|
||||
{"Replace with", 163},
|
||||
{"Replace this instance?", 164},
|
||||
{"Enter line number", 165},
|
||||
{"Aborted", 166},
|
||||
{"Come on, be reasonable", 167},
|
||||
{"Only %d lines available, skipping to last line", 168},
|
||||
{"actual_x_from_start for xplus=%d returned %d\n", 169},
|
||||
{"input '%c' (%d)\n", 170},
|
||||
{"New Buffer", 171},
|
||||
{" File: ...", 172},
|
||||
{"Modified", 173},
|
||||
{"Moved to (%d, %d) in edit buffer\n", 174},
|
||||
{"current->data = \"%s\"\n", 175},
|
||||
{"I got \"%s\"\n", 176},
|
||||
{"Yes", 177},
|
||||
{"All", 178},
|
||||
{"No", 179},
|
||||
{"do_cursorpos: linepct = %f, bytepct = %f\n", 180},
|
||||
{"line %d of %d (%.0f%%), character %d of %d (%.0f%%)", 181},
|
||||
{"Dumping file buffer to stderr...\n", 182},
|
||||
{"Dumping cutbuffer to stderr...\n", 183},
|
||||
{"Dumping a buffer to stderr...\n", 184},
|
||||
\n", 117},
|
||||
{"Option\t\tMeaning\n", 118},
|
||||
{" -T [num]\tSet width of a tab to num\n", 119},
|
||||
{" -R\t\tUse regular expressions for search\n", 120},
|
||||
{" -V \t\tPrint version information and exit\n", 121},
|
||||
{" -c \t\tConstantly show cursor position\n", 122},
|
||||
{" -h \t\tShow this message\n", 123},
|
||||
{" -k \t\tLet ^K cut from cursor to end of line\n", 124},
|
||||
{" -i \t\tAutomatically indent new lines\n", 125},
|
||||
{" -l \t\tDon't follow symbolic links, overwrite.\n", 126},
|
||||
{" -m \t\tEnable mouse\n", 127},
|
||||
{" -r [#cols] \tSet fill cols to (wrap lines at) #cols\n", 128},
|
||||
{" -s [prog] \tEnable alternate speller\n", 129},
|
||||
{" -p \t\tMake bottom 2 lines more Pico-like\n", 130},
|
||||
{" -t \t\tAuto save on exit, don't prompt\n", 131},
|
||||
{" -v \t\tView (read only) mode\n", 132},
|
||||
{" -w \t\tDon't wrap long lines\n", 133},
|
||||
{" -x \t\tDon't show help window\n", 134},
|
||||
{" -z \t\tEnable suspend\n", 135},
|
||||
{" +LINE\t\tStart at line number LINE\n", 136},
|
||||
{" nano version %s by Chris Allegretta (compiled %s, %s)\n", 137},
|
||||
{" Email: nano@asty.org\tWeb: http://www.asty.org/nano\n", 138},
|
||||
{"Mark Set", 139},
|
||||
{"Mark UNset", 140},
|
||||
{"check_wrap called with inptr->data=\"%s\"\n", 141},
|
||||
{"current->data now = \"%s\"\n", 142},
|
||||
{"After, data = \"%s\"\n", 143},
|
||||
{"Error deleting tempfile, ack!", 144},
|
||||
{"Could not create a temporary filename: %s", 145},
|
||||
{"Could not invoke spell program \"%s\"", 146},
|
||||
{"Could not invoke \"ispell\"", 147},
|
||||
{"Finished checking spelling", 148},
|
||||
{"Save modified buffer (ANSWERING \"No\" WILL DESTROY CHANGES) ? ", 149},
|
||||
{"Cannot resize top win", 150},
|
||||
{"Cannot move top win", 151},
|
||||
{"Cannot resize edit win", 152},
|
||||
{"Cannot move edit win", 153},
|
||||
{"Cannot resize bottom win", 154},
|
||||
{"Cannot move bottom win", 155},
|
||||
{"Main: set up windows\n", 156},
|
||||
{"Main: bottom win\n", 157},
|
||||
{"Main: open file\n", 158},
|
||||
{"I got Alt-[-%c! (%d)\n", 159},
|
||||
{"I got Alt-%c! (%d)\n", 160},
|
||||
{"Case Sensitive Regexp Search%s%s", 161},
|
||||
{"Regexp Search%s%s", 162},
|
||||
{"Case Sensitive Search%s%s", 163},
|
||||
{"Search%s%s", 164},
|
||||
{" (to replace)", 165},
|
||||
{"Search Cancelled", 166},
|
||||
{"Search Wrapped", 167},
|
||||
{"Replaced %d occurences", 168},
|
||||
{"Replaced 1 occurence", 169},
|
||||
{"Replace Cancelled", 170},
|
||||
{"Replace with [%s]", 171},
|
||||
{"Replace with", 172},
|
||||
{"Replace this instance?", 173},
|
||||
{"Enter line number", 174},
|
||||
{"Aborted", 175},
|
||||
{"Come on, be reasonable", 176},
|
||||
{"Only %d lines available, skipping to last line", 177},
|
||||
{"actual_x_from_start for xplus=%d returned %d\n", 178},
|
||||
{"input '%c' (%d)\n", 179},
|
||||
{"New Buffer", 180},
|
||||
{" File: ...", 181},
|
||||
{"Modified", 182},
|
||||
{"Moved to (%d, %d) in edit buffer\n", 183},
|
||||
{"current->data = \"%s\"\n", 184},
|
||||
{"I got \"%s\"\n", 185},
|
||||
{"Yes", 186},
|
||||
{"All", 187},
|
||||
{"No", 188},
|
||||
{"do_cursorpos: linepct = %f, bytepct = %f\n", 189},
|
||||
{"line %d of %d (%.0f%%), character %d of %d (%.0f%%)", 190},
|
||||
{"Dumping file buffer to stderr...\n", 191},
|
||||
{"Dumping cutbuffer to stderr...\n", 192},
|
||||
{"Dumping a buffer to stderr...\n", 193},
|
||||
};
|
||||
|
||||
int _msg_tbl_length = 184;
|
||||
int _msg_tbl_length = 193;
|
||||
|
||||
408
po/nano.pot
408
po/nano.pot
File diff suppressed because it is too large
Load Diff
7
proto.h
7
proto.h
@@ -1,3 +1,4 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* proto.h *
|
||||
* *
|
||||
@@ -32,7 +33,8 @@ extern int totsize, temp_opt;
|
||||
extern int fill, flags,tabsize;
|
||||
|
||||
extern WINDOW *edit, *topwin, *bottomwin;
|
||||
extern char *filename, *answer, *last_search, *last_replace;
|
||||
extern char filename[PATH_MAX];
|
||||
extern char answer[132];
|
||||
extern char *hblank, *help_text;
|
||||
extern struct stat fileinfo;
|
||||
extern filestruct *current, *fileage, *edittop, *editbot, *filebot;
|
||||
@@ -45,6 +47,7 @@ extern shortcut spell_list[SPELL_LIST_LEN];
|
||||
extern int use_regexp, regexp_compiled;
|
||||
extern regex_t search_regexp;
|
||||
extern regmatch_t regmatches[10];
|
||||
extern toggle toggles[TOGGLE_LEN];
|
||||
|
||||
/* Programs we want available */
|
||||
|
||||
@@ -79,7 +82,7 @@ void blank_bottombars(void);
|
||||
void check_wrap(filestruct * inptr, char ch);
|
||||
void dump_buffer(filestruct * inptr);
|
||||
void align(char **strp);
|
||||
void edit_refresh(void);
|
||||
void edit_refresh(void), edit_refresh_clearok(void);
|
||||
void edit_update(filestruct * fileptr, int topmidbot);
|
||||
void update_cursor(void);
|
||||
void delete_node(filestruct * fileptr);
|
||||
|
||||
22
search.c
22
search.c
@@ -1,3 +1,4 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* search.c *
|
||||
* *
|
||||
@@ -33,6 +34,9 @@
|
||||
#define _(string) (string)
|
||||
#endif
|
||||
|
||||
static char last_search[132]; /* Last string we searched for */
|
||||
static char last_replace[132]; /* Last replacement string */
|
||||
|
||||
/* Regular expression helper functions */
|
||||
|
||||
#ifdef _POSIX_VERSION
|
||||
@@ -130,7 +134,7 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle)
|
||||
char *searchstr, *found = NULL, *tmp;
|
||||
int past_editbot = 0;
|
||||
|
||||
fileptr = current;
|
||||
fileptr = begin;
|
||||
|
||||
searchstr = ¤t->data[current_x + 1];
|
||||
/* Look for searchstr until EOF */
|
||||
@@ -158,22 +162,23 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle)
|
||||
|
||||
if (past_editbot)
|
||||
edit_update(current, CENTER);
|
||||
placewewant = xplustabs();
|
||||
reset_cursor();
|
||||
} else { /* We're at EOF, go back to the top, once */
|
||||
|
||||
fileptr = fileage;
|
||||
|
||||
while (fileptr != current && fileptr != begin &&
|
||||
while (fileptr != begin->next &&
|
||||
(found = strstrwrapper(fileptr->data, needle)) == NULL)
|
||||
fileptr = fileptr->next;
|
||||
|
||||
if (fileptr == begin) {
|
||||
if (fileptr == begin->next) {
|
||||
if (!quiet)
|
||||
statusbar(_("\"%s\" not found"), needle);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
if (fileptr != current) { /* We found something */
|
||||
else { /* We found something */
|
||||
current = fileptr;
|
||||
current_x = 0;
|
||||
for (tmp = fileptr->data; tmp != found; tmp++)
|
||||
@@ -184,12 +189,7 @@ filestruct *findnextstr(int quiet, filestruct * begin, char *needle)
|
||||
|
||||
if (!quiet)
|
||||
statusbar(_("Search Wrapped"));
|
||||
} else { /* Nada */
|
||||
|
||||
if (!quiet)
|
||||
statusbar(_("\"%s\" not found"), needle);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return fileptr;
|
||||
@@ -200,6 +200,8 @@ void search_abort(void)
|
||||
UNSET(KEEP_CUTBUFFER);
|
||||
display_main_list();
|
||||
wrefresh(bottomwin);
|
||||
if (ISSET(MARK_ISSET))
|
||||
edit_refresh_clearok();
|
||||
|
||||
#ifdef _POSIX_VERSION
|
||||
if (ISSET(REGEXP_COMPILED))
|
||||
|
||||
1
utils.c
1
utils.c
@@ -1,3 +1,4 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* utils.c *
|
||||
* *
|
||||
|
||||
20
winio.c
20
winio.c
@@ -1,3 +1,4 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* winio.c *
|
||||
* *
|
||||
@@ -461,7 +462,7 @@ void onekey(char *keystroke, char *desc)
|
||||
{
|
||||
char description[80];
|
||||
|
||||
snprintf(description, 12, " %-11s", desc);
|
||||
snprintf(description, 13, " %-11s", desc);
|
||||
wattron(bottomwin, A_REVERSE);
|
||||
waddstr(bottomwin, keystroke);
|
||||
wattroff(bottomwin, A_REVERSE);
|
||||
@@ -779,6 +780,11 @@ void update_line(filestruct * fileptr, int index)
|
||||
virt_cur_x--;
|
||||
if (i < mark_beginx)
|
||||
virt_mark_beginx--;
|
||||
}
|
||||
else if (realdata[i] >= 1 && realdata[i] <= 26) {
|
||||
/* Treat control characters as ^letter */
|
||||
fileptr->data[pos++] = '^';
|
||||
fileptr->data[pos++] = realdata[i] + 64;
|
||||
} else {
|
||||
fileptr->data[pos++] = realdata[i];
|
||||
}
|
||||
@@ -861,6 +867,16 @@ void edit_refresh(void)
|
||||
editbot = temp;
|
||||
}
|
||||
|
||||
/*
|
||||
* Same as above, but touch the window first so everything is redrawn.
|
||||
*/
|
||||
void edit_refresh_clearok(void)
|
||||
{
|
||||
clearok(edit, TRUE);
|
||||
edit_refresh();
|
||||
clearok(edit, FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Nice generic routine to update the edit buffer given a pointer to the
|
||||
* file struct =)
|
||||
@@ -1073,7 +1089,7 @@ int total_refresh(void)
|
||||
clearok(edit, FALSE);
|
||||
clearok(topwin, FALSE);
|
||||
clearok(bottomwin, FALSE);
|
||||
|
||||
edit_refresh();
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user