Compare commits
53 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
133f7b16ea | ||
|
|
8bbd1eb89f | ||
|
|
f6cf4a7d7c | ||
|
|
13dfdb2493 | ||
|
|
699412175d | ||
|
|
3a420879d6 | ||
|
|
c1f630e914 | ||
|
|
5f34d6e3b0 | ||
|
|
25307257c9 | ||
|
|
bb7e2cbfad | ||
|
|
f5b256bb9f | ||
|
|
4dcd070cdf | ||
|
|
0362c58b37 | ||
|
|
99bede34e7 | ||
|
|
2dd7ed14bc | ||
|
|
f03c78b382 | ||
|
|
5dcba30395 | ||
|
|
7bf00de84f | ||
|
|
a3831ab2b8 | ||
|
|
f0b7dcaa99 | ||
|
|
9eff7465d9 | ||
|
|
da8fd8f894 | ||
|
|
5ffbec56f6 | ||
|
|
b23554fa25 | ||
|
|
1356a0a72d | ||
|
|
c97acfb2d6 | ||
|
|
14509a3aa2 | ||
|
|
7f47d42289 | ||
|
|
d91ab6e912 | ||
|
|
dc9c40a56d | ||
|
|
e0a9f50a64 | ||
|
|
298b975264 | ||
|
|
417b03a4c3 | ||
|
|
21cc550752 | ||
|
|
3bd9628b38 | ||
|
|
74ea836fcc | ||
|
|
8faf305d0c | ||
|
|
954b00de74 | ||
|
|
79c849a4a9 | ||
|
|
cb7ee0e491 | ||
|
|
aaad3af523 | ||
|
|
ec290f2385 | ||
|
|
27863665ca | ||
|
|
ba6fd42b3c | ||
|
|
e04970675f | ||
|
|
222feaa953 | ||
|
|
10187610f8 | ||
|
|
a9cebd8054 | ||
|
|
4d7c260270 | ||
|
|
f3fee5db91 | ||
|
|
21599f805b | ||
|
|
6954f05276 | ||
|
|
194c26f879 |
@@ -18,10 +18,7 @@ depcomp
|
||||
install-sh
|
||||
missing
|
||||
mkinstalldirs
|
||||
nano
|
||||
nano.info
|
||||
nano.spec
|
||||
stamp-h
|
||||
stamp-h.in
|
||||
stamp-h1
|
||||
texinfo.tex
|
||||
|
||||
13
AUTHORS
13
AUTHORS
@@ -4,7 +4,13 @@ editor. Please see the ChangeLog for specific changes by author.
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
Chris Allegretta <chrisa@asty.org>
|
||||
* Main program author and maintainer.
|
||||
* Original program author, stable series maintainer.
|
||||
|
||||
David Lawrence Ramsey <pooka_regent@sluggy.net>
|
||||
* Development series maintainer. Multiple buffer support,
|
||||
operating dir (-o) option, bug fixes for display routines,
|
||||
wrapping code, spelling fixes, const mode and various other
|
||||
fixes.
|
||||
|
||||
Jordi Mallach <jordi@sindominio.net>
|
||||
* Debian package maintainer, fellow bug squasher.
|
||||
@@ -25,11 +31,6 @@ Rocco Corsi <rocco.corsi@sympatico.ca>
|
||||
findnextstr and search-related functions, various display and
|
||||
file handling fixes.
|
||||
|
||||
David Lawrence Ramsey <pooka_regent@sluggy.net>
|
||||
* Multiple buffer support, operating dir (-o) option, bug fixes
|
||||
for display routines, wrapping code, spelling fixes, const
|
||||
mode and various other fixes.
|
||||
|
||||
David Benbennick <dbenbenn@math.cornell.edu>
|
||||
* Wrap and justify bugfixes/enhancements, new color syntax
|
||||
code, memleak fixes and other miscellaneous fixes.
|
||||
|
||||
205
ChangeLog
205
ChangeLog
@@ -1,3 +1,208 @@
|
||||
GNU nano 1.3.0 - 2003.10.22
|
||||
- General:
|
||||
- Complete overhaul and abstraction of the lowest level of
|
||||
keyboard input, mostly rewritten but incorporating a few bits
|
||||
from the old functions and adding support for Pico's Esc Esc
|
||||
[three-digit decimal ASCII code] input method. New functions
|
||||
get_kbinput(), get_verbatim_kbinput(), get_ignored_kbinput(),
|
||||
get_accepted_kbinput(), get_ascii_kbinput(),
|
||||
get_escape_seq_kbinput(), and get_skip_tilde_kbinput(). These
|
||||
should work properly on FreeBSD (due to code and input
|
||||
provided by Lee Nelson and Wouter van Hemel, respectively).
|
||||
(DLR)
|
||||
- The -K/--keypad command line/rcfile option has been removed,
|
||||
and keypad() is now always TRUE. keypad_on() in winio.c and
|
||||
the check for _use_keypad in configure.ac have both been
|
||||
removed. (DLR)
|
||||
- The -d/--rebinddelete command line/rcfile option, equivalent
|
||||
to Pico's -d, has been added. It is intended to work around
|
||||
the problem with Backspace/Delete confusion on some terminals,
|
||||
notably FreeBSD; if your Backspace key acts like Delete, this
|
||||
option will fix that. (DLR)
|
||||
- Remove unneeded breaks at the ends of default: clauses. (DLR)
|
||||
- Add the ability to repeat the last search without prompting
|
||||
via Meta-W, and move the line wrapping toggle to Meta-L. New
|
||||
function do_research(). (Wouter van Hemel)
|
||||
- Added the ability to move to the beginning or end of the
|
||||
paragraph, which Pico has via ^W^W (previous paragraph)
|
||||
and ^W^O (next paragraph). Modifications to do_justify(),
|
||||
new functions do_para_operation(), do_para_begin(), and
|
||||
do_para_end(). Note that the last three functions are
|
||||
disabled if justification is disabled. (DLR)
|
||||
- Make sure the "historylog" option isn't included at all if
|
||||
NANO_SMALL is defined. (DLR)
|
||||
- Source reorganization: move code to src/, docs to doc/.
|
||||
(Jordi)
|
||||
- Translation updates (see po/ChangeLog for details).
|
||||
- Since SAMELINEWRAP is only used in nano.c, make it a static
|
||||
variable in nano.c instead of a flag, and surround all
|
||||
wrap_reset() calls with DISABLE_WRAPPING #ifdefs. (DLR)
|
||||
- Change enum "topmidbotnone" to "topmidnone", as there's no
|
||||
BOTTOM option anymore. (DLR)
|
||||
- Split out the string-displaying routine from update_line()
|
||||
into a separate function; convert the edit window, statusbar
|
||||
display, and statusbar prompt to use it, so that they can all
|
||||
properly display control characters and tabs; free and NULL
|
||||
the backup search string in one place in the search code
|
||||
instead of several; and do some other minor refactoring of
|
||||
related display functions to simplify them. New functions
|
||||
mark_order() and display_string(); changes to actual_x(),
|
||||
strnlenpt(), blank_bottombars(), blank_edit(),
|
||||
get_page_start(), edit_add(), update_line(), statusbar(), and
|
||||
do_replace_highlight(). (David Benbennick) DLR: Add minor
|
||||
cosmetic tweaks, add missing NANO_SMALL #ifdef around the text
|
||||
for a backwards search in the refactored code, and enclose
|
||||
dump_buffer() and dump_buffer_reverse() in one ENABLE_DEBUG
|
||||
#ifdef instead of two.
|
||||
- Convert memmove() function calls to charmove() macro calls, as
|
||||
the former all work on char*'s. (DLR)
|
||||
- Miscellaneous #define cleanups: only include the prototype for
|
||||
and definition of wrap_at if wrapping and/or justification are
|
||||
enabled, remove duplicate wrap_at prototype, and define
|
||||
DISABLE_MOUSE if NCURSES_MOUSE_VERSION isn't defined in nano.h
|
||||
instead of all over the code. (DLR)
|
||||
- Autogenerate the html versions of the manpages in the
|
||||
Makefile.am's in doc/man/, make sure that they're properly
|
||||
installed via "make dist", and make sure that "make distcheck"
|
||||
works too. Also be sure to set EXTRA_DIST properly. (Jordi,
|
||||
DLR and Jeff Bailey)
|
||||
- files.c:
|
||||
read_file()
|
||||
- After we've read in a file and possibly converted it from
|
||||
DOS/Mac format, set fileformat back to 0 to prevent erroneous
|
||||
conversion messages when we read other files in. (DLR)
|
||||
do_browser()
|
||||
- Some of the Pico compatibility options in the file browser
|
||||
that don't work properly for current Pico have been removed.
|
||||
Backspace, 'g', 'l', 'q', and 'u' are invalid. 'd' deletes
|
||||
the highlighted file, and 'r' renames the highlighted file;
|
||||
neither of these are implemented. (DLR)
|
||||
- global.c:
|
||||
toggle_init()
|
||||
- Change the message for the line wrapping toggle from "Auto
|
||||
wrap" to "Auto line wrap", to more clearly associate it with
|
||||
Meta-L. (DLR)
|
||||
shortcut_init()
|
||||
- Change multibuffer-enabled references to
|
||||
opening/closing/toggling the previous/next loaded file to
|
||||
toggling/switching to/closing the previous/next file buffer,
|
||||
for consistency with other references. (DLR)
|
||||
- nano.c:
|
||||
window_init()
|
||||
- Set keypad() to TRUE regardless of whether PDCurses is being
|
||||
used, as Meta-X apparently turns it off even under ncurses.
|
||||
(DLR)
|
||||
do_backspace()
|
||||
- Vastly simplify, and remove dependency on page_up(). (David
|
||||
Benbennick)
|
||||
help_init()
|
||||
- Document the support for Esc Esc [character]'s being
|
||||
interpreted as Ctrl-[character], and the support for Pico's
|
||||
Esc Esc [three-digit decimal ASCII code] input method. (DLR)
|
||||
do_mark()
|
||||
- Toggle MARK_ISSET() at the beginning of the function instead
|
||||
of setting it in one place and unsetting it in another place.
|
||||
(David Benbennick)
|
||||
do_suspend()
|
||||
- Use handle_hupterm() to handle SIGHUP and SIGTERM so we can
|
||||
properly deal with them while nano is suspended. (DLR; problem
|
||||
found by David Benbennick)
|
||||
abcd()
|
||||
- Removed, as it's unneeded due to the low-level input overhaul.
|
||||
(DLR)
|
||||
- nano.h:
|
||||
- Define KEY_RESIZE and KEY_SUSPEND as -1 when slang is used, as
|
||||
slang has no equivalent of either. When nano is compiled with
|
||||
slang support, resizing the window doesn't generate
|
||||
KEY_RESIZE, and pressing Ctrl-Z to suspend nano at the Linux
|
||||
console with keypad(TRUE) generates Ctrl-Z instead of
|
||||
KEY_SUSPEND, both unlike ncurses. (DLR)
|
||||
- Define KEY_RESIZE as -1 if it isn't defined, as it isn't in
|
||||
the curses library included with SunOS 5.7-5.9. Also define
|
||||
KEY_SUSPEND as -1 if it isn't defined, in case it isn't in
|
||||
more than just Slang. (DLR)
|
||||
- Define all potentially missing keys as different negative
|
||||
values (ERR is -1, so use -2, -3, etc.) so as to avoid having
|
||||
duplicate case values when keys are missing. (DLR)
|
||||
- move.c:
|
||||
- Remove unneeded inclusion of stdio.h, make various cleanups,
|
||||
and preserve the cursor's coordinates when paging up and down.
|
||||
(David Benbennick) DLR: Readd the ability to behave the old
|
||||
way while paging, make it so the new behavior is only used in
|
||||
smooth-scrolling mode, and modify page_down() to always go
|
||||
down a full page (even when there's less than one page of text
|
||||
left) for consistency.
|
||||
page_up()
|
||||
- Removed due to rewrite of movement functions. (David
|
||||
Benbennick)
|
||||
- proto.h:
|
||||
- Surround the do_prev_word() and do_next_word() prototypes with
|
||||
NANO_SMALL #ifdefs, since the actual functions aren't included
|
||||
in tiny mode. (DLR)
|
||||
- rcfile.c:
|
||||
parse_colors()
|
||||
- Generate an error if we try to use a bright background color
|
||||
in a nanorc file. (DLR; found by Brand Huntsman)
|
||||
- Make sure all rcfile error messages are capitalized, for
|
||||
consistency. (DLR)
|
||||
- winio.c:
|
||||
get_verbatim_kbinput()
|
||||
- Fix a silly memory corruption bug that would occur when trying
|
||||
to read a sequence of more than one key verbatim. (DLR)
|
||||
get_accepted_kbinput()
|
||||
Handle Ctrl-{ to Ctrl-~ correctly, and drop support for
|
||||
converting Esc ` to Esc Space, since making Meta-[key]
|
||||
correspond to Ctrl-[key] in all cases is inconsistent due to
|
||||
the different natures of Contol and Meta key sequences. (DLR)
|
||||
do_first_line()
|
||||
- Call edit_update() with TOP instead of CENTER; both do the
|
||||
same thing, but it works faster with TOP. (DLR)
|
||||
nanogetstr()
|
||||
- Don't let the user type in ASCII 127 at the statusbar prompt.
|
||||
(DLR)
|
||||
titlebar()
|
||||
- Fix problem with the available space for a filename on the
|
||||
titlebar's being short by one. (DLR)
|
||||
edit_add()
|
||||
- Fix problems with the marking highlight's being drawn
|
||||
improperly in some cases. (DLR)
|
||||
edit_update()
|
||||
- Tweak for efficiency and remove the fix_editbot() call. (David
|
||||
Benbennick)
|
||||
do_credits()
|
||||
- Update the copyright years to "1999-2003", to match those
|
||||
given in the rest of the code. (DLR)
|
||||
- configure.ac:
|
||||
- Change instances of "GNU Nano" to "GNU nano" for consistency.
|
||||
(DLR)
|
||||
- nano.1, nanorc.5, nano.texi:
|
||||
- Change all instances of $SYSCONFDIR to SYSCONFDIR, since
|
||||
SYSCONFDIR is set at compile time and can't be overridden by
|
||||
setting SYSCONFDIR in the environment. (David Benbennick)
|
||||
- Remove -K/--keypad, and document -d/--rebinddelete. (DLR)
|
||||
- Document the support for Esc Esc [character]'s being
|
||||
interpreted as Ctrl-[character], and the support for Pico's
|
||||
Esc Esc [three-digit decimal ASCII code] input method, if
|
||||
applicable. (DLR)
|
||||
- French translation by Jean-Philippe Guérard.
|
||||
- nano.1.html, nanorc.5.html:
|
||||
- Regenerated. (DLR)
|
||||
- nanorc.sample:
|
||||
- Remove duplicate "historylog" entry, remove "keypad" entry,
|
||||
and add "rebinddelete" entry. (DLR)
|
||||
- Update and add comments to the regexes for nanorc files.
|
||||
(Brand Huntsman)
|
||||
- Fix an attempt at a bright background color in the sample Java
|
||||
source regexes. (DLR)
|
||||
- Since tabs are shown as groups of spaces, they are interpreted
|
||||
as such when parsed by color regexes. Accordingly, simplify
|
||||
regexes that handle both spaces and tabs to just handle
|
||||
spaces, as the results are the same. (DLR)
|
||||
- AUTHORS
|
||||
- Updated to show 1.2/1.3 maintainers.
|
||||
|
||||
- 1.3 tree forks here
|
||||
|
||||
GNU nano 1.2.2 - 2003.08.11
|
||||
- General:
|
||||
- Translation updates (see po/ChangeLog for details).
|
||||
|
||||
29
Makefile.am
29
Makefile.am
@@ -1,36 +1,11 @@
|
||||
## $Id$
|
||||
AUTOMAKE_OPTIONS = gnu no-dependencies
|
||||
|
||||
DEFS= -DSYSCONFDIR=\"$(sysconfdir)\"
|
||||
SUBDIRS = doc m4 po src
|
||||
|
||||
bin_PROGRAMS = nano
|
||||
nano_SOURCES = color.c \
|
||||
cut.c \
|
||||
files.c \
|
||||
global.c \
|
||||
move.c \
|
||||
nano.c \
|
||||
nano.h \
|
||||
proto.h \
|
||||
rcfile.c \
|
||||
search.c \
|
||||
utils.c \
|
||||
winio.c
|
||||
|
||||
man_MANS = nano.1 nanorc.5
|
||||
nano_LDADD = @GLIB_LIBS@ @LIBINTL@
|
||||
|
||||
info_TEXINFOS = nano.texi
|
||||
MAKEINFO = makeinfo --no-split
|
||||
|
||||
EXTRA_DIST = ABOUT-NLS AUTHORS BUGS COPYING ChangeLog INSTALL NEWS \
|
||||
README THANKS TODO UPGRADE config.rpath install-sh missing \
|
||||
mkinstalldirs nano.1.html nanorc.5.html faq.html \
|
||||
nanorc.sample nano.spec $(man_MANS)
|
||||
|
||||
SUBDIRS = po m4
|
||||
|
||||
localedir = $(datadir)/locale
|
||||
INCLUDES = -Iintl -DLOCALEDIR=\"$(localedir)\" -I@includedir@
|
||||
mkinstalldirs nano.spec
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
12
NEWS
12
NEWS
@@ -1,3 +1,15 @@
|
||||
2003.10.22 - GNU nano 1.3.0 is loosed upon the world. This is the first
|
||||
release in the unstable 1.3.x series, and as such it
|
||||
includes a lot of new features, including the addition
|
||||
of a -d option for those FreeBSD users with Backspace
|
||||
keys that act like Delete keys, the ability to repeat
|
||||
the last search without prompting, the ability to search
|
||||
for the beginning or end of a paragraph, new smooth
|
||||
paging routines to go with the smooth scrolling
|
||||
routines, and various improvements to the input and
|
||||
display routines to make them behave more intuitively.
|
||||
It also includes the usual load of bugfixes. Enjoy.
|
||||
|
||||
2003.08.11 - GNU nano 1.2.2 is released, only four months since the
|
||||
last version :-). This release includes fixes for
|
||||
broken regex detection, search history recall, and
|
||||
|
||||
3
TODO
3
TODO
@@ -3,7 +3,7 @@ TODO file (? means the feature may be implemented, but not definitely)
|
||||
|
||||
For version 1.4:
|
||||
- UTF-8 support.
|
||||
- Support for Pico's paragraph searching ability.
|
||||
- Support for Pico's paragraph searching ability. [DONE]
|
||||
- Undo/Redo key?
|
||||
- Rebindable keys?
|
||||
- Keystroke to implement "Add next sequence as raw" like vi's ^V.
|
||||
@@ -13,6 +13,7 @@ For version 1.4:
|
||||
(^R^X^X)(requires figuring out when to keep cursor pos and when not
|
||||
to).
|
||||
- Fix resetstatuspos global which we shouldn't have.
|
||||
- Rewrite the nano FAQ in SGML.
|
||||
|
||||
Old requests:
|
||||
|
||||
|
||||
37
configure.ac
37
configure.ac
@@ -2,25 +2,25 @@
|
||||
#
|
||||
# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
#
|
||||
# GNU Nano is free software; you can redistribute it and/or modify
|
||||
# GNU nano is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# GNU Nano is distributed in the hope that it will be useful,
|
||||
# GNU nano is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Nano; if not, write to the Free Software
|
||||
# along with GNU nano; if not, write to the Free Software
|
||||
# Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# $Id$
|
||||
|
||||
AC_INIT([GNU Nano], [1.2.2], [nano-devel@gnu.org], [nano])
|
||||
AC_CONFIG_SRCDIR([nano.c])
|
||||
AC_INIT([GNU nano], [1.3.0], [nano-devel@gnu.org], [nano])
|
||||
AC_CONFIG_SRCDIR([src/nano.c])
|
||||
AM_INIT_AUTOMAKE
|
||||
AM_CONFIG_HEADER([config.h:config.h.in])
|
||||
|
||||
@@ -330,20 +330,6 @@ AC_CHECK_LIB([$CURSES_LIB_NAME], use_default_colors, AC_DEFINE(HAVE_USE_DEFAULT_
|
||||
if test x$slang_support != xyes; then
|
||||
AC_CHECK_LIB([$CURSES_LIB_NAME], wresize, AC_DEFINE(HAVE_WRESIZE, 1, [Define this if you have the wresize function in your ncurses-type library.]))
|
||||
AC_CHECK_LIB([$CURSES_LIB_NAME], resizeterm, AC_DEFINE(HAVE_RESIZETERM, 1, [Define this if you have the resizeterm function in your ncurses-type library.]))
|
||||
|
||||
# Taken from aumix (can't tell from the variable name?)
|
||||
AC_CACHE_CHECK([for private member _use_keypad in WINDOW],
|
||||
aumix_cv_struct_window_usekeypad,
|
||||
[AC_TRY_COMPILE([#ifdef HAVE_NCURSES_H
|
||||
#include <ncurses.h>
|
||||
#else
|
||||
#include <curses.h>
|
||||
#endif], [WINDOW w; w._use_keypad;],
|
||||
aumix_cv_struct_window_usekeypad=yes, aumix_cv_struct_window_usekeypad=no)])
|
||||
|
||||
if test $aumix_cv_struct_window_usekeypad = yes; then
|
||||
AC_DEFINE(HAVE_USEKEYPAD, 1, [Define this if your curses lib has the _use_keypad flag.])
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Parse any configure options
|
||||
@@ -361,5 +347,16 @@ then
|
||||
LDFLAGS="$LDFLAGS $glib_libs"
|
||||
fi
|
||||
|
||||
AC_CONFIG_FILES([Makefile m4/Makefile po/Makefile.in nano.spec])
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
doc/Makefile
|
||||
doc/man/Makefile
|
||||
doc/man/fr/Makefile
|
||||
doc/texinfo/Makefile
|
||||
m4/Makefile
|
||||
po/Makefile.in
|
||||
src/Makefile
|
||||
nano.spec
|
||||
])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
2
doc/.cvsignore
Normal file
2
doc/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
3
doc/Makefile.am
Normal file
3
doc/Makefile.am
Normal file
@@ -0,0 +1,3 @@
|
||||
SUBDIRS = man texinfo
|
||||
|
||||
EXTRA_DIST = faq.html nanorc.sample
|
||||
@@ -78,7 +78,7 @@
|
||||
<h2><a name="1.5"></a>1.5. Why the name change from TIP?</h2>
|
||||
<blockquote><p>On January 10, 2000, TIP was officially renamed to nano because of a namespace conflict with another program called 'tip'. The original 'tip' program "establishes a full duplex terminal connection to a remote host", and was included with many older Unix systems (and newer ones like Solaris). The conflict was not noticed at first because there is no 'tip' utility included with most GNU/Linux distributions (where nano was developed).</p></blockquote>
|
||||
<h2><a name="1.6"></a>1.6. What is the current version of nano?</h2>
|
||||
<blockquote><p>The current version of nano *should* be 1.2.2. Of course you should always check the nano homepage to see what the latest and greatest version is.</p></blockquote>
|
||||
<blockquote><p>The current version of nano *should* be 1.3.0. Of course you should always check the nano homepage to see what the latest and greatest version is.</p></blockquote>
|
||||
<h2><a name="1.7"></a>1.7. I want to read the man page without having to download the program!</h2>
|
||||
<blockquote><p>Jeez, demanding, aren't we? Okay, look <a href="http://www.nano-editor.org/dist/v1.2/nano.1.html">here</a>.</p></blockquote>
|
||||
<hr width="100%">
|
||||
4
doc/man/.cvsignore
Normal file
4
doc/man/.cvsignore
Normal file
@@ -0,0 +1,4 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
nanorc.5.html
|
||||
nano.1.html
|
||||
12
doc/man/Makefile.am
Normal file
12
doc/man/Makefile.am
Normal file
@@ -0,0 +1,12 @@
|
||||
SUBDIRS = fr
|
||||
|
||||
man_MANS = nano.1 nanorc.5
|
||||
|
||||
BUILT_SOURCES = nano.1.html nanorc.5.html
|
||||
|
||||
nano.1.html: nano.1
|
||||
cat $< | groff -t -mandoc -Thtml > $@
|
||||
nanorc.5.html: nanorc.5
|
||||
cat $< | groff -t -mandoc -Thtml > $@
|
||||
|
||||
EXTRA_DIST = $(man_MANS) $(BUILT_SOURCES)
|
||||
4
doc/man/fr/.cvsignore
Normal file
4
doc/man/fr/.cvsignore
Normal file
@@ -0,0 +1,4 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
nanorc.5.html
|
||||
nano.1.html
|
||||
10
doc/man/fr/Makefile.am
Normal file
10
doc/man/fr/Makefile.am
Normal file
@@ -0,0 +1,10 @@
|
||||
man_MANS = nano.1 nanorc.5
|
||||
|
||||
BUILT_SOURCES = nano.1.html nanorc.5.html
|
||||
|
||||
nano.1.html: nano.1
|
||||
cat $< | groff -t -mandoc -Thtml > $@
|
||||
nanorc.5.html: nanorc.5
|
||||
cat $< | groff -t -mandoc -Thtml > $@
|
||||
|
||||
EXTRA_DIST = $(man_MANS) $(BUILT_SOURCES)
|
||||
229
doc/man/fr/nano.1
Normal file
229
doc/man/fr/nano.1
Normal file
@@ -0,0 +1,229 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" nano.1 is copyright (C) 1999, 2000, 2001, 2002, 2003 by
|
||||
.\" Chris Allegretta <chrisa@asty.org>
|
||||
.\"
|
||||
.\" (c) 2003 Jean-Philippe Guérard <jean-philippe.guerard@corbeaunoir.org>
|
||||
.\" pour l'adaptation française
|
||||
.\"
|
||||
.\" This is free documentation, see the latest version of the GNU General
|
||||
.\" Public License for copying conditions. There is NO warranty.
|
||||
.\"
|
||||
.\" Ce document est libre. Reportez-vous à la dernière version de la
|
||||
.\" licence publique générale GNU (GNU GPL) pour connaître ses
|
||||
.\" conditions d'utilisation. AUCUNE garantie n'est offerte.
|
||||
.\"
|
||||
.TH NANO 1 "19 juin 2003 (v.f. du 25 août 2003)"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\" Merci de modifier ces dates à chaque mise à jour de cette page.
|
||||
|
||||
.SH NOM
|
||||
nano \- NAno un NOuvel éditeur, un clone libre et amélioré de Pico
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B nano
|
||||
.I [\+LIGNE]\ [options]\ [fichier]
|
||||
.br
|
||||
|
||||
.SH DESCRIPTION
|
||||
Cette page de manuel décrit brièvement la commande \fBnano\fP.
|
||||
.PP
|
||||
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
|
||||
.\" \fI<whatever>\fP escape sequences to invoke bold face and italics,
|
||||
.\" respectively.
|
||||
\fBnano\fP est un petit éditeur sympathique et libre, qui vise à remplacer
|
||||
Pico, l'éditeur par défaut du paquet non-libre Pine. \fBnano\fP ne se
|
||||
contentant pas de copier l'interface et l'ergonomie de Pico, il offre
|
||||
également certaines fonctionnalités manquantes (ou désactivées par
|
||||
défaut) de Pico. Ces fonctionnalités sont, par exemple, les fonctions de
|
||||
recherche et de remplacement, et la possibilité de sauter directement à
|
||||
un numéro de ligne.
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \+\fILIGNE\fP
|
||||
Démarre avec le curseur positionné à la ligne numéro \fILIGNE\fP.
|
||||
.TP
|
||||
.B \-B (\-\-backup)
|
||||
Lors de l'écriture d'un fichier, crée une copie de sécurité de la
|
||||
version précédente, en ajoutant un tilde (~) au nom du fichier.
|
||||
.TP
|
||||
.B \-D (\-\-dos)
|
||||
Écrit le fichier au format DOS.
|
||||
.TP
|
||||
.B \-F (\-\-multibuffer)
|
||||
Active le mode multifichiers, autorisant l'édition simultanée de
|
||||
plusieurs fichiers, si ce mode est disponible.
|
||||
.TP
|
||||
.B \-H (\-\-historylog)
|
||||
Enregistre les chaînes ayant fait l'objet d'une recherche ou d'un
|
||||
remplacement dans le fichier
|
||||
.I ~/.nano_history
|
||||
afin de permettre leur réutilisation. Ceci n'est possible que si
|
||||
.B nano
|
||||
est capable d'utiliser les fichiers
|
||||
nanorc.
|
||||
.TP
|
||||
.B \-I (\-\-ignorercfiles)
|
||||
N'utilise pas les fichiers
|
||||
.I $SYSCONFDIR/nanorc
|
||||
et
|
||||
.IR ~/.nanorc ,
|
||||
même si
|
||||
.B nano
|
||||
est capable de les utiliser.
|
||||
.TP
|
||||
.B \-K (\-\-keypad)
|
||||
Essaie au maximum de ne pas utiliser les appels keypad() de ncurses.
|
||||
Utilisez ce paramètre si vous vous apercevez que les flèches du pavé
|
||||
numérique ne fonctionnent pas sous nano.
|
||||
.TP
|
||||
.B \-M (\-\-mac)
|
||||
Écrit le fichier au format Mac.
|
||||
.TP
|
||||
.B \-N (\-\-noconvert)
|
||||
Désactive la conversion automatique des fichiers depuis les
|
||||
formats Mac et DOS.
|
||||
.TP
|
||||
.B \-Q \fIchaîne\fP (\-\-quotestr=\fIchaîne\fP)
|
||||
Définit le préfixe par défaut des citations. Nano utilise ce préfixe
|
||||
pour réaliser une justification correcte des citations.
|
||||
Si nano est capable d'utiliser des expressions rationnelles, le préfixe
|
||||
par défaut sera "^([\ \\t]*[|>:}#])+", sinon, ce sera ">\ ".
|
||||
.TP
|
||||
.B \-R (\-\-regexp)
|
||||
Active l'utilisation d'expressions rationnelles lors des recherches,
|
||||
ainsi que la possibilité d'utiliser \\\fIn\fP dans les chaînes de
|
||||
remplacement pour faire référence à la \fIn\fP-ième sous-expression du
|
||||
motif de recherche, si cette fonction est disponible.
|
||||
.TP
|
||||
.B \-S (\-\-smooth)
|
||||
Active le défilement progressif. Le texte défilera ligne-par-ligne au
|
||||
lieu de défiler morceau-par-morceau.
|
||||
.TP
|
||||
.B \-T \fInombre\fP (\-\-tabsize=\fInombre\fP)
|
||||
Définit la taille (largeur) des tabulations.
|
||||
.TP
|
||||
.B \-V (\-\-version)
|
||||
Affiche le numéro de version et l'auteur.
|
||||
.TP
|
||||
.B \-Y \fIchaîne\fP (\-\-syntax=\fIchaîne\fP)
|
||||
Indique quel mode de colorisation syntaxique adopter, parmi les modes
|
||||
définis dans le fichier
|
||||
.IR .nanorc ,
|
||||
si cette fonctionnalité est disponible.
|
||||
.TP
|
||||
.B \-c (\-\-const)
|
||||
Affiche en permanence la position du curseur.
|
||||
.TP
|
||||
.B \-h (\-\-help)
|
||||
Affiche de la liste des options disponibles en ligne de commande.
|
||||
.TP
|
||||
.B \-i (\-\-autoindent)
|
||||
Indentation automatique. Commence chaque nouvelle ligne au même niveau
|
||||
que la ligne précédente. Utile pour l'édition de code source.
|
||||
.TP
|
||||
.B \-k (\-\-cut)
|
||||
^K coupe le texte du curseur à la fin de la ligne, au lieu de couper la
|
||||
ligne entière.
|
||||
.TP
|
||||
.B \-l (\-\-nofollow)
|
||||
Si le fichier édité est un lien symbolique, remplace le lien par le
|
||||
nouveau fichier, sans le suivre. Ce mode ne serait-il pas utile pour
|
||||
éditer les fichiers de
|
||||
.IR /tmp \ ?
|
||||
.TP
|
||||
.B \-m (\-\-mouse)
|
||||
Active l'utilisation de la souris (si elle est disponible sur votre
|
||||
système).
|
||||
.TP
|
||||
.B \-o \fIrépertoire\fP (\-\-operatingdir=\fIrépertoire\fP)
|
||||
Définit le répertoire de travail. Demande à nano de mettre en place
|
||||
quelque-chose de similaire à une cage chroot.
|
||||
.TP
|
||||
.B \-p (\-\-preserve)
|
||||
Préserve les séquences XON et XOFF (^Q et ^S), afin qu'elle soient
|
||||
reçues par le terminal.
|
||||
.TP
|
||||
.B \-r \fIcolonne\fP (\-\-fill=\fIcolonne\fP)
|
||||
Passe automatiquement à la ligne à la colonne \fIcolonne\fP. Par défaut,
|
||||
le passage à la ligne se fait à la taille de l'écran moins huit. Si la
|
||||
valeur indiquée est négative, le point de passage à la ligne sera
|
||||
calculé relativement au bord droit de l'écran. Cela permet de faire
|
||||
varier le point de passage à la ligne lorsque l'on change la taille de
|
||||
l'écran.
|
||||
.TP
|
||||
.B \-s \fIprogramme\fP (\-\-speller=\fIprogramme\fP)
|
||||
Choix d'un correcteur orthographique de remplacement.
|
||||
.TP
|
||||
.B \-t (\-\-tempfile)
|
||||
S'il a été modifié, le fichier sera sauvegardé automatiquement sans
|
||||
demande de confirmation. Identique à l'option -t de Pico.
|
||||
.TP
|
||||
.B \-v (\-\-view)
|
||||
Mode visualisation (lecture seule).
|
||||
.TP
|
||||
.B \-w (\-\-nowrap)
|
||||
Désactive le passage automatique à la ligne.
|
||||
.TP
|
||||
.B \-x (\-\-nohelp)
|
||||
Désactive la barre d'aide affichée en bas de l'écran.
|
||||
.TP
|
||||
.B \-z (\-\-suspend)
|
||||
Autorise à suspendre l'éditeur.
|
||||
.TP
|
||||
.B \-a, \-b, \-e, \-f, \-g, \-j
|
||||
Ignoré, pour être compatible avec Pico.
|
||||
|
||||
.SH FICHIERS D'INITIALISATION
|
||||
\fBnano\fP lit les fichiers d'initialisation dans l'ordre suivant\ :
|
||||
\fI$SYSCONFDIR/nanorc\fP, puis \fI~/.nanorc\fP. Reportez-vous à la page
|
||||
de manuel de \fBnanorc\fP(5) et au fichier-exemple \fInanorc.sample\fP
|
||||
qui devrait être livré avec \fBnano\fP.
|
||||
|
||||
.SH NOTES
|
||||
Dans certains cas, \fBnano\fP essaiera de sauvegarder le fichier en
|
||||
cours d'édition dans un fichier de secours. Cela arrivera
|
||||
principalement si \fBnano\fP reçoit un signal SIGHUP ou SIGTERM, ou
|
||||
bien se trouve à court de mémoire. Le nom de ce fichier de secours sera
|
||||
\fInano.save\fP si le fichier en cours n'avait pas encore de nom, ou
|
||||
sera composé du nom du fichier en cours suivi du suffixe «\ .save\ ». Si
|
||||
un fichier de ce nom existe déjà dans le répertoire, un «\ .save\ » et
|
||||
un nombre seront ajoutée à la fin du nom du fichier en cours afin de le
|
||||
rendre unique (par exemple, «\ .save.1\ »). En mode multifichiers,
|
||||
\fBnano\fP réalisera une sauvegarde de tous les fichiers en cours dans
|
||||
leurs fichiers de secours respectifs.
|
||||
|
||||
.SH BOGUES
|
||||
Merci de nous faire parvenir vos commentaires et de nous signaler les
|
||||
bogues, en écrivant, en anglais, à
|
||||
.BR nano@nano-editor.org .
|
||||
|
||||
N'hésitez pas à faire parvenir vos suggestions et commentaires relatifs
|
||||
à la version française de \fBnano\fP à
|
||||
.BR jean-philippe.guerard@corbeaunoir.org .
|
||||
|
||||
La liste de discussion anglophone \fBnano\fP est disponible via
|
||||
.BR nano-devel@gnu.org .
|
||||
Pour vous abonner, envoyez un courrier électronique à
|
||||
.BR nano-devel-request@gnu.org ,
|
||||
ayant pour objet «\ subscribe\ ».
|
||||
|
||||
.SH SITE INTERNET
|
||||
http://www.nano-editor.org/
|
||||
|
||||
.SH VOIR AUSSI
|
||||
.PD 0
|
||||
.TP
|
||||
\fBnanorc\fP(5)
|
||||
.PP
|
||||
\fI/usr/share/doc/nano/\fP (ou son équivalent sur votre système)
|
||||
|
||||
.SH AUTEUR
|
||||
Chris Allegretta <chrisa@asty.org> et d'autres (voir les fichiers
|
||||
\fIAUTHORS\fP et \fITHANKS\fP pour plus d'information). Cette page de
|
||||
manuel a été initialement rédigée par Jordi Mallach
|
||||
<jordi@sindominio.net> pour le système GNU Debian (mais elle peut être
|
||||
utilisée par d'autres).
|
||||
|
||||
.SH TRADUCTION
|
||||
Jean-Philippe Guérard <jean-philippe.guerard@corbeaunoir.org>, 2003.
|
||||
198
doc/man/fr/nanorc.5
Normal file
198
doc/man/fr/nanorc.5
Normal file
@@ -0,0 +1,198 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" nanorc.5 is Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
.\"
|
||||
.\" (c) 2003 Jean-Philippe Guérard <jean-philippe.guerard@corbeaunoir.org>
|
||||
.\" pour l'adaptation française
|
||||
.\"
|
||||
.\" This is free documentation, see the latest version of the GNU General
|
||||
.\" Public License for copying conditions. There is NO warranty.
|
||||
.\"
|
||||
.\" Ce document est libre. Reportez-vous à la dernière version de la
|
||||
.\" licence publique générale GNU (GNU GPL) pour connaître ses
|
||||
.\" conditions d'utilisation. AUCUNE garantie n'est offerte.
|
||||
.\"
|
||||
.TH NANORC 5 "19 juin 2003 (v.f. du 25 août 2003)"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\" Merci de modifier ces dates à chaque mise à jour de cette page.
|
||||
|
||||
.SH NAME
|
||||
nanorc \- fichier de configuration de l'éditeur nano du projet GNU
|
||||
|
||||
.SH DESCRIPTION
|
||||
Cette page de manuel décrit brièvement le fichier de configuration de
|
||||
l'éditeur \fBnano\fP du projet GNU.
|
||||
.PP
|
||||
\fBnano\fP est un petit éditeur sympathique et libre, qui vise à
|
||||
remplacer Pico, l'éditeur par défaut du paquet non-libre Pine.
|
||||
\fBnano\fP ne se contentant pas de copier l'interface et l'ergonomie de
|
||||
Pico, il offre également certaines fonctionnalités manquantes (ou
|
||||
désactivées par défaut) de Pico. Ces fonctionnalités sont, par exemple,
|
||||
les fonctions de recherche et de remplacement, et la possibilité de
|
||||
sauter directement à un numéro de ligne.
|
||||
.PP
|
||||
Le fichier \fInanorc\fP contient les paramètres par défaut de
|
||||
\fBnano\fP. Lors de son démarrage, nano commence par lire le fichier de
|
||||
configuration général \fI$SYSCONFDIR/nanorc\fP, puis lit le fichier de
|
||||
configuration personnel de l'utilisateur \fI~/.nanorc\fP.
|
||||
|
||||
.SH OPTIONS
|
||||
Le fichier de configuration accepte une série de commandes «\ set\ »
|
||||
(activer) et «\ unset\ » (désactiver), qui permettent de définir la
|
||||
configuration de nano au démarrage sans avoir à utiliser d'options sur
|
||||
la ligne de commande.
|
||||
De plus, les mots clefs «\ syntax\ » (syntaxe) et «\ color\ » (couleur)
|
||||
sont utilisés pour définir les règles de colorisation pour différents
|
||||
motifs de texte. Nano lira une commande par ligne.
|
||||
|
||||
Les options du fichier de configuration ont priorité sur les valeurs par
|
||||
défaut utilisées par nano. Les options données sur la ligne de commande
|
||||
permettent d'outrepasser les options du fichier de configuration.
|
||||
|
||||
Les options sont désactivées (unset) par défaut, sauf les options
|
||||
prenant un argument.
|
||||
|
||||
Les commandes et arguments reconnus sont\ :
|
||||
|
||||
.TP 3
|
||||
\fBset/unset autoindent\fP
|
||||
Active l'indentation automatique.
|
||||
.TP
|
||||
\fBset/unset backup\fP
|
||||
Crée des copie de sécurité appelées
|
||||
.IR nom_du_fichier~ .
|
||||
.TP
|
||||
\fBset/unset const\fP
|
||||
Affiche en permanence la position du curseur dans la barre
|
||||
d'information.
|
||||
.TP
|
||||
\fBset/unset cut\fP
|
||||
Par défaut, utilise ^K pour couper le texte du curseur à la fin de la
|
||||
ligne, au lieu de couper la ligne entière.
|
||||
.TP
|
||||
\fBset fill \fIn\fP\fP
|
||||
Passe automatiquement à la ligne à la colonne \fIn\fP. Si la valeur
|
||||
indiquée est 0 ou moins, la longueur de la ligne sera égale à la largeur
|
||||
de l'écran moins \fIn\fP. La valeur par défaut est -8.
|
||||
.TP
|
||||
\fBset/unset historylog\fP
|
||||
Active l'utilisation de
|
||||
.I ~/.nano_history
|
||||
pour enregistrer et relire les chaînes ayant fait l'objet d'une
|
||||
recherche ou d'un remplacement.
|
||||
.TP
|
||||
\fBset/unset keypad\fP
|
||||
Utilise l'autre gestion du pavé numérique.
|
||||
.TP
|
||||
\fBset/unset multibuffer\fP
|
||||
Permet de charger simultanément plusieurs fichiers.
|
||||
.TP
|
||||
\fBset/unset noconvert\fP
|
||||
Pas de conversion depuis les formats DOS et Mac.
|
||||
.TP
|
||||
\fBset/unset nofollow\fP
|
||||
Ne suit pas les liens symboliques lors de l'écriture des fichiers.
|
||||
.TP
|
||||
\fBset/unset nohelp\fP
|
||||
Désactive la barre d'aide affichée en bas de l'écran.
|
||||
.TP
|
||||
\fBset/unset nowrap\fP
|
||||
Désactive le passage automatique à la ligne.
|
||||
.TP
|
||||
\fBset operatingdir "\fIrépertoire\fP"\fP
|
||||
\fBnano\fP ne lira et n'écrira des fichiers qu'à l'intérieur du
|
||||
\fIrépertoire\fP et de ses sous-répertoires. De plus, celui-ci devient
|
||||
le répertoire courant, afin que les fichiers soient écrits dans ce
|
||||
dossier. Par défaut, cette fonction est désactivée.
|
||||
.TP
|
||||
\fBset/unset preserve\fP
|
||||
Préserve les séquences XON et XOFF (^Q et ^S).
|
||||
.TP
|
||||
\fBset quotestr "\fIchaîne\fP"\fP
|
||||
Définit le préfixe par défaut utilisé pour les citations dans les
|
||||
courriers électroniques. Ce préfixe est utilisé pour réaliser une
|
||||
justification correcte de ces citations. Il s'agira, si votre système le
|
||||
permet, d'une «\ expression rationnelle étendue\ ». Dans le cas
|
||||
contraire, il s'agira d'une chaîne de texte brut. Si vous disposez des
|
||||
expressions rationnelles, la valeur par défaut sera\ :
|
||||
|
||||
set quotestr "^([\ \\t]*[|>:}#])+"
|
||||
|
||||
Sinon, ce sera ">\ ". Notez que le «\ \\t\ » ci-dessus correspond à un
|
||||
caractère de tabulation.
|
||||
.TP
|
||||
\fBset/unset regexp\fP
|
||||
Utilise par défaut des expressions rationnelles pour les recherches.
|
||||
.TP
|
||||
\fBset/unset smooth\fP
|
||||
Active le défilement ligne-par-ligne du texte.
|
||||
.TP
|
||||
\fBset speller \fIprogramme\fP\fP
|
||||
Utilise le correcteur orthographique \fIprogramme\fP au lieu du
|
||||
correcteur intégré, qui s'appuie sur \fIspell\fP.
|
||||
.TP
|
||||
\fBset/unset suspend\fP
|
||||
Autorise à suspendre nano avec ^Z.
|
||||
.TP
|
||||
\fBset tabsize \fIn\fP\fP
|
||||
Utilise une largeur de tabulation de \fIn\fP au lieu de la valeur par
|
||||
défaut (8). Cette valeur doit être supérieur à 0.
|
||||
.TP
|
||||
\fBset/unset tempfile\fP
|
||||
S'il a été modifié, le fichier sera sauvegardé automatiquement
|
||||
sans demande de confirmation.
|
||||
.TP
|
||||
\fBset/unset view\fP
|
||||
Interdit la modification du fichier.
|
||||
.TP
|
||||
.B syntax "\fIchaîne\fP" ["\fImotif_de_fichier\fP" ... ]
|
||||
Définit une syntaxe nommée \fIchaîne\fP qui pourra être activé via
|
||||
l'option \fB-Y\fP, ou qui sera automatiquement activé si le nom du
|
||||
fichier en cours correspond au \fImotif_de_fichier\fP. Toutes les
|
||||
instructions de colorisation \fBcolor\fP suivantes s'appliqueront à cette
|
||||
syntaxe, jusqu'à la définition d'une nouvelle syntaxe.
|
||||
.TP
|
||||
.B color \fIcouleur_texte\fP[,\fIcouleur_fond\fP] "\fImotif\fP" ...
|
||||
Pour la syntaxe en cours, affiche toutes les expressions correspondant à
|
||||
l'expression rationnelle \fImotif\fP en utilisant la couleur de texte
|
||||
\fIcouleur_texte\fP et éventuellement la couleur de fond
|
||||
\fIcouleur_fond\fP. Les couleurs acceptées par \fBnano\fP pour le
|
||||
texte et le fond sont\ : \fIwhite\fP (blanc), \fIblack\fP (noir),
|
||||
\fIred\fP (rouge), \fIblue\fP (bleu), \fIgreen\fP (vert), \fIyellow\fP
|
||||
(jaune), \fImagenta\fP, et \fIcyan\fP. Vous pouvez ajouter à
|
||||
ces couleurs le préfixe \fIbright\fP pour obtenir une couleur plus
|
||||
lumineuse. Si votre terminal est capable de gérer la transparence, ne
|
||||
pas spécifier de \fIcouleur_fond\fP indique à \fBnano\fP d'essayer
|
||||
d'utiliser un fond transparent.
|
||||
.TP
|
||||
.B color \fIcouleur_texte\fP[,\fIcouleur_fond\fP] start="\fImotif_début\fP" end="\fImotif_fin\fP"
|
||||
Affiche les expressions commençant par \fImotif_début\fP et se terminant
|
||||
par \fImotif_fin\fP en utilisant la couleur de texte \fIcouleur_texte\fP
|
||||
et éventuellement la couleur de fond \fIcouleur_fond\fP. Cela permet à
|
||||
la colorisation syntaxique de s'étendre sur plusieurs lignes. Notez que
|
||||
toutes les occurrences successives de \fImotif_début\fP après le
|
||||
\fImotif_début\fP initial seront colorées jusqu'à la prochaine instance
|
||||
de \fImotif_fin\fP.
|
||||
|
||||
.SH FICHIERS
|
||||
.TP
|
||||
.I $SYSCONFDIR/nanorc
|
||||
Fichier de configuration général
|
||||
.TP
|
||||
.I ~/.nanorc
|
||||
Fichier de configuration personnel
|
||||
|
||||
.SH VOIR AUSSI
|
||||
.PD 0
|
||||
.TP
|
||||
\fBnano\fP(1)
|
||||
.PP
|
||||
\fI/usr/share/doc/nano/examples/nanorc.sample\fP (ou son équivalent sur
|
||||
votre système)
|
||||
|
||||
.SH AUTEUR
|
||||
Chris Allegretta <chrisa@asty.org> et d'autres (voir les fichiers
|
||||
\fIAUTHORS\fP et \fITHANKS\fP pour plus d'information). Cette page de
|
||||
manuel a été rédigée par Jordi Mallach <jordi@gnu.org>.
|
||||
|
||||
.SH TRADUCTION
|
||||
Jean-Philippe Guérard <jean-philippe.guerard@corbeaunoir.org>, 2003.
|
||||
@@ -3,10 +3,10 @@
|
||||
.\" Chris Allegretta <chrisa@asty.org>
|
||||
.\"
|
||||
.\" This is free documentation, see the latest version of the GNU General
|
||||
.\" Public License for copying conditions. There is NO warranty.
|
||||
.\" Public License for copying conditions. There is NO warranty.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.TH NANO 1 "June 19, 2003"
|
||||
.TH NANO 1 "August 24, 2003"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
|
||||
@@ -22,10 +22,10 @@ nano \- Nano's ANOther editor, an enhanced free Pico clone
|
||||
This manual page documents briefly the \fBnano\fP command.
|
||||
.PP
|
||||
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
|
||||
.\" \fI<whatever>\fP escape sequences to invoke bold face and italics,
|
||||
.\" \fI<whatever>\fP escape sequences to invoke bold face and italics,
|
||||
.\" respectively.
|
||||
\fBnano\fP is a small, free and friendly editor which aims to replace
|
||||
Pico, the default editor included in the non-free Pine package. Rather
|
||||
Pico, the default editor included in the non-free Pine package. Rather
|
||||
than just copying Pico's look and feel, \fBnano\fP also implements some
|
||||
missing (or disabled by default) features in Pico, such as "search and
|
||||
replace" and "go to line number".
|
||||
@@ -48,21 +48,16 @@ Enable multiple file buffers, if available.
|
||||
.B \-H (\-\-historylog)
|
||||
Log search and replace strings to
|
||||
.I ~/.nano_history
|
||||
so they may be stored for later editing, if nanorc support is
|
||||
so they may be stored for later editing, if nanorc support is
|
||||
configured.
|
||||
.TP
|
||||
.B \-I (\-\-ignorercfiles)
|
||||
Don't look at
|
||||
.I $SYSCONFDIR/nanorc
|
||||
.I SYSCONFDIR/nanorc
|
||||
or
|
||||
.IR ~/.nanorc ,
|
||||
if nanorc support is available.
|
||||
.TP
|
||||
.B \-K (\-\-keypad)
|
||||
Do not use the ncurses keypad() call unless necessary. Try this flag if
|
||||
you find that the arrow keys on the numeric keypad do not work for you
|
||||
under nano.
|
||||
.TP
|
||||
.B \-M (\-\-mac)
|
||||
Write file in Mac format.
|
||||
.TP
|
||||
@@ -79,7 +74,7 @@ Enable regular expression matching for search strings, as well as
|
||||
\\n subexpression replacement for replace strings, if available.
|
||||
.TP
|
||||
.B \-S (\-\-smooth)
|
||||
Enable smooth scrolling. Text will scroll line-by-line, instead of the
|
||||
Enable smooth scrolling. Text will scroll line-by-line, instead of the
|
||||
usual chunk-by-chunk behavior.
|
||||
.TP
|
||||
.B \-T \fInum\fP (\-\-tabsize=\fInum\fP)
|
||||
@@ -96,11 +91,16 @@ to use, if available.
|
||||
.B \-c (\-\-const)
|
||||
Constantly show the cursor position.
|
||||
.TP
|
||||
.B \-d (\-\-rebinddelete)
|
||||
Interpret the Delete key differently so that both Backspace and Delete
|
||||
work properly. You should only need to use this option if Backspace
|
||||
acts like Delete on your system.
|
||||
.TP
|
||||
.B \-h (\-\-help)
|
||||
Display a summary of command line options.
|
||||
.TP
|
||||
.B \-i (\-\-autoindent)
|
||||
Indent new lines to the previous line's indentation. Useful when editing
|
||||
Indent new lines to the previous line's indentation. Useful when editing
|
||||
source code.
|
||||
.TP
|
||||
.B \-k (\-\-cut)
|
||||
@@ -116,17 +116,17 @@ perhaps?
|
||||
Enable mouse support (if available for your system).
|
||||
.TP
|
||||
.B \-o \fIdir\fP (\-\-operatingdir=\fIdir\fP)
|
||||
Set operating directory. Makes nano set up something similar to a
|
||||
Set operating directory. Makes nano set up something similar to a
|
||||
chroot.
|
||||
.TP
|
||||
.B \-p (\-\-preserve)
|
||||
Preserve the XON and XOFF sequences (^Q and ^S) so they will be
|
||||
caught by the terminal.
|
||||
Preserve the XON and XOFF sequences (^Q and ^S) so they will be caught
|
||||
by the terminal.
|
||||
.TP
|
||||
.B \-r \fIcols\fP (\-\-fill=\fIcols\fP)
|
||||
Wrap lines at column \fIcols\fP. By default, this is the width of the
|
||||
screen, less eight. If this value is negative, wrapping will occur at
|
||||
\fIcols\fP columns from the right of the screen, allowing the wrap point
|
||||
\fIcols\fP columns from the right of the screen, allowing the wrap point
|
||||
to vary along with the screen width if resized.
|
||||
.TP
|
||||
.B \-s \fIprog\fP (\-\-speller=\fIprog\fP)
|
||||
@@ -151,15 +151,14 @@ Enable suspend ability.
|
||||
Ignored, for compatibility with Pico.
|
||||
|
||||
.SH INITIALIZATION FILE
|
||||
\fBnano\fP will read initialization files in the following
|
||||
order:
|
||||
.IR $SYSCONFDIR/nanorc ,
|
||||
\fBnano\fP will read initialization files in the following order:
|
||||
.IR SYSCONFDIR/nanorc ,
|
||||
then
|
||||
.IR ~/.nanorc .
|
||||
Please see
|
||||
.BR nanorc (5)
|
||||
and the example file \fBnanorc.sample\fP which should be provided with
|
||||
\fBnano\fP.
|
||||
and the example file \fBnanorc.sample\fP which should be provided with
|
||||
\fBnano\fP.
|
||||
|
||||
.SH NOTES
|
||||
\fBnano\fP will try to dump the buffer into an emergency file in some
|
||||
@@ -167,11 +166,11 @@ cases. Mainly, this will happen if \fBnano\fP receives a SIGHUP or
|
||||
SIGTERM or runs out of memory, when it will write the buffer into a file
|
||||
named
|
||||
.I nano.save
|
||||
if the buffer didn't have a name already, or will add a ".save" suffix
|
||||
to the current filename. If an emergency file with that name already
|
||||
exists in the current directory, ".save" and a number (e.g. ".save.1")
|
||||
will be suffixed to the current filename in order to make it unique. In
|
||||
multibuffer mode, \fBnano\fP will write all the open buffers to the
|
||||
if the buffer didn't have a name already, or will add a ".save" suffix
|
||||
to the current filename. If an emergency file with that name already
|
||||
exists in the current directory, ".save" and a number (e.g. ".save.1")
|
||||
will be suffixed to the current filename in order to make it unique. In
|
||||
multibuffer mode, \fBnano\fP will write all the open buffers to the
|
||||
respective emergency files.
|
||||
|
||||
.SH BUGS
|
||||
@@ -201,5 +200,5 @@ Chris Allegretta <chrisa@asty.org>, et al (see
|
||||
and
|
||||
.I THANKS
|
||||
for details). This manual page was originally written by Jordi Mallach
|
||||
<jordi@sindominio.net>, for the Debian GNU system (but may be
|
||||
used by others).
|
||||
<jordi@sindominio.net>, for the Debian GNU system (but may be used by
|
||||
others).
|
||||
@@ -2,10 +2,10 @@
|
||||
.\" nanorc.5 is Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
.\"
|
||||
.\" This is free documentation, see the latest version of the GNU General
|
||||
.\" Public License for copying conditions. There is NO warranty.
|
||||
.\" Public License for copying conditions. There is NO warranty.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.TH NANORC 5 "June 19, 2003"
|
||||
.TH NANORC 5 "August 24, 2003"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.SH NAME
|
||||
@@ -14,26 +14,26 @@ nanorc \- GNU nano's rcfile
|
||||
This manual page documents GNU \fBnano\fP's rcfile.
|
||||
.PP
|
||||
\fBnano\fP is a small, free and friendly editor which aims to replace
|
||||
Pico, the default editor included in the non-free Pine package. Rather
|
||||
Pico, the default editor included in the non-free Pine package. Rather
|
||||
than just copying Pico's look and feel, \fBnano\fP also implements some
|
||||
missing (or disabled by default) features in Pico, such as "search and
|
||||
replace" and "go to line number".
|
||||
.PP
|
||||
The \fInanorc\fP file contains the default settings for \fBnano\fP.
|
||||
The \fInanorc\fP file contains the default settings for \fBnano\fP.
|
||||
During startup, \fBnano\fP will first read its system-wide settings from
|
||||
.IR $SYSCONFDIR/nanorc ,
|
||||
.IR SYSCONFDIR/nanorc ,
|
||||
and then user-specific settings from
|
||||
.IR ~/.nanorc .
|
||||
|
||||
.SH OPTIONS
|
||||
The configuration file accepts a series of "set" and "unset" commands,
|
||||
which can be used to configure nano on startup without using the
|
||||
command-line options. Additionally, the "syntax" and "color" keywords
|
||||
are used to define syntax highlighting rules for different text patterns.
|
||||
GNU nano will read one command per line.
|
||||
command-line options. Additionally, the "syntax" and "color" keywords
|
||||
are used to define syntax highlighting rules for different text
|
||||
patterns. GNU nano will read one command per line.
|
||||
|
||||
Options in rcfiles take precedence over nano's defaults, and command line
|
||||
options override rcfile settings.
|
||||
Options in rcfiles take precedence over nano's defaults, and command
|
||||
line options override rcfile settings.
|
||||
|
||||
Options are unset by default, except for options that take an argument.
|
||||
|
||||
@@ -62,9 +62,6 @@ Enable
|
||||
.I ~/.nano_history
|
||||
for saving and reading search/replace strings.
|
||||
.TP
|
||||
\fBset/unset keypad\fP
|
||||
Use alternate keypad routines.
|
||||
.TP
|
||||
\fBset/unset multibuffer\fP
|
||||
Allow inserting files into their own buffers.
|
||||
.TP
|
||||
@@ -82,23 +79,28 @@ Don't wrap text at all.
|
||||
.TP
|
||||
\fBset operatingdir "\fIdirectory\fP"\fP
|
||||
\fBnano\fP will only read and write files inside \fIdirectory\fP and its
|
||||
subdirectories. Also, the current directory is changed to here, so files
|
||||
are inserted from this dir. By default the operating directory feature is
|
||||
turned off.
|
||||
subdirectories. Also, the current directory is changed to here, so
|
||||
files are inserted from this dir. By default the operating directory
|
||||
feature is turned off.
|
||||
.TP
|
||||
\fBset/unset preserve\fP
|
||||
Preserve the XON and XOFF keys (^Q and ^S).
|
||||
.TP
|
||||
\fBset quotestr "\fIstring\fP"\fP
|
||||
The email-quote string, used to justify email-quoted paragraphs. This is
|
||||
an "extended regular expression" if your system supports them, otherwise a
|
||||
literal string. The default value is
|
||||
The email-quote string, used to justify email-quoted paragraphs. This
|
||||
is an "extended regular expression" if your system supports them,
|
||||
otherwise a literal string. The default value is
|
||||
|
||||
set quotestr "^([\ \\t]*[|>:}#])+"
|
||||
|
||||
if you have regexps, otherwise set quotestr ">\ ". Note that '\\t'
|
||||
if you have regexps, otherwise set quotestr ">\ ". Note that '\\t'
|
||||
above stands for a literal Tab character.
|
||||
.TP
|
||||
\fBset/unset rebinddelete\fP
|
||||
Interpret the Delete key differently so that both Backspace and Delete
|
||||
work properly. You should only need to use this option if Backspace
|
||||
acts like Delete on your system.
|
||||
.TP
|
||||
\fBset/unset regexp\fP
|
||||
Do regular expression searches by default.
|
||||
.TP
|
||||
@@ -113,7 +115,7 @@ calls \fIspell\fP.
|
||||
Allow nano to be suspended with ^Z.
|
||||
.TP
|
||||
\fBset tabsize \fIn\fP\fP
|
||||
Use a tab size of \fIn\fP instead of the default (8); must be greater
|
||||
Use a tab size of \fIn\fP instead of the default (8); must be greater
|
||||
than 0.
|
||||
.TP
|
||||
\fBset/unset tempfile\fP
|
||||
@@ -123,32 +125,31 @@ Save automatically on exit, don't prompt.
|
||||
Disallow file modification.
|
||||
.TP
|
||||
.B syntax "\fIstr\fP" ["\fIfileregex\fP" ... ]
|
||||
Defines a syntax named \fIstr\fP which can be activated via the
|
||||
\fB-Y\fP flag, or will be automatically activated if the current
|
||||
filename matches \fIfileregex\fP. All following \fBcolor\fP statements
|
||||
will apply to \fIsyntax\fP until a new syntax is defined.
|
||||
Defines a syntax named \fIstr\fP which can be activated via the \fB-Y\fP
|
||||
flag, or will be automatically activated if the current filename matches
|
||||
\fIfileregex\fP. All following \fBcolor\fP statements will apply to
|
||||
\fIsyntax\fP until a new syntax is defined.
|
||||
.TP
|
||||
.B color \fIfgcolor\fP[,\fIbgcolor\fP] "\fIregex\fP" ...
|
||||
For the currently defined syntax, display all expressions matching
|
||||
\fIregex\fP with foreground color \fIfgcolor\fP and optional background
|
||||
color \fIbgcolor\fP. Legal colors for foreground and background color are:
|
||||
white, black, red, blue, green, yellow, magenta, and cyan. You may use
|
||||
the prefix "bright" to force a stronger color highlight. If your
|
||||
terminal supports transparency, not specifying a \fIbgcolor\fP tells
|
||||
For the currently defined syntax, display all expressions matching
|
||||
\fIregex\fP with foreground color \fIfgcolor\fP and optional background
|
||||
color \fIbgcolor\fP. Legal colors for foreground and background color
|
||||
are: white, black, red, blue, green, yellow, magenta, and cyan. You may
|
||||
use the prefix "bright" to force a stronger color highlight. If your
|
||||
terminal supports transparency, not specifying a \fIbgcolor\fP tells
|
||||
\fBnano\fP to attempt to use a transparent background.
|
||||
.TP
|
||||
.B color \fIfgcolor\fP[,\fIbgcolor\fP] start="\fIsr\fP" end="\fIer\fP"
|
||||
Display expressions which start with \fIsr\fP and end with \fIer\fP
|
||||
with foreground color \fIfgcolor\fP and optional
|
||||
background color \fIbgcolor\fP. This allows syntax highlighting to span
|
||||
multiple lines. Note that all subsequent instances of \fIsr\fP after
|
||||
an initial \fIsr\fP is found will be highlighted until the first
|
||||
instance of \fIer\fP.
|
||||
Display expressions which start with \fIsr\fP and end with \fIer\fP
|
||||
with foreground color \fIfgcolor\fP and optional background color
|
||||
\fIbgcolor\fP. This allows syntax highlighting to span multiple lines.
|
||||
Note that all subsequent instances of \fIsr\fP after an initial \fIsr\fP
|
||||
is found will be highlighted until the first instance of \fIer\fP.
|
||||
\fI
|
||||
|
||||
.SH FILES
|
||||
.TP
|
||||
.I $SYSCONFDIR/nanorc
|
||||
.I SYSCONFDIR/nanorc
|
||||
System-wide configuration file
|
||||
.TP
|
||||
.I ~/.nanorc
|
||||
@@ -158,7 +159,7 @@ Per-user configuration file
|
||||
.TP
|
||||
\fBnano\fP(1)
|
||||
.PP
|
||||
\fI/usr/share/doc/nano/examples/nanorc.sample\fP (or equivalent on your
|
||||
\fI/usr/share/doc/nano/examples/nanorc.sample\fP (or equivalent on your
|
||||
system)
|
||||
.SH AUTHOR
|
||||
Chris Allegretta <chrisa@asty.org>, et al (see
|
||||
@@ -29,9 +29,6 @@
|
||||
## Enable ~/.nano_history for saving and reading search/replace strings.
|
||||
# set historylog
|
||||
|
||||
## Use alternate keypad routines
|
||||
# set keypad
|
||||
|
||||
## Allow multiple file buffers (using ^R inserts into separate buffer).
|
||||
## You must have configured with --enable-multibuffer or --enable-extra
|
||||
## for this to work.
|
||||
@@ -69,6 +66,9 @@
|
||||
## You can get old nano quoted-justify behavior via:
|
||||
# set quotestr "(> )+"
|
||||
|
||||
## Fix Backspace if it acts like Delete
|
||||
# set rebinddelete
|
||||
|
||||
## Do extended regular expression searches by default
|
||||
# set regexp
|
||||
|
||||
@@ -89,9 +89,6 @@
|
||||
## Save automatically on exit, don't prompt
|
||||
# set tempfile
|
||||
|
||||
## Enable ~/.nano_history for saving and reading search/replace strings.
|
||||
# set historylog
|
||||
|
||||
## Disallow file modification, why would you want this in an rc file? ;)
|
||||
# set view
|
||||
|
||||
@@ -113,16 +110,16 @@
|
||||
# color red "\<[A-Z_]{2,}\>"
|
||||
# color green "\<(float|char|int|void|static|const|struct)\>"
|
||||
# color brightyellow "\<(if|while|do|else|case|switch)\>"
|
||||
# color brightcyan "^#( )*(define|include|ifn?def|endif|elif|else|if)"
|
||||
# color brightcyan "^ *# *(define|include|ifn?def|endif|elif|else|if)"
|
||||
##
|
||||
## You will in general want your comments and strings to come last,
|
||||
## because syntax highlighting rules will be applied in the order they
|
||||
## are read in.
|
||||
##
|
||||
# color brightyellow "<[^= ]*>" ""(\\.|[^\"])*""
|
||||
# color brightyellow "<[^= ]*>" ""(\\.|[^\"])*""
|
||||
##
|
||||
## This string is VERY resource intensive!!!
|
||||
# color brightyellow start=""(\\.|[^\"])*\\( | )*$" end="^(\\.|[^\"])*""
|
||||
# color brightyellow start=""(\\.|[^\"])*\\ *$" end="^(\\.|[^\"])*""
|
||||
##
|
||||
## And we want to have some nice comment highlighting too
|
||||
# color brightblue "//.*"
|
||||
@@ -131,7 +128,7 @@
|
||||
## Here is a short example for HTML
|
||||
# syntax "HTML" "\.html$"
|
||||
# color blue start="<" end=">"
|
||||
# color red "&[^; ]*;"
|
||||
# color red "&[^; ]*;"
|
||||
|
||||
## Here is a short example for TeX files
|
||||
# syntax "TeX" "\.tex$"
|
||||
@@ -196,16 +193,20 @@
|
||||
# color blue "//.*"
|
||||
# color blue start="/\*" end="\*/"
|
||||
# color brightblue start="/\*\*" end="\*/"
|
||||
# color brightgreen,brightgreen "[ ]+$"
|
||||
# color brightgreen,green " +$"
|
||||
|
||||
## Here is an example for your .nanorc
|
||||
##
|
||||
# syntax "nanorc" "[\.]*nanorc$"
|
||||
# color white "^ *(set|unset).*$"
|
||||
# color cyan "^ *(set|unset) (autoindent|backup|const|cut|fill|keypad|multibuffer|noconvert|nofollow|nohelp|nowrap|operatingdir|preserve|quotestr|regexp|smooth|speller|suspend|tabsize|tempfile|historylog|view)"
|
||||
# color brightwhite "^ *syntax [^ ]*"
|
||||
# color brightblue "^ *set\>" "^ *unset\>" "^ *syntax\>"
|
||||
# color white "^ *color\>.*"
|
||||
# color yellow "^ *color (bright)?(white|black|red|blue|green|yellow|magenta|cyan)\>"
|
||||
# color magenta "^ *color\>"
|
||||
# color green "^#.*$"
|
||||
#syntax "nanorc" "(\.|/|)nanorc$"
|
||||
## highlight possible errors and parameters
|
||||
#color brightwhite "^ *(set|unset|syntax|color).*$"
|
||||
## set, unset and syntax
|
||||
#color cyan "^ *(set|unset) +(autoindent|backup|const|cut|fill|historylog|multibuffer|noconvert|nofollow|nohelp|nowrap|operatingdir|preserve|quotestr|rebinddelete|regexp|smooth|speller|suspend|tabsize|tempfile|view)"
|
||||
#color green "^ *(set|unset|syntax)\>"
|
||||
## colors
|
||||
#color yellow "^ *color +(bright)?(white|black|red|blue|green|yellow|magenta|cyan)(,(white|black|red|blue|green|yellow|magenta|cyan))?\>"
|
||||
#color magenta "^ *color\>" "\<(start|end)="
|
||||
## strings
|
||||
#color white "\"(\\.|[^\"])*\""
|
||||
## comments
|
||||
#color blue "^ *#.*$"
|
||||
4
doc/texinfo/.cvsignore
Normal file
4
doc/texinfo/.cvsignore
Normal file
@@ -0,0 +1,4 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
nano.info
|
||||
texinfo.tex
|
||||
5
doc/texinfo/Makefile.am
Normal file
5
doc/texinfo/Makefile.am
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
info_TEXINFOS = nano.texi
|
||||
MAKEINFO = makeinfo --no-split
|
||||
|
||||
EXTRA_DIST = nano.info
|
||||
@@ -8,8 +8,8 @@
|
||||
@c Run `makeinfo' rather than `texinfo-format-buffer'.
|
||||
@smallbook
|
||||
@set EDITION 0.1
|
||||
@set VERSION 1.2.2
|
||||
@set UPDATED 17 Jan 2003
|
||||
@set VERSION 1.3.0
|
||||
@set UPDATED 22 Oct 2003
|
||||
|
||||
@dircategory Editors
|
||||
@direntry
|
||||
@@ -23,7 +23,7 @@
|
||||
@titlepage
|
||||
@title GNU @code{nano}
|
||||
@subtitle a small and friendly text editor.
|
||||
@subtitle version 1.2.2
|
||||
@subtitle version 1.3.0
|
||||
|
||||
@author Chris Allegretta
|
||||
@page
|
||||
@@ -95,10 +95,10 @@ internationalization support, and filename tab completion.
|
||||
|
||||
The original goal for @code{nano} was a complete bug-for-bug compatible
|
||||
emulation of Pico, but nano's main goal is to be as compatible as
|
||||
possible while offering a superset of Pico's functionality.
|
||||
Also see @xref{Pico Compatibility}, for other differences.
|
||||
possible while offering a superset of Pico's functionality. Also see
|
||||
@xref{Pico Compatibility}, for other differences.
|
||||
|
||||
Email bug reports to @email{nano@@nano-editor.org}.
|
||||
Email bug reports to @email{nano@@nano-editor.org}.
|
||||
|
||||
@node Command Line Options, , Overview, Introduction
|
||||
@section Command Line Options
|
||||
@@ -118,14 +118,9 @@ Write file in DOS format.
|
||||
Enable multiple file buffers, if available.
|
||||
|
||||
@item -I, --ignorercfiles
|
||||
Don't look at $SYSCONFDIR/nanorc or ~/.nanorc, if nanorc support is
|
||||
Don't look at SYSCONFDIR/nanorc or ~/.nanorc, if nanorc support is
|
||||
available.
|
||||
|
||||
@item -K, --keypad
|
||||
Do not use the ncurses keypad() call unless necessary. Try this flag if
|
||||
you find that the arrow keys on the numeric keypad do not work for you
|
||||
under @code{nano}.
|
||||
|
||||
@item -M, --mac
|
||||
Write file in Mac format.
|
||||
|
||||
@@ -151,7 +146,7 @@ Enable smooth scrolling.
|
||||
@item -T [num], --tabsize=[num]
|
||||
Set the displayed tab length to [num] columns.
|
||||
|
||||
@item -V, --version
|
||||
@item -V, --version
|
||||
Print the version number and copyright and quit.
|
||||
|
||||
@item -Y, --syntax=[str]
|
||||
@@ -161,6 +156,11 @@ available.
|
||||
@item -c, --const
|
||||
Constantly display the cursor position and line number on the statusbar.
|
||||
|
||||
@item -d, --rebinddelete
|
||||
Interpret the Delete key differently so that both Backspace and Delete
|
||||
work properly. You should only need to use this option if Backspace
|
||||
acts like Delete on your system.
|
||||
|
||||
@item -h, --help
|
||||
Print the usage and exit.
|
||||
|
||||
@@ -181,18 +181,18 @@ Enables the use of the mouse to select text (currently only useful for
|
||||
running under the X window system).
|
||||
|
||||
@item -o [dir], --operatingdir=[dir]
|
||||
Set operating directory. Makes @code{nano} set up something similar to a
|
||||
chroot.
|
||||
Set operating directory. Makes @code{nano} set up something similar to
|
||||
a chroot.
|
||||
|
||||
@item -p, --preserve
|
||||
Preserve the ^Q (XON) and ^S (XOFF) sequences so data being sent to the editor
|
||||
can be can be stopped and started.
|
||||
Preserve the ^Q (XON) and ^S (XOFF) sequences so data being sent to the
|
||||
editor can be can be stopped and started.
|
||||
|
||||
@item -r [#cols], --fill=[#cols].
|
||||
Wrap lines at column #cols. By default this is the width of the screen,
|
||||
less eight. If this value is negative, wrapping will occur at #cols from
|
||||
the right of the screen, allowing it to vary along with the screen width
|
||||
if the screen is resized.
|
||||
less eight. If this value is negative, wrapping will occur at #cols
|
||||
from the right of the screen, allowing it to vary along with the screen
|
||||
width if the screen is resized.
|
||||
|
||||
@item -s [prog], --speller=[prog]
|
||||
Invoke [prog] as the spell checker. By default, @code{nano} uses its
|
||||
@@ -206,21 +206,21 @@ composer of a mailer program.
|
||||
|
||||
@anchor{Expert Mode}
|
||||
@item -x, --nohelp
|
||||
In Expert Mode, the Shortcut Lists will not appear at the bottom of the
|
||||
screen. This affects the location of the statusbar as well, as in Expert
|
||||
Mode it is located at the very bottom of the editor.
|
||||
In Expert Mode, the Shortcut Lists will not appear at the bottom of the
|
||||
screen. This affects the location of the statusbar as well, as in
|
||||
Expert Mode it is located at the very bottom of the editor.
|
||||
|
||||
Note: When accessing the help system, Expert Mode is temporarily disabled
|
||||
to display the help system navigation keys.
|
||||
Note: When accessing the help system, Expert Mode is temporarily
|
||||
disabled to display the help system navigation keys.
|
||||
|
||||
@item -v, --view
|
||||
Do not allow the contents of the file to be altered. Note that this
|
||||
flag should NOT be used in place of correct file permissions to implement
|
||||
a read-only file.
|
||||
flag should NOT be used in place of correct file permissions to
|
||||
implement a read-only file.
|
||||
|
||||
@item -w, --nowrap
|
||||
Do not wrap long lines at any length. This option overrides any value for
|
||||
-r.
|
||||
Do not wrap long lines at any length. This option overrides any value
|
||||
for -r.
|
||||
|
||||
@item -z, --suspend
|
||||
Enable suspend ability of @code{nano} using the system's suspend
|
||||
@@ -249,38 +249,41 @@ Start at line number LINE instead of the default of line 1.
|
||||
All key sequences in @code{nano} are entered using the keyboard.
|
||||
@code{nano} is a ``modeless'' editor. All keys with the exception of
|
||||
Control and Meta key sequences will enter text into the file being
|
||||
edited.
|
||||
edited.
|
||||
|
||||
@node Special Functions, The Titlebar, Entering Text, Editor Basics
|
||||
@section Special Functions
|
||||
|
||||
Special functions use the Control key (displayed in the help and
|
||||
shortcut lists as ^) or the Meta key (displayed as M).
|
||||
|
||||
shortcut lists as ^), the Meta key (displayed as M), or the Esc key.
|
||||
|
||||
@itemize @bullet
|
||||
|
||||
@item
|
||||
Control key sequences are entered by holding down the Control key and
|
||||
pressing the desired letter.
|
||||
pressing the desired key, or by pressing the Esc key twice and pressing
|
||||
the desired key.
|
||||
@item
|
||||
Meta key sequences can be entered in a number of
|
||||
possible ways: Pressing the Escape key, then releasing it and pressing
|
||||
the desired key, or holding down the Alt key while pressing the desired
|
||||
key. This varies from keyboard to keyboard, and certain commercial
|
||||
operating systems ``swallow'' the Alt key so that it never reaches the
|
||||
application. If your operating system does this, you should use the
|
||||
Escape key to generate Meta key sequences.
|
||||
Pressing Esc twice and then typing a three-digit number from 000 to 255
|
||||
will enter the character with the corresponding ASCII code.
|
||||
@item
|
||||
Meta key sequences can be entered in a number of possible ways: Pressing
|
||||
the Escape key, then releasing it and pressing the desired key, or
|
||||
holding down the Alt key while pressing the desired key. This varies
|
||||
from keyboard to keyboard, and certain commercial operating systems
|
||||
``swallow'' the Alt key so that it never reaches the application. If
|
||||
your operating system does this, you should use the Escape key to
|
||||
generate Meta key sequences.
|
||||
@end itemize
|
||||
|
||||
@node The Titlebar, The Statusbar, Special Functions, Editor Basics
|
||||
@section The Titlebar
|
||||
|
||||
The titlebar is the line displayed at the top of the editor. There are
|
||||
three sections: left, center and right. The section on the left displays
|
||||
the version of @code{nano} being used. The center section displays the
|
||||
current file name, or ``New Buffer'' if the file has not yet been named.
|
||||
The section on the right will display ``Modified'' if the file has been
|
||||
modified since it was last saved or opened.
|
||||
three sections: left, center and right. The section on the left
|
||||
displays the version of @code{nano} being used. The center section
|
||||
displays the current file name, or ``New Buffer'' if the file has not
|
||||
yet been named. The section on the right will display ``Modified'' if
|
||||
the file has been modified since it was last saved or opened.
|
||||
|
||||
Special modes: When @code{nano} is in ``File browser'' mode, the center
|
||||
section will display the current directory instead of the filename.
|
||||
@@ -302,13 +305,13 @@ the statusbar.
|
||||
@section Shortcut Lists
|
||||
|
||||
The Shortcut Lists are the two lines at the bottom of the screen which
|
||||
show some of the more commonly used functions in the editor.
|
||||
show some of the more commonly used functions in the editor.
|
||||
|
||||
@node Online Help, Feature Toggles, Editor Basics, Top
|
||||
@chapter Online Help
|
||||
|
||||
The online help system in @code{nano} is available by pressing ^G.
|
||||
It is fairly self explanatory, documenting the various parts of the
|
||||
It is fairly self explanatory, documenting the various parts of the
|
||||
editor and available keystrokes. Navigation is via the ^Y (Page Up)
|
||||
and ^V (Page Down) keys. ^X exits the help system.
|
||||
|
||||
@@ -317,8 +320,8 @@ and ^V (Page Down) keys. ^X exits the help system.
|
||||
@chapter Feature Toggles
|
||||
|
||||
Toggles allow you to change certain aspects of the editor that
|
||||
would normally be done via command line flags. They are invoked via
|
||||
certain Meta key sequences. @xref{Special Functions}, for more info.
|
||||
would normally be done via command line flags. They are invoked via
|
||||
certain Meta key sequences. @xref{Special Functions}, for more info.
|
||||
The following global toggles are available:
|
||||
|
||||
@table @code
|
||||
@@ -375,7 +378,7 @@ find the desired file.
|
||||
Basic movement in the file browser is accomplished with the arrow keys
|
||||
and page up/down. The behavior of the enter (or `s') key varies by what
|
||||
is currently selected. If the currently selected object is a directory,
|
||||
the file browser will enter and display the contents of the directory.
|
||||
the file browser will enter and display the contents of the directory.
|
||||
If the object is a file, this filename and path are copied to the
|
||||
statusbar and the file browser is exited.
|
||||
|
||||
@@ -388,15 +391,15 @@ are certain differences between the editors:
|
||||
@table @code
|
||||
@item Search and Replace History
|
||||
As of version 1.2.2 of @code{nano}, text entered as search or replace
|
||||
strings will be stored and can be accessed with the up/down
|
||||
arrow keys. Previously, @code{nano} offered a more consistent, but incompatible
|
||||
with Pico, method for entering search and replace strings. In the old
|
||||
method, previous entries would be displayed by default as editable text
|
||||
in front of the cursor, as opposed to being bracketed and uneditable as
|
||||
it is in Pico. The old behavior could be made compatible with Pico via the
|
||||
@code{-p} flag, but recent versions of Pico use the @code{-p} flag
|
||||
to preserve the XON and XOFF sequences within the editor. Since with the new
|
||||
method search and replace strings can still be edited by simply
|
||||
strings will be stored and can be accessed with the up/down arrow keys.
|
||||
Previously, @code{nano} offered a more consistent, but incompatible with
|
||||
Pico, method for entering search and replace strings. In the old
|
||||
method, previous entries would be displayed by default as editable text
|
||||
in front of the cursor, as opposed to being bracketed and uneditable as
|
||||
it is in Pico. The old behavior could be made compatible with Pico via
|
||||
the @code{-p} flag, but recent versions of Pico use the @code{-p} flag
|
||||
to preserve the XON and XOFF sequences within the editor. Since with
|
||||
the new method search and replace strings can still be edited by simply
|
||||
hitting the up arrow key once, the old method was removed completely.
|
||||
|
||||
|
||||
@@ -405,13 +408,12 @@ Text selected using the Control-Caret (^^) key can be written out or
|
||||
appended to a new or existing file using the Writeout key (^O).
|
||||
|
||||
@item Toggles
|
||||
Many options which alter the functionality of the program can be
|
||||
"toggled" on or off using Meta key sequences, meaning the program does
|
||||
not have to be restarted to turn a particular feature of the editor
|
||||
on or off. Please see the internal help function (^G) for a list of
|
||||
what functions can be toggled for a particular version of
|
||||
@code{nano}. Also see @xref{Feature Toggles}, though this may be out
|
||||
of date.
|
||||
Many options which alter the functionality of the program can be
|
||||
"toggled" on or off using Meta key sequences, meaning the program does
|
||||
not have to be restarted to turn a particular feature of the editor on
|
||||
or off. Please see the internal help function (^G) for a list of what
|
||||
functions can be toggled for a particular version of @code{nano}. Also
|
||||
see @xref{Feature Toggles}, though this may be out of date.
|
||||
|
||||
@item Cursor Position Display
|
||||
The output of the "Display Cursor Position" in @code{nano} displays
|
||||
@@ -420,21 +422,21 @@ position of the cursor.
|
||||
|
||||
@item Interactive Replace and Spell Checker
|
||||
It is worth noting that the @code{nano} replace function is interactive,
|
||||
i.e. it does not stop after one search string is found and automatically
|
||||
i.e, it does not stop after one search string is found and automatically
|
||||
replace it. The @code{nano} implementation will stop at each search
|
||||
string found and query whether to replace this instance or not. The
|
||||
internal spell checker operates similarly. Note that these is no way
|
||||
to force these functions to behave in the Pico fashion. As of
|
||||
version 1.2.2, misspelled words are sorted and trimmed for
|
||||
uniqueness in the internal spell checker such that the words 'apple'
|
||||
and 'Apple' will be prompted for correction separately.
|
||||
string found and query whether to replace this instance or not. The
|
||||
internal spell checker operates similarly. Note that these is no way to
|
||||
force these functions to behave in the Pico fashion. As of version
|
||||
1.2.2, misspelled words are sorted and trimmed for uniqueness in the
|
||||
internal spell checker such that the words 'apple' and 'Apple' will be
|
||||
prompted for correction separately.
|
||||
@end table
|
||||
|
||||
@node Building and Configure Options, , Pico Compatibility, Top
|
||||
@chapter Building and Configure Options
|
||||
|
||||
Building @code{nano} from source is fairly straightforward if you are familiar
|
||||
with compiling programs with autoconf support:
|
||||
Building @code{nano} from source is fairly straightforward if you are
|
||||
familiar with compiling programs with autoconf support:
|
||||
|
||||
@itemize @bullet
|
||||
@item tar xvfz nano-x.y.z.tar.gz (where x.y.z is the version of nano)
|
||||
@@ -486,7 +488,7 @@ Disable all word wrapping in the editor. This also eliminates the -w
|
||||
command line flag, as nonwrapping is then the default behavior.
|
||||
|
||||
@item --disable-nls
|
||||
Disables Native Language support. This will make the available GNU
|
||||
Disables Native Language support. This will make the available GNU
|
||||
@code{nano} translations unusable.
|
||||
|
||||
@item --with-slang
|
||||
222
move.c
222
move.c
@@ -1,222 +0,0 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* move.c *
|
||||
* *
|
||||
* Copyright (C) 1999-2003 Chris Allegretta *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2, or (at your option) *
|
||||
* any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include "proto.h"
|
||||
#include "nano.h"
|
||||
|
||||
int do_home(void)
|
||||
{
|
||||
current_x = 0;
|
||||
placewewant = 0;
|
||||
update_line(current, current_x);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int do_end(void)
|
||||
{
|
||||
current_x = strlen(current->data);
|
||||
placewewant = xplustabs();
|
||||
update_line(current, current_x);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void page_up(void)
|
||||
{
|
||||
if (edittop != fileage) {
|
||||
#ifndef NANO_SMALL
|
||||
if (ISSET(SMOOTHSCROLL))
|
||||
edit_update(edittop->prev, TOP);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
edit_update(edittop, CENTER);
|
||||
/* Now that we've updated the edit window, edittop might be
|
||||
at the top of the file; if so, just move the cursor up one
|
||||
line and don't center it. */
|
||||
if (edittop != fileage)
|
||||
center_cursor();
|
||||
else
|
||||
reset_cursor();
|
||||
}
|
||||
} else
|
||||
current_y = 0;
|
||||
|
||||
update_cursor();
|
||||
}
|
||||
|
||||
int do_page_up(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
wrap_reset();
|
||||
current_x = 0;
|
||||
placewewant = 0;
|
||||
|
||||
if (current == fileage)
|
||||
return 0;
|
||||
|
||||
current_y = 0;
|
||||
current = edittop;
|
||||
for (i = 0; i <= editwinrows - 3 && current->prev != NULL; i++)
|
||||
current = current->prev;
|
||||
|
||||
edit_update(current, TOP);
|
||||
update_cursor();
|
||||
|
||||
check_statblank();
|
||||
return 1;
|
||||
}
|
||||
|
||||
int do_page_down(void)
|
||||
{
|
||||
wrap_reset();
|
||||
current_x = 0;
|
||||
placewewant = 0;
|
||||
|
||||
if (current == filebot)
|
||||
return 0;
|
||||
|
||||
/* AHEM, if we only have a screen or less of text, DON'T do an
|
||||
edit_update(), just move the cursor to editbot! */
|
||||
if (edittop == fileage && editbot == filebot && totlines < editwinrows) {
|
||||
current = editbot;
|
||||
reset_cursor();
|
||||
#ifndef NANO_SMALL
|
||||
/* ...unless marking is on, in which case we need it to update
|
||||
the highlight. */
|
||||
if (ISSET(MARK_ISSET))
|
||||
edit_update(current, NONE);
|
||||
#endif
|
||||
} else if (editbot != filebot || edittop == fileage) {
|
||||
current_y = 0;
|
||||
current = editbot;
|
||||
|
||||
if (current->prev != NULL)
|
||||
current = current->prev;
|
||||
if (current->prev != NULL)
|
||||
current = current->prev;
|
||||
edit_update(current, TOP);
|
||||
} else {
|
||||
while (current != filebot) {
|
||||
current = current->next;
|
||||
current_y++;
|
||||
}
|
||||
edit_update(edittop, TOP);
|
||||
}
|
||||
|
||||
update_cursor();
|
||||
check_statblank();
|
||||
return 1;
|
||||
}
|
||||
|
||||
int do_up(void)
|
||||
{
|
||||
wrap_reset();
|
||||
if (current->prev != NULL) {
|
||||
current_x = actual_x(current->prev, placewewant);
|
||||
current = current->prev;
|
||||
if (current_y > 0) {
|
||||
update_line(current->next, 0);
|
||||
/* It is necessary to change current first, so the mark
|
||||
display will change! */
|
||||
current_y--;
|
||||
update_line(current, current_x);
|
||||
} else
|
||||
page_up();
|
||||
check_statblank();
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Return value 1 means we moved down, 0 means we were already at the
|
||||
* bottom. */
|
||||
int do_down(void)
|
||||
{
|
||||
wrap_reset();
|
||||
check_statblank();
|
||||
|
||||
if (current->next == NULL)
|
||||
return 0;
|
||||
|
||||
current = current->next;
|
||||
current_x = actual_x(current, placewewant);
|
||||
|
||||
/* Note current_y is zero-based. This test checks for the cursor's
|
||||
* being on the last row of the edit window. */
|
||||
if (current_y == editwinrows - 1) {
|
||||
#ifndef NANO_SMALL
|
||||
if (ISSET(SMOOTHSCROLL)) {
|
||||
/* In this case current_y does not change. The cursor
|
||||
* remains at the bottom of the edit window. */
|
||||
edittop = edittop->next;
|
||||
editbot = editbot->next;
|
||||
edit_refresh();
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
/* Set edittop so editbot->next (or else editbot) is
|
||||
* centered, and set current_y = editwinrows / 2. */
|
||||
edit_update(editbot->next != NULL ? editbot->next : editbot, CENTER);
|
||||
center_cursor();
|
||||
}
|
||||
} else {
|
||||
update_line(current->prev, 0);
|
||||
update_line(current, current_x);
|
||||
current_y++;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int do_left(void)
|
||||
{
|
||||
if (current_x > 0)
|
||||
current_x--;
|
||||
else if (current != fileage) {
|
||||
do_up();
|
||||
current_x = strlen(current->data);
|
||||
}
|
||||
placewewant = xplustabs();
|
||||
update_line(current, current_x);
|
||||
check_statblank();
|
||||
return 1;
|
||||
}
|
||||
|
||||
int do_right(void)
|
||||
{
|
||||
assert(current_x <= strlen(current->data));
|
||||
|
||||
if (current->data[current_x] != '\0')
|
||||
current_x++;
|
||||
else if (current->next != NULL) {
|
||||
do_down();
|
||||
current_x = 0;
|
||||
}
|
||||
placewewant = xplustabs();
|
||||
update_line(current, current_x);
|
||||
check_statblank();
|
||||
return 1;
|
||||
}
|
||||
298
nano.1.html
298
nano.1.html
@@ -1,298 +0,0 @@
|
||||
<HTML><HEAD><TITLE>Manpage of NANO</TITLE>
|
||||
</HEAD><BODY>
|
||||
<H1>NANO</H1>
|
||||
Section: User Commands (1)<BR>Updated: June 19, 2003<BR><A HREF="#index">Index</A>
|
||||
<A HREF="http://localhost/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
||||
|
||||
|
||||
|
||||
<P>
|
||||
<A NAME="lbAB"> </A>
|
||||
<H2>NAME</H2>
|
||||
|
||||
nano - Nano's ANOther editor, an enhanced free Pico clone
|
||||
<P>
|
||||
<A NAME="lbAC"> </A>
|
||||
<H2>SYNOPSIS</H2>
|
||||
|
||||
<B>nano</B>
|
||||
|
||||
<I>[+LINE] [options] [file]</I>
|
||||
|
||||
<BR>
|
||||
|
||||
<P>
|
||||
<A NAME="lbAD"> </A>
|
||||
<H2>DESCRIPTION</H2>
|
||||
|
||||
This manual page documents briefly the <B>nano</B> command.
|
||||
<P>
|
||||
|
||||
|
||||
|
||||
|
||||
<B>nano</B> is a small, free and friendly editor which aims to replace
|
||||
Pico, the default editor included in the non-free Pine package. Rather
|
||||
than just copying Pico's look and feel, <B>nano</B> also implements some
|
||||
missing (or disabled by default) features in Pico, such as "search and
|
||||
replace" and "go to line number".
|
||||
<P>
|
||||
<A NAME="lbAE"> </A>
|
||||
<H2>OPTIONS</H2>
|
||||
|
||||
<DL COMPACT>
|
||||
<DT><B>+</B><I>LINE</I>
|
||||
|
||||
<DD>
|
||||
Places cursor at <I>LINE</I> on startup.
|
||||
<DT><B>-B (--backup)</B>
|
||||
|
||||
<DD>
|
||||
When saving a file, back up the previous version of it to the current
|
||||
filename suffixed with a ~.
|
||||
<DT><B>-D (--dos)</B>
|
||||
|
||||
<DD>
|
||||
Write file in DOS format.
|
||||
<DT><B>-F (--multibuffer)</B>
|
||||
|
||||
<DD>
|
||||
Enable multiple file buffers, if available.
|
||||
<DT><B>-H (--historylog)</B>
|
||||
|
||||
<DD>
|
||||
Log search and replace strings to
|
||||
<I>~/.nano_history</I>
|
||||
|
||||
so they may be stored for later editing, if nanorc support is
|
||||
configured.
|
||||
<DT><B>-I (--ignorercfiles)</B>
|
||||
|
||||
<DD>
|
||||
Don't look at
|
||||
<I>$SYSCONFDIR/nanorc</I>
|
||||
|
||||
or
|
||||
<I>~/.nanorc</I>,
|
||||
|
||||
if nanorc support is available.
|
||||
<DT><B>-K (--keypad)</B>
|
||||
|
||||
<DD>
|
||||
Do not use the ncurses keypad() call unless necessary. Try this flag if
|
||||
you find that the arrow keys on the numeric keypad do not work for you
|
||||
under nano.
|
||||
<DT><B>-M (--mac)</B>
|
||||
|
||||
<DD>
|
||||
Write file in Mac format.
|
||||
<DT><B>-N (--noconvert)</B>
|
||||
|
||||
<DD>
|
||||
Disable automatic conversion of files from DOS/Mac format.
|
||||
<DT><B>-Q </B><I>str</I> (--quotestr=<I>str</I>)
|
||||
|
||||
<DD>
|
||||
Set the quoting string for justifying. The default is
|
||||
"^([ \t]*[|>:}#])+" if regular expression support is available, or
|
||||
"> " otherwise.
|
||||
<DT><B>-R (--regexp)</B>
|
||||
|
||||
<DD>
|
||||
Enable regular expression matching for search strings, as well as
|
||||
\n subexpression replacement for replace strings, if available.
|
||||
<DT><B>-S (--smooth)</B>
|
||||
|
||||
<DD>
|
||||
Enable smooth scrolling. Text will scroll line-by-line, instead of the
|
||||
usual chunk-by-chunk behavior.
|
||||
<DT><B>-T </B><I>num</I> (--tabsize=<I>num</I>)
|
||||
|
||||
<DD>
|
||||
Set the size (width) of a tab.
|
||||
<DT><B>-V (--version)</B>
|
||||
|
||||
<DD>
|
||||
Show the current version number and author.
|
||||
<DT><B>-Y </B><I>str</I> (--syntax=<I>str</I>)
|
||||
|
||||
<DD>
|
||||
Specify a specific syntax highlighting from the
|
||||
<I>.nanorc</I>
|
||||
|
||||
to use, if available.
|
||||
<DT><B>-c (--const)</B>
|
||||
|
||||
<DD>
|
||||
Constantly show the cursor position.
|
||||
<DT><B>-h (--help)</B>
|
||||
|
||||
<DD>
|
||||
Display a summary of command line options.
|
||||
<DT><B>-i (--autoindent)</B>
|
||||
|
||||
<DD>
|
||||
Indent new lines to the previous line's indentation. Useful when editing
|
||||
source code.
|
||||
<DT><B>-k (--cut)</B>
|
||||
|
||||
<DD>
|
||||
Enable cut from cursor to end of line with ^K.
|
||||
<DT><B>-l (--nofollow)</B>
|
||||
|
||||
<DD>
|
||||
If the file being edited is a symbolic link, replace the link with
|
||||
a new file, do not follow it. Good for editing files in
|
||||
<I>/tmp</I>,
|
||||
|
||||
perhaps?
|
||||
<DT><B>-m (--mouse)</B>
|
||||
|
||||
<DD>
|
||||
Enable mouse support (if available for your system).
|
||||
<DT><B>-o </B><I>dir</I> (--operatingdir=<I>dir</I>)
|
||||
|
||||
<DD>
|
||||
Set operating directory. Makes nano set up something similar to a
|
||||
chroot.
|
||||
<DT><B>-p (--preserve)</B>
|
||||
|
||||
<DD>
|
||||
Preserve the XON and XOFF sequences (^Q and ^S) so they will be
|
||||
caught by the terminal.
|
||||
<DT><B>-r </B><I>cols</I> (--fill=<I>cols</I>)
|
||||
|
||||
<DD>
|
||||
Wrap lines at column <I>cols</I>. By default, this is the width of the
|
||||
screen, less eight. If this value is negative, wrapping will occur at
|
||||
<I>cols</I> columns from the right of the screen, allowing the wrap point
|
||||
to vary along with the screen width if resized.
|
||||
<DT><B>-s </B><I>prog</I> (--speller=<I>prog</I>)
|
||||
|
||||
<DD>
|
||||
Enable alternative spell checker command.
|
||||
<DT><B>-t (--tempfile)</B>
|
||||
|
||||
<DD>
|
||||
Always save changed buffer without prompting. Same as Pico -t option.
|
||||
<DT><B>-v (--view)</B>
|
||||
|
||||
<DD>
|
||||
View file (read only) mode.
|
||||
<DT><B>-w (--nowrap)</B>
|
||||
|
||||
<DD>
|
||||
Disable wrapping of long lines.
|
||||
<DT><B>-x (--nohelp)</B>
|
||||
|
||||
<DD>
|
||||
Disable help screen at bottom of editor.
|
||||
<DT><B>-z (--suspend)</B>
|
||||
|
||||
<DD>
|
||||
Enable suspend ability.
|
||||
<DT><B>-a, -b, -e, -f, -g, -j</B>
|
||||
|
||||
<DD>
|
||||
Ignored, for compatibility with Pico.
|
||||
<P>
|
||||
</DL>
|
||||
<A NAME="lbAF"> </A>
|
||||
<H2>INITIALIZATION FILE</H2>
|
||||
|
||||
<B>nano</B> will read initialization files in the following
|
||||
order:
|
||||
<I>$SYSCONFDIR/nanorc</I>,
|
||||
|
||||
then
|
||||
<I>~/.nanorc</I>.
|
||||
|
||||
Please see
|
||||
<B><A HREF="http://localhost/cgi-bin/man/man2html?5+nanorc">nanorc</A></B>(5)
|
||||
|
||||
and the example file <B>nanorc.sample</B> which should be provided with
|
||||
<B>nano</B>.
|
||||
<P>
|
||||
<A NAME="lbAG"> </A>
|
||||
<H2>NOTES</H2>
|
||||
|
||||
<B>nano</B> will try to dump the buffer into an emergency file in some
|
||||
cases. Mainly, this will happen if <B>nano</B> receives a SIGHUP or
|
||||
SIGTERM or runs out of memory, when it will write the buffer into a file
|
||||
named
|
||||
<I>nano.save</I>
|
||||
|
||||
if the buffer didn't have a name already, or will add a ".save" suffix
|
||||
to the current filename. If an emergency file with that name already
|
||||
exists in the current directory, ".save" and a number (e.g. ".save.1")
|
||||
will be suffixed to the current filename in order to make it unique. In
|
||||
multibuffer mode, <B>nano</B> will write all the open buffers to the
|
||||
respective emergency files.
|
||||
<P>
|
||||
<A NAME="lbAH"> </A>
|
||||
<H2>BUGS</H2>
|
||||
|
||||
Please send any comments or bug reports to
|
||||
<B><A HREF="mailto:nano@nano-editor.org">nano@nano-editor.org</A></B>.
|
||||
|
||||
<P>
|
||||
The <B>nano</B> mailing list is available from
|
||||
<B><A HREF="mailto:nano-devel@gnu.org">nano-devel@gnu.org</A></B>.
|
||||
|
||||
<P>
|
||||
To subscribe, email to
|
||||
<B><A HREF="mailto:nano-devel-request@gnu.org">nano-devel-request@gnu.org</A></B>
|
||||
|
||||
with a subject of "subscribe".
|
||||
<P>
|
||||
<A NAME="lbAI"> </A>
|
||||
<H2>HOMEPAGE</H2>
|
||||
|
||||
<A HREF="http://www.nano-editor.org/">http://www.nano-editor.org/</A>
|
||||
<P>
|
||||
<A NAME="lbAJ"> </A>
|
||||
<H2>SEE ALSO</H2>
|
||||
|
||||
|
||||
<DL COMPACT>
|
||||
<DT><B><A HREF="http://localhost/cgi-bin/man/man2html?5+nanorc">nanorc</A></B>(5)<DD>
|
||||
</DL>
|
||||
<P>
|
||||
|
||||
<I>/usr/share/doc/nano/</I> (or equivalent on your system)
|
||||
<P>
|
||||
<A NAME="lbAK"> </A>
|
||||
<H2>AUTHOR</H2>
|
||||
|
||||
Chris Allegretta <<A HREF="mailto:chrisa@asty.org">chrisa@asty.org</A>>, et al (see
|
||||
<I>AUTHORS</I>
|
||||
|
||||
and
|
||||
<I>THANKS</I>
|
||||
|
||||
for details). This manual page was originally written by Jordi Mallach
|
||||
<<A HREF="mailto:jordi@sindominio.net">jordi@sindominio.net</A>>, for the Debian GNU system (but may be
|
||||
used by others).
|
||||
<P>
|
||||
|
||||
<HR>
|
||||
<A NAME="index"> </A><H2>Index</H2>
|
||||
<DL>
|
||||
<DT><A HREF="#lbAB">NAME</A><DD>
|
||||
<DT><A HREF="#lbAC">SYNOPSIS</A><DD>
|
||||
<DT><A HREF="#lbAD">DESCRIPTION</A><DD>
|
||||
<DT><A HREF="#lbAE">OPTIONS</A><DD>
|
||||
<DT><A HREF="#lbAF">INITIALIZATION FILE</A><DD>
|
||||
<DT><A HREF="#lbAG">NOTES</A><DD>
|
||||
<DT><A HREF="#lbAH">BUGS</A><DD>
|
||||
<DT><A HREF="#lbAI">HOMEPAGE</A><DD>
|
||||
<DT><A HREF="#lbAJ">SEE ALSO</A><DD>
|
||||
<DT><A HREF="#lbAK">AUTHOR</A><DD>
|
||||
</DL>
|
||||
<HR>
|
||||
This document was created by
|
||||
<A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
|
||||
using the manual pages.<BR>
|
||||
Time: 22:27:55 GMT, June 19, 2003
|
||||
</BODY>
|
||||
</HTML>
|
||||
195
nanorc.5.html
195
nanorc.5.html
@@ -1,195 +0,0 @@
|
||||
<HTML><HEAD><TITLE>Manpage of NANORC</TITLE>
|
||||
</HEAD><BODY>
|
||||
<H1>NANORC</H1>
|
||||
Section: File Formats (5)<BR>Updated: June 19, 2003<BR><A HREF="#index">Index</A>
|
||||
<A HREF="http://localhost/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
||||
|
||||
|
||||
|
||||
<A NAME="lbAB"> </A>
|
||||
<H2>NAME</H2>
|
||||
|
||||
nanorc - GNU nano's rcfile
|
||||
<A NAME="lbAC"> </A>
|
||||
<H2>DESCRIPTION</H2>
|
||||
|
||||
This manual page documents GNU <B>nano</B>'s rcfile.
|
||||
<P>
|
||||
|
||||
<B>nano</B> is a small, free and friendly editor which aims to replace
|
||||
Pico, the default editor included in the non-free Pine package. Rather
|
||||
than just copying Pico's look and feel, <B>nano</B> also implements some
|
||||
missing (or disabled by default) features in Pico, such as "search and
|
||||
replace" and "go to line number".
|
||||
<P>
|
||||
|
||||
The <I>nanorc</I> file contains the default settings for <B>nano</B>.
|
||||
During startup, <B>nano</B> will first read its system-wide settings from
|
||||
<I>$SYSCONFDIR/nanorc</I>,
|
||||
|
||||
and then user-specific settings from
|
||||
<I>~/.nanorc</I>.
|
||||
|
||||
<P>
|
||||
<A NAME="lbAD"> </A>
|
||||
<H2>OPTIONS</H2>
|
||||
|
||||
The configuration file accepts a series of "set" and "unset" commands,
|
||||
which can be used to configure nano on startup without using the
|
||||
command-line options. Additionally, the "syntax" and "color" keywords
|
||||
are used to define syntax highlighting rules for different text patterns.
|
||||
GNU nano will read one command per line.
|
||||
<P>
|
||||
Options in rcfiles take precedence over nano's defaults, and command line
|
||||
options override rcfile settings.
|
||||
<P>
|
||||
Options are unset by default, except for options that take an argument.
|
||||
<P>
|
||||
The supported commands and arguments are:
|
||||
<P>
|
||||
<DL COMPACT>
|
||||
<DT><B>set/unset autoindent</B><DD>
|
||||
Use auto-indentation.
|
||||
<DT><B>set/unset backup</B><DD>
|
||||
Create backup files in
|
||||
<I>filename~</I>.
|
||||
|
||||
<DT><B>set/unset const</B><DD>
|
||||
Constantly display the cursor position in the status bar.
|
||||
<DT><B>set/unset cut</B><DD>
|
||||
Use cut to end of line with ^K by default.
|
||||
<DT><B>set fill </B><I>n</I><DD>
|
||||
Wrap lines at column number <I>n</I>. If <I>n</I> is 0 or less, the line
|
||||
length will be the screen width less <I>n</I>. The default value is -8.
|
||||
<DT><B>set/unset historylog</B><DD>
|
||||
Enable
|
||||
<I>~/.nano_history</I>
|
||||
|
||||
for saving and reading search/replace strings.
|
||||
<DT><B>set/unset keypad</B><DD>
|
||||
Use alternate keypad routines.
|
||||
<DT><B>set/unset multibuffer</B><DD>
|
||||
Allow inserting files into their own buffers.
|
||||
<DT><B>set/unset noconvert</B><DD>
|
||||
Don't convert files from DOS/Mac format.
|
||||
<DT><B>set/unset nofollow</B><DD>
|
||||
Don't follow symlinks when writing files.
|
||||
<DT><B>set/unset nohelp</B><DD>
|
||||
Don't display the help lists at the bottom of the screen.
|
||||
<DT><B>set/unset nowrap</B><DD>
|
||||
Don't wrap text at all.
|
||||
<DT><B>set operatingdir "</B><I>directory</I>"<DD>
|
||||
<B>nano</B> will only read and write files inside <I>directory</I> and its
|
||||
subdirectories. Also, the current directory is changed to here, so files
|
||||
are inserted from this dir. By default the operating directory feature is
|
||||
turned off.
|
||||
<DT><B>set/unset preserve</B><DD>
|
||||
Preserve the XON and XOFF keys (^Q and ^S).
|
||||
<DT><B>set quotestr "</B><I>string</I>"<DD>
|
||||
The email-quote string, used to justify email-quoted paragraphs. This is
|
||||
an "extended regular expression" if your system supports them, otherwise a
|
||||
literal string. The default value is
|
||||
<P>
|
||||
<TT> </TT>set quotestr "^([ \t]*[|>:}#])+"<BR>
|
||||
<P>
|
||||
if you have regexps, otherwise set quotestr "> ". Note that '\t'
|
||||
above stands for a literal Tab character.
|
||||
<DT><B>set/unset regexp</B><DD>
|
||||
Do regular expression searches by default.
|
||||
<DT><B>set/unset smooth</B><DD>
|
||||
Use smooth scrolling by default.
|
||||
<DT><B>set speller </B><I>spellprog</I><DD>
|
||||
Use spelling checker <I>spellprog</I> instead of the built-in one, which
|
||||
calls <I>spell</I>.
|
||||
<DT><B>set/unset suspend</B><DD>
|
||||
Allow nano to be suspended with ^Z.
|
||||
<DT><B>set tabsize </B><I>n</I><DD>
|
||||
Use a tab size of <I>n</I> instead of the default (8); must be greater
|
||||
than 0.
|
||||
<DT><B>set/unset tempfile</B><DD>
|
||||
Save automatically on exit, don't prompt.
|
||||
<DT><B>set/unset view</B><DD>
|
||||
Disallow file modification.
|
||||
<DT><B>syntax </B><I>str</I> [<I>fileregex</I> ... ]
|
||||
|
||||
<DD>
|
||||
Defines a syntax named <I>str</I> which can be activated via the
|
||||
<B>-Y</B> flag, or will be automatically activated if the current
|
||||
filename matches <I>fileregex</I>. All following <B>color</B> statements
|
||||
will apply to <I>syntax</I> until a new syntax is defined.
|
||||
<DT><B>color </B><I>fgcolor</I>[,<I>bgcolor</I>] <I>regex</I> ...
|
||||
|
||||
<DD>
|
||||
For the currently defined syntax, display all expressions matching
|
||||
<I>regex</I> with foreground color <I>fgcolor</I> and optional background
|
||||
color <I>bgcolor</I>. Legal colors for foreground and background color are:
|
||||
white, black, red, blue, green, yellow, magenta, and cyan. You may use
|
||||
the prefix "bright" to force a stronger color highlight. If your
|
||||
terminal supports transparency, not specifying a <I>bgcolor</I> tells
|
||||
<B>nano</B> to attempt to use a transparent background.
|
||||
<DT><B>color </B><I>fgcolor</I>[,<I>bgcolor</I>] start=<I>sr</I> end=<I>er</I>
|
||||
|
||||
<DD>
|
||||
Display expressions which start with <I>sr</I> and end with <I>er</I>
|
||||
with foreground color <I>fgcolor</I> and optional
|
||||
background color <I>bgcolor</I>. This allows syntax highlighting to span
|
||||
multiple lines. Note that all subsequent instances of <I>sr</I> after
|
||||
an initial <I>sr</I> is found will be highlighted until the first
|
||||
instance of <I>er</I>.
|
||||
<I>
|
||||
<P>
|
||||
</DL>
|
||||
</I><A NAME="lbAE"> </A>
|
||||
<H2>FILES</H2>
|
||||
|
||||
<DL COMPACT>
|
||||
<DT><I>$SYSCONFDIR/nanorc</I>
|
||||
|
||||
<DD>
|
||||
System-wide configuration file
|
||||
<DT><I>~/.nanorc</I>
|
||||
|
||||
<DD>
|
||||
Per-user configuration file
|
||||
</DL>
|
||||
<A NAME="lbAF"> </A>
|
||||
<H2>SEE ALSO</H2>
|
||||
|
||||
|
||||
<DL COMPACT>
|
||||
<DT><B><A HREF="http://localhost/cgi-bin/man/man2html?1+nano">nano</A></B>(1)<DD>
|
||||
</DL>
|
||||
<P>
|
||||
|
||||
<I>/usr/share/doc/nano/examples/nanorc.sample</I> (or equivalent on your
|
||||
system)
|
||||
<A NAME="lbAG"> </A>
|
||||
<H2>AUTHOR</H2>
|
||||
|
||||
Chris Allegretta <<A HREF="mailto:chrisa@asty.org">chrisa@asty.org</A>>, et al (see
|
||||
<I>AUTHORS</I>
|
||||
|
||||
and
|
||||
<I>THANKS</I>
|
||||
|
||||
for details).
|
||||
This manual page was written by Jordi Mallach <<A HREF="mailto:jordi@gnu.org">jordi@gnu.org</A>>.
|
||||
<P>
|
||||
|
||||
<HR>
|
||||
<A NAME="index"> </A><H2>Index</H2>
|
||||
<DL>
|
||||
<DT><A HREF="#lbAB">NAME</A><DD>
|
||||
<DT><A HREF="#lbAC">DESCRIPTION</A><DD>
|
||||
<DT><A HREF="#lbAD">OPTIONS</A><DD>
|
||||
<DT><A HREF="#lbAE">FILES</A><DD>
|
||||
<DT><A HREF="#lbAF">SEE ALSO</A><DD>
|
||||
<DT><A HREF="#lbAG">AUTHOR</A><DD>
|
||||
</DL>
|
||||
<HR>
|
||||
This document was created by
|
||||
<A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
|
||||
using the manual pages.<BR>
|
||||
Time: 22:28:00 GMT, June 19, 2003
|
||||
</BODY>
|
||||
</HTML>
|
||||
18
po/ChangeLog
18
po/ChangeLog
@@ -1,4 +1,20 @@
|
||||
2003-08-05 Jordi Mallach <jordi@sindominio.net>
|
||||
2003-10-18 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ca.po: Updated Catalan translation.
|
||||
|
||||
2003-09-12 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* POTFILES.in: Updated path to sources.
|
||||
|
||||
2003-09-01 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fr.po: Updated French translation by Jean-Philippe Guérard.
|
||||
|
||||
2003-08-17 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* tr.po: Updated Turkish translation by A. Murat EREN.
|
||||
|
||||
2003-08-05 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ca.po: Updated Catalan translation.
|
||||
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
# List of source files containing translatable strings.
|
||||
|
||||
# Package source files
|
||||
cut.c
|
||||
files.c
|
||||
global.c
|
||||
move.c
|
||||
nano.c
|
||||
rcfile.c
|
||||
search.c
|
||||
utils.c
|
||||
winio.c
|
||||
src/cut.c
|
||||
src/files.c
|
||||
src/global.c
|
||||
src/move.c
|
||||
src/nano.c
|
||||
src/rcfile.c
|
||||
src/search.c
|
||||
src/utils.c
|
||||
src/winio.c
|
||||
|
||||
# Package header files
|
||||
nano.h
|
||||
proto.h
|
||||
src/nano.h
|
||||
src/proto.h
|
||||
|
||||
178
po/ca.po
178
po/ca.po
@@ -1,14 +1,13 @@
|
||||
# Catalan messages for the GNU nano editor.
|
||||
# Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
# Copyright © 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
# Jordi Mallach <jordi@gnu.org>, 2000, 2001, 2002, 2003.
|
||||
# Miquel Vidal <miquel@sindominio.net>, 2001.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: nano 1.2.1\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Project-Id-Version: nano 1.2.2\n"
|
||||
"POT-Creation-Date: 2003-08-11 21:49-0400\n"
|
||||
"PO-Revision-Date: 2003-08-05 23:25+0200\n"
|
||||
"PO-Revision-Date: 2003-10-18 12:48+0200\n"
|
||||
"Last-Translator: Jordi Mallach <jordi@gnu.org>\n"
|
||||
"Language-Team: Catalan <ca@dodds.net>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -44,7 +43,7 @@ msgstr "
|
||||
|
||||
#: files.c:347
|
||||
msgid "New File"
|
||||
msgstr "Nou Fitxer"
|
||||
msgstr "Nou fitxer"
|
||||
|
||||
#: files.c:353
|
||||
#, c-format
|
||||
@@ -127,16 +126,12 @@ msgstr "No s'ha pogut establir permisos %o en la c
|
||||
#: files.c:1419
|
||||
#, c-format
|
||||
msgid "Could not set owner %d/group %d on backup %s: %s"
|
||||
msgstr ""
|
||||
"No s'ha pogut establir el propietari %d/grup %d en la còpia de seguretat %s: "
|
||||
"%s"
|
||||
msgstr "No s'ha pogut establir el propietari %d/grup %d en la còpia de seguretat %s: %s"
|
||||
|
||||
#: files.c:1424
|
||||
#, c-format
|
||||
msgid "Could not set access/modification time on backup %s: %s"
|
||||
msgstr ""
|
||||
"No s'ha pogut establir la data d'accés modificació en la còpia de seguretat %"
|
||||
"s: %s"
|
||||
msgstr "No s'ha pogut establir la data d'accés modificació en la còpia de seguretat %s: %s"
|
||||
|
||||
#: files.c:1459 files.c:1475 files.c:1487 files.c:1509 files.c:1542
|
||||
#: files.c:1549 files.c:1561
|
||||
@@ -544,7 +539,7 @@ msgstr "Desjustifica"
|
||||
|
||||
#: global.c:484
|
||||
msgid "UnCut Txt"
|
||||
msgstr "Engantxa"
|
||||
msgstr "Enganxa"
|
||||
|
||||
#: global.c:489
|
||||
msgid "Cur Pos"
|
||||
@@ -738,27 +733,18 @@ msgstr "La tecla
|
||||
msgid ""
|
||||
"Search Command Help Text\n"
|
||||
"\n"
|
||||
" Enter the words or characters you would like to search for, then hit "
|
||||
"enter. If there is a match for the text you entered, the screen will be "
|
||||
"updated to the location of the nearest match for the search string.\n"
|
||||
" Enter the words or characters you would like to search for, then hit enter. If there is a match for the text you entered, the screen will be updated to the location of the nearest match for the search string.\n"
|
||||
"\n"
|
||||
" The previous search string will be shown in brackets after the Search: "
|
||||
"prompt. Hitting Enter without entering any text will perform the previous "
|
||||
"search.\n"
|
||||
" The previous search string will be shown in brackets after the Search: prompt. Hitting Enter without entering any text will perform the previous search.\n"
|
||||
"\n"
|
||||
" The following function keys are available in Search mode:\n"
|
||||
"\n"
|
||||
msgstr ""
|
||||
"Text d'ajuda per a l'ordre Cerca\n"
|
||||
"\n"
|
||||
" Introduïu les paraules o caràcters que voleu cercar i premeu Retorn. Si hi "
|
||||
"ha una coincidència per a el text que heu introduït, la pantalla "
|
||||
"s'actualitzarà al lloc on està la coincidència de la cadena cercada més "
|
||||
"propera.\n"
|
||||
" Introduïu les paraules o caràcters que voleu cercar i premeu Retorn. Si hi ha una coincidència per a el text que heu introduït, la pantalla s'actualitzarà al lloc on està la coincidència de la cadena cercada més propera.\n"
|
||||
"\n"
|
||||
" La cadena de la cerca anterior es mostrarà entre claudàtors després del "
|
||||
"indicatiu Cerca:. Prémer Retorn sense introduir cap texte durà a terme la "
|
||||
"anterior cerca.\n"
|
||||
" La cadena de la cerca anterior es mostrarà entre claudàtors després del indicatiu Cerca:. Prémer Retorn sense introduir cap texte durà a terme la anterior cerca.\n"
|
||||
"\n"
|
||||
" Les següents tecles de funció estan disponibles en el mode Cerca:\n"
|
||||
"\n"
|
||||
@@ -767,18 +753,14 @@ msgstr ""
|
||||
msgid ""
|
||||
"Go To Line Help Text\n"
|
||||
"\n"
|
||||
" Enter the line number that you wish to go to and hit Enter. If there are "
|
||||
"fewer lines of text than the number you entered, you will be brought to the "
|
||||
"last line of the file.\n"
|
||||
" Enter the line number that you wish to go to and hit Enter. If there are fewer lines of text than the number you entered, you will be brought to the last line of the file.\n"
|
||||
"\n"
|
||||
" The following function keys are available in Go To Line mode:\n"
|
||||
"\n"
|
||||
msgstr ""
|
||||
"Text d'ajuda d'Anar a línia\n"
|
||||
"\n"
|
||||
" Introduïu el número de la línia a la que voleu anar i premeu Retorn. Si hi "
|
||||
"ha menys línias de texte que el número que heu introduit, el cursor es mourà "
|
||||
"a la última línia del fitxer.\n"
|
||||
" Introduïu el número de la línia a la que voleu anar i premeu Retorn. Si hi ha menys línias de texte que el número que heu introduit, el cursor es mourà a la última línia del fitxer.\n"
|
||||
"\n"
|
||||
" Les següents tecles de funció estan disponibles en el mode Anar a línia:\n"
|
||||
"\n"
|
||||
@@ -787,61 +769,42 @@ msgstr ""
|
||||
msgid ""
|
||||
"Insert File Help Text\n"
|
||||
"\n"
|
||||
" Type in the name of a file to be inserted into the current file buffer at "
|
||||
"the current cursor location.\n"
|
||||
" Type in the name of a file to be inserted into the current file buffer at the current cursor location.\n"
|
||||
"\n"
|
||||
" If you have compiled nano with multiple file buffer support, and enable "
|
||||
"multiple buffers with the -F or --multibuffer command line flags, the Meta-F "
|
||||
"toggle, or a nanorc file, inserting a file will cause it to be loaded into a "
|
||||
"separate buffer (use Meta-< and > to switch between file buffers).\n"
|
||||
" If you have compiled nano with multiple file buffer support, and enable multiple buffers with the -F or --multibuffer command line flags, the Meta-F toggle, or a nanorc file, inserting a file will cause it to be loaded into a separate buffer (use Meta-< and > to switch between file buffers).\n"
|
||||
"\n"
|
||||
" If you need another blank buffer, do not enter any filename, or type in a "
|
||||
"nonexistent filename at the prompt and press Enter.\n"
|
||||
" If you need another blank buffer, do not enter any filename, or type in a nonexistent filename at the prompt and press Enter.\n"
|
||||
"\n"
|
||||
" The following function keys are available in Insert File mode:\n"
|
||||
"\n"
|
||||
msgstr ""
|
||||
"Text d'ajuda d'Insereix Fitxer\n"
|
||||
"\n"
|
||||
" Escriviu el nom del fitxer a afegir en el búfer actual en la posició actual "
|
||||
"del cursor.\n"
|
||||
" Escriviu el nom del fitxer a afegir en el búfer actual en la posició actual del cursor.\n"
|
||||
"\n"
|
||||
" Si s'ha compilat nano amb suport per a múltiples fitxers i heu habilitat "
|
||||
"els búfers múltiples amb les opcions -F o --multibuffer, l'interruptor Meta-"
|
||||
"F o amb un fitxer nanorc, la inserció d'un fitxer farà que es carregue en un "
|
||||
"búfer different (feu servir Meta-< i > per a canviar de búfers de fitxer).\n"
|
||||
" Si s'ha compilat nano amb suport per a múltiples fitxers i heu habilitat els búfers múltiples amb les opcions -F o --multibuffer, l'interruptor Meta-F o amb un fitxer nanorc, la inserció d'un fitxer farà que es carregue en un búfer different (feu servir Meta-< i > per a canviar de búfers de fitxer).\n"
|
||||
"\n"
|
||||
" Si necessiteu un altre búfer en blanc, no inseriu cap nom de fitxer o "
|
||||
"escriviu el nom d'un fitxer no existent en l'indicatiu i premeu Retorn.\n"
|
||||
" Si necessiteu un altre búfer en blanc, no inseriu cap nom de fitxer o escriviu el nom d'un fitxer no existent en l'indicatiu i premeu Retorn.\n"
|
||||
"\n"
|
||||
" Les següents tecles de funció estan disponibles en el mode Insereix "
|
||||
"fitxer:\n"
|
||||
" Les següents tecles de funció estan disponibles en el mode Insereix fitxer:\n"
|
||||
"\n"
|
||||
|
||||
#: nano.c:310
|
||||
msgid ""
|
||||
"Write File Help Text\n"
|
||||
"\n"
|
||||
" Type the name that you wish to save the current file as and hit Enter to "
|
||||
"save the file.\n"
|
||||
" Type the name that you wish to save the current file as and hit Enter to save the file.\n"
|
||||
"\n"
|
||||
" If you have selected text with Ctrl-^, you will be prompted to save only "
|
||||
"the selected portion to a separate file. To reduce the chance of "
|
||||
"overwriting the current file with just a portion of it, the current filename "
|
||||
"is not the default in this mode.\n"
|
||||
" If you have selected text with Ctrl-^, you will be prompted to save only the selected portion to a separate file. To reduce the chance of overwriting the current file with just a portion of it, the current filename is not the default in this mode.\n"
|
||||
"\n"
|
||||
" The following function keys are available in Write File mode:\n"
|
||||
"\n"
|
||||
msgstr ""
|
||||
"Text d'ajuda de Desa fitxer\n"
|
||||
"\n"
|
||||
" Escriviu el nom amb el que voleu desar el fitxer actual i premeu Retorn per "
|
||||
"a salvar-ho.\n"
|
||||
" Escriviu el nom amb el que voleu desar el fitxer actual i premeu Retorn per a salvar-ho.\n"
|
||||
"\n"
|
||||
" Si esteu fent servir el codi de marcat amb Ctrl-^ i heu sel·leccionat text, "
|
||||
"s'us preguntarà si voleu desar només la porció marcada a un fitxer diferent. "
|
||||
"Per a reduir la posibilitat de sobreescriure el fitxer actual amb només una "
|
||||
"part d'ell, el nom del fitxer actual no és el predeterminat en aquest mode.\n"
|
||||
" Si esteu fent servir el codi de marcat amb Ctrl-^ i heu sel·leccionat text, s'us preguntarà si voleu desar només la porció marcada a un fitxer diferent. Per a reduir la posibilitat de sobreescriure el fitxer actual amb només una part d'ell, el nom del fitxer actual no és el predeterminat en aquest mode.\n"
|
||||
"\n"
|
||||
" Les següents tecles de funció estan disponibles en el mode Desa fitxer:\n"
|
||||
"\n"
|
||||
@@ -850,26 +813,16 @@ msgstr ""
|
||||
msgid ""
|
||||
"File Browser Help Text\n"
|
||||
"\n"
|
||||
" The file browser is used to visually browse the directory structure to "
|
||||
"select a file for reading or writing. You may use the arrow keys or Page Up/"
|
||||
"Down to browse through the files, and S or Enter to choose the selected file "
|
||||
"or enter the selected directory. To move up one level, select the directory "
|
||||
"called \"..\" at the top of the file list.\n"
|
||||
" The file browser is used to visually browse the directory structure to select a file for reading or writing. You may use the arrow keys or Page Up/Down to browse through the files, and S or Enter to choose the selected file or enter the selected directory. To move up one level, select the directory called \"..\" at the top of the file list.\n"
|
||||
"\n"
|
||||
" The following function keys are available in the file browser:\n"
|
||||
"\n"
|
||||
msgstr ""
|
||||
"Text d'ajuda del Navegador de fitxers\n"
|
||||
"\n"
|
||||
" El navegador de fitxers s'utilitza per a navegar visualment la estructura "
|
||||
"del directori per a seleccionar un fitxer per a lectura o escriptura. Podeu "
|
||||
"fer servir els cursors o Re/Av Pag per a navegar per els fitxers i S o Intro "
|
||||
"per a triar el fitxer seleccionat o entrar dins del directori seleccionat. "
|
||||
"Per a pujar un nivel, seleccioneu el directori «..» en la part superior de "
|
||||
"la llista de fitxers.\n"
|
||||
" El navegador de fitxers s'utilitza per a navegar visualment la estructura del directori per a seleccionar un fitxer per a lectura o escriptura. Podeu fer servir els cursors o Re/Av Pag per a navegar per els fitxers i S o Intro per a triar el fitxer seleccionat o entrar dins del directori seleccionat. Per a pujar un nivel, seleccioneu el directori «..» en la part superior de la llista de fitxers.\n"
|
||||
"\n"
|
||||
" Les següents tecles de funció estan disponibles en el navegador de "
|
||||
"fitxers:\n"
|
||||
" Les següents tecles de funció estan disponibles en el navegador de fitxers:\n"
|
||||
"\n"
|
||||
|
||||
#: nano.c:332
|
||||
@@ -878,8 +831,7 @@ msgid ""
|
||||
"\n"
|
||||
" Enter the name of the directory you would like to browse to.\n"
|
||||
"\n"
|
||||
" If tab completion has not been disabled, you can use the TAB key to "
|
||||
"(attempt to) automatically complete the directory name.\n"
|
||||
" If tab completion has not been disabled, you can use the TAB key to (attempt to) automatically complete the directory name.\n"
|
||||
"\n"
|
||||
" The following function keys are available in Browser Go To Directory mode:\n"
|
||||
"\n"
|
||||
@@ -888,50 +840,39 @@ msgstr ""
|
||||
"\n"
|
||||
" Introduïu el nom del directori per el que voleu navegar.\n"
|
||||
"\n"
|
||||
" Si el completat amb el tabulador no està desactivat, podeu fer servir la "
|
||||
"tecla TAB per a (intentar) completar automàticament el nom del directori.\n"
|
||||
" Si el completat amb el tabulador no està desactivat, podeu fer servir la tecla TAB per a (intentar) completar automàticament el nom del directori.\n"
|
||||
"\n"
|
||||
" Les següents tecles de funció estan disponibles en el mode del navegador "
|
||||
"Anar a directori:\n"
|
||||
" Les següents tecles de funció estan disponibles en el mode del navegador Anar a directori:\n"
|
||||
"\n"
|
||||
|
||||
#: nano.c:341
|
||||
msgid ""
|
||||
"Spell Check Help Text\n"
|
||||
"\n"
|
||||
" The spell checker checks the spelling of all text in the current file. "
|
||||
"When an unknown word is encountered, it is highlighted and a replacement can "
|
||||
"be edited. It will then prompt to replace every instance of the given "
|
||||
"misspelled word in the current file.\n"
|
||||
" The spell checker checks the spelling of all text in the current file. When an unknown word is encountered, it is highlighted and a replacement can be edited. It will then prompt to replace every instance of the given misspelled word in the current file.\n"
|
||||
"\n"
|
||||
" The following other functions are available in Spell Check mode:\n"
|
||||
"\n"
|
||||
msgstr ""
|
||||
"Text d'ajuda del Corrector d'Ortografia\n"
|
||||
"\n"
|
||||
" El Corrector d'ortografia comprova la ortografia de tot el texte en el "
|
||||
"fitxer actual. Quan es troba una paraula desconeguda, aquesta es marca i es "
|
||||
"pot editar una substitució. Després preguntarà si es vol reemplaçar totes "
|
||||
"les coincidències d'eixa paraula mal escrita el el fitxer actual.\n"
|
||||
" El Corrector d'ortografia comprova la ortografia de tot el texte en el fitxer actual. Quan es troba una paraula desconeguda, aquesta es marca i es pot editar una substitució. Després preguntarà si es vol reemplaçar totes les coincidències d'eixa paraula mal escrita el el fitxer actual.\n"
|
||||
"\n"
|
||||
" Les següents tecles de funció estan disponibles en el mode Corrector "
|
||||
"d'Ortografia:\n"
|
||||
" Les següents tecles de funció estan disponibles en el mode Corrector d'Ortografia:\n"
|
||||
"\n"
|
||||
|
||||
#: nano.c:352
|
||||
msgid ""
|
||||
"External Command Help Text\n"
|
||||
"\n"
|
||||
" This menu allows you to insert the output of a command run by the shell "
|
||||
"into the current buffer (or a new buffer in multibuffer mode).\n"
|
||||
" This menu allows you to insert the output of a command run by the shell into the current buffer (or a new buffer in multibuffer mode).\n"
|
||||
"\n"
|
||||
" The following keys are available in this mode:\n"
|
||||
"\n"
|
||||
msgstr ""
|
||||
"Text d'ajuda de l'Ordre Externa\n"
|
||||
"\n"
|
||||
" Aquest menú vos permet inserir l'eixida d'una ordre executada per "
|
||||
"l'intèrpret en el búfer actual (o un nou búfer en el mode multibuffer).\n"
|
||||
" Aquest menú vos permet inserir l'eixida d'una ordre executada per l'intèrpret en el búfer actual (o un nou búfer en el mode multibuffer).\n"
|
||||
"\n"
|
||||
" Les següents tecles de funció estan disponibles en el mode Ordre Externa:\n"
|
||||
|
||||
@@ -939,39 +880,16 @@ msgstr ""
|
||||
msgid ""
|
||||
" nano help text\n"
|
||||
"\n"
|
||||
" The nano editor is designed to emulate the functionality and ease-of-use of "
|
||||
"the UW Pico text editor. There are four main sections of the editor: The "
|
||||
"top line shows the program version, the current filename being edited, and "
|
||||
"whether or not the file has been modified. Next is the main editor window "
|
||||
"showing the file being edited. The status line is the third line from the "
|
||||
"bottom and shows important messages. The bottom two lines show the most "
|
||||
"commonly used shortcuts in the editor.\n"
|
||||
" The nano editor is designed to emulate the functionality and ease-of-use of the UW Pico text editor. There are four main sections of the editor: The top line shows the program version, the current filename being edited, and whether or not the file has been modified. Next is the main editor window showing the file being edited. The status line is the third line from the 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 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. Alternative "
|
||||
"keys are shown in parentheses:\n"
|
||||
" The notation for shortcuts is as follows: Control-key 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. Alternative keys are shown in parentheses:\n"
|
||||
"\n"
|
||||
msgstr ""
|
||||
" texte d'ajuda de nano\n"
|
||||
"\n"
|
||||
" L'editor nano està dissenyat per a emular la funcionalitat i la facilitat "
|
||||
"d'ús de Pico, l'editor de text de la UW. Hi ha quatre seccions a l'editor: "
|
||||
"la línia superior mostra la versió del programa, el nom del fitxer editat i "
|
||||
"si el fitxer ha estat o no modificat. També tenim la finestra principal de "
|
||||
"edició, que mostra el fitxer que s'està editant. La línia d'estat és la "
|
||||
"tercera des de baix i mostra missatges importants. Les últimes dues línies "
|
||||
"mostren les dreceres més utilitzades a l'editor.\n"
|
||||
" L'editor nano està dissenyat per a emular la funcionalitat i la facilitat d'ús de Pico, l'editor de text de la UW. Hi ha quatre seccions a l'editor: la línia superior mostra la versió del programa, el nom del fitxer editat i si el fitxer ha estat o no modificat. També tenim la finestra principal de edició, que mostra el fitxer que s'està editant. La línia d'estat és la tercera des de baix i mostra missatges importants. Les últimes dues línies mostren les dreceres més utilitzades a l'editor.\n"
|
||||
"\n"
|
||||
" La notació de les dreceres és la següent: les sequències amb la tecla "
|
||||
"Control estan anotades amb el símbol circunflex (^) i són accedides "
|
||||
"mitjançant la tecla Control. Les seqüències amb tecles d'escapada estan "
|
||||
"anotades amb el símbol Meta (M) i s'hi pot accedir mitjançant les tecles "
|
||||
"Esc, Alt o Meta, tot depenent de la configuració del teu teclat. Les "
|
||||
"següents combinacions estan disponibles a la finestra principal. Les tecles "
|
||||
"alternatives estan representades entre parèntesi:\n"
|
||||
" La notació de les dreceres és la següent: les sequències amb la tecla Control estan anotades amb el símbol circunflex (^) i són accedides mitjançant la tecla Control. Les seqüències amb tecles d'escapada estan anotades amb el símbol Meta (M) i s'hi pot accedir mitjançant les tecles Esc, Alt o Meta, tot depenent de la configuració del teu teclat. Les següents combinacions estan disponibles a la finestra principal. Les tecles alternatives estan representades entre parèntesi:\n"
|
||||
"\n"
|
||||
|
||||
#: nano.c:388 nano.c:458
|
||||
@@ -1313,8 +1231,7 @@ msgstr "No es pot moure la finestra inferior"
|
||||
|
||||
#: nano.c:2919
|
||||
msgid "NumLock glitch detected. Keypad will malfunction with NumLock off"
|
||||
msgstr ""
|
||||
"Detectat NumLock trencat. El tecl. numèric funcionarà amb NumLock activat"
|
||||
msgstr "Detectat NumLock trencat. El tecl. numèric funcionarà amb NumLock activat"
|
||||
|
||||
#: nano.c:2968
|
||||
msgid "enabled"
|
||||
@@ -1731,21 +1648,6 @@ msgstr "Gr
|
||||
#~ msgid "Can't visit parent in restricted mode"
|
||||
#~ msgstr "No es pot visitar el directori pare en mode restringit"
|
||||
|
||||
#~ msgid "string val=%s\n"
|
||||
#~ msgstr "cadena val=%s\n"
|
||||
|
||||
#~ msgid "For end part, beginning = \"%s\"\n"
|
||||
#~ msgstr "Per a la part final, beginning = «%s»\n"
|
||||
|
||||
#~ msgid "current->data = \"%s\"\n"
|
||||
#~ msgstr "current->data = \"%s\"\n"
|
||||
|
||||
#~ msgid "do_cursorpos: linepct = %f, bytepct = %f\n"
|
||||
#~ msgstr "do_cursorpos: linepct = %f, bytepct = %f\n"
|
||||
|
||||
#~ msgid "read_line: not on first line and prev is NULL"
|
||||
#~ msgstr "read_line: no som a la primera línia i la anterior és NULL"
|
||||
|
||||
#~ msgid "Pico mode"
|
||||
#~ msgstr "Mode Pico"
|
||||
|
||||
|
||||
4
src/.cvsignore
Normal file
4
src/.cvsignore
Normal file
@@ -0,0 +1,4 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
nano
|
||||
.deps
|
||||
22
src/Makefile.am
Normal file
22
src/Makefile.am
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
DEFS= -DSYSCONFDIR=\"$(sysconfdir)\"
|
||||
localedir = $(datadir)/locale
|
||||
INCLUDES = -Iintl -DLOCALEDIR=\"$(localedir)\" -I@includedir@
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
bin_PROGRAMS = nano
|
||||
nano_SOURCES = color.c \
|
||||
cut.c \
|
||||
files.c \
|
||||
global.c \
|
||||
move.c \
|
||||
nano.c \
|
||||
nano.h \
|
||||
proto.h \
|
||||
rcfile.c \
|
||||
search.c \
|
||||
utils.c \
|
||||
winio.c
|
||||
|
||||
nano_LDADD = @GLIB_LIBS@ @LIBINTL@
|
||||
@@ -117,7 +117,7 @@ void cut_marked_segment(filestruct *top, size_t top_x, filestruct *bot,
|
||||
/* Make the first cut line manually. */
|
||||
tmp = copy_node(top);
|
||||
newsize = (top == bot ? bot_x - top_x : strlen(top->data + top_x));
|
||||
memmove(tmp->data, top->data + top_x, newsize);
|
||||
charmove(tmp->data, top->data + top_x, newsize);
|
||||
null_at(&tmp->data, newsize);
|
||||
add_to_cutbuffer(tmp);
|
||||
|
||||
@@ -131,7 +131,7 @@ void cut_marked_segment(filestruct *top, size_t top_x, filestruct *bot,
|
||||
if (top == bot) {
|
||||
/* In this case, the remainder line is shorter, so we must
|
||||
move text from the end forward first. */
|
||||
memmove(top->data + top_x, bot->data + bot_x,
|
||||
charmove(top->data + top_x, bot->data + bot_x,
|
||||
newsize - top_x);
|
||||
top->data = charealloc(top->data, newsize);
|
||||
} else {
|
||||
@@ -140,7 +140,7 @@ void cut_marked_segment(filestruct *top, size_t top_x, filestruct *bot,
|
||||
/* Here, the remainder line might get longer, so we
|
||||
realloc() it first. */
|
||||
top->data = charealloc(top->data, newsize);
|
||||
memmove(top->data + top_x, bot->data + bot_x,
|
||||
charmove(top->data + top_x, bot->data + bot_x,
|
||||
newsize - top_x);
|
||||
}
|
||||
}
|
||||
@@ -322,7 +322,9 @@ int do_uncut_text(void)
|
||||
filestruct *hold = current;
|
||||
int i;
|
||||
|
||||
#ifndef DISABLE_WRAPPING
|
||||
wrap_reset();
|
||||
#endif
|
||||
check_statblank();
|
||||
if (cutbuffer == NULL || fileptr == NULL)
|
||||
return 0; /* AIEEEEEEEEEEEE */
|
||||
@@ -362,7 +364,7 @@ int do_uncut_text(void)
|
||||
size_t cur_len = strlen(current->data);
|
||||
|
||||
current->data = charealloc(current->data, cur_len + buf_len + 1);
|
||||
memmove(current->data + current_x + buf_len,
|
||||
charmove(current->data + current_x + buf_len,
|
||||
current->data + current_x, cur_len - current_x + 1);
|
||||
strncpy(current->data + current_x, cutbuffer->data, buf_len);
|
||||
/* Use strncpy() to not copy the terminal '\0'. */
|
||||
@@ -326,6 +326,12 @@ int read_file(FILE *f, const char *filename, int quiet)
|
||||
statusbar(P_("Read %d line", "Read %d lines", num_lines),
|
||||
num_lines);
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* Set fileformat back to 0, now that we've read the file in and
|
||||
possibly converted it from DOS/Mac format. */
|
||||
fileformat = 0;
|
||||
#endif
|
||||
|
||||
totlines += num_lines;
|
||||
|
||||
return 1;
|
||||
@@ -427,13 +433,15 @@ int do_insertfile(int loading_file)
|
||||
inspath[0] = '\0';
|
||||
}
|
||||
|
||||
#ifndef DISABLE_WRAPPING
|
||||
wrap_reset();
|
||||
#endif
|
||||
|
||||
#if !defined(DISABLE_BROWSER) || !defined(NANO_SMALL) && defined(ENABLE_MULTIBUFFER)
|
||||
start_again: /* Goto here when the user cancels the file browser. */
|
||||
#endif
|
||||
|
||||
#if !defined(DISABLE_BROWSER) || (!defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION))
|
||||
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_MOUSE)
|
||||
currshortcut = insertfile_list;
|
||||
#endif
|
||||
|
||||
@@ -1702,7 +1710,7 @@ int do_writeout(const char *path, int exiting, int append)
|
||||
static int did_cred = 0;
|
||||
#endif
|
||||
|
||||
#if !defined(DISABLE_BROWSER) || (!defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION))
|
||||
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_MOUSE)
|
||||
currshortcut = writefile_list;
|
||||
#endif
|
||||
|
||||
@@ -1823,7 +1831,7 @@ int do_writeout(const char *path, int exiting, int append)
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
if (append == 0 && strcmp(answer, filename) != 0) {
|
||||
if (append == 0 && strcmp(answer, filename)) {
|
||||
struct stat st;
|
||||
|
||||
if (!stat(answer, &st)) {
|
||||
@@ -2269,7 +2277,6 @@ char *input_tab(char *buf, int place, int *lastwastab, int *newplace, int *list)
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
/* Ok -- the last char was a TAB. Since they
|
||||
@@ -2477,11 +2484,11 @@ char *do_browser(const char *inpath)
|
||||
struct stat st;
|
||||
char *foo, *retval = NULL;
|
||||
static char *path = NULL;
|
||||
int numents = 0, i = 0, j = 0, kbinput = 0, longest = 0, abort = 0;
|
||||
int col = 0, selected = 0, editline = 0, width = 0, filecols = 0;
|
||||
int lineno = 0, kb;
|
||||
int numents = 0, i = 0, j = 0, kbinput = -1, meta, longest = 0;
|
||||
int abort = 0, col = 0, selected = 0, editline = 0, width = 0;
|
||||
int filecols = 0, lineno = 0;
|
||||
char **filelist = (char **)NULL;
|
||||
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
|
||||
#ifndef DISABLE_MOUSE
|
||||
MEVENT mevent;
|
||||
#endif
|
||||
|
||||
@@ -2505,7 +2512,6 @@ char *do_browser(const char *inpath)
|
||||
/* Sort the list by directory first, then alphabetically */
|
||||
qsort(filelist, numents, sizeof(char *), diralphasort);
|
||||
|
||||
kb = keypad_on(edit, 1);
|
||||
titlebar(path);
|
||||
bottombars(browser_list);
|
||||
curs_set(0);
|
||||
@@ -2521,7 +2527,7 @@ char *do_browser(const char *inpath)
|
||||
|
||||
blank_statusbar_refresh();
|
||||
|
||||
#if !defined(DISABLE_HELP) || (!defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION))
|
||||
#if !defined(DISABLE_HELP) || !defined(DISABLE_MOUSE)
|
||||
currshortcut = browser_list;
|
||||
#endif
|
||||
|
||||
@@ -2535,7 +2541,7 @@ char *do_browser(const char *inpath)
|
||||
|
||||
switch (kbinput) {
|
||||
|
||||
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
|
||||
#ifndef DISABLE_MOUSE
|
||||
case KEY_MOUSE:
|
||||
if (getmouse(&mevent) == ERR)
|
||||
return retval;
|
||||
@@ -2569,34 +2575,23 @@ char *do_browser(const char *inpath)
|
||||
break;
|
||||
#endif
|
||||
case NANO_UP_KEY:
|
||||
case KEY_UP:
|
||||
case 'u':
|
||||
if (selected - width >= 0)
|
||||
selected -= width;
|
||||
break;
|
||||
case NANO_BACK_KEY:
|
||||
case KEY_LEFT:
|
||||
case NANO_BACKSPACE_KEY:
|
||||
case 127:
|
||||
case 'l':
|
||||
if (selected > 0)
|
||||
selected--;
|
||||
break;
|
||||
case KEY_DOWN:
|
||||
case NANO_DOWN_KEY:
|
||||
case 'd':
|
||||
if (selected + width <= numents - 1)
|
||||
selected += width;
|
||||
break;
|
||||
case KEY_RIGHT:
|
||||
case NANO_FORWARD_KEY:
|
||||
case 'r':
|
||||
if (selected < numents - 1)
|
||||
selected++;
|
||||
break;
|
||||
case NANO_PREVPAGE_KEY:
|
||||
case NANO_PREVPAGE_FKEY:
|
||||
case KEY_PPAGE:
|
||||
case '-':
|
||||
if (selected >= (editwinrows + lineno % editwinrows) * width)
|
||||
selected -= (editwinrows + lineno % editwinrows) * width;
|
||||
@@ -2605,7 +2600,6 @@ char *do_browser(const char *inpath)
|
||||
break;
|
||||
case NANO_NEXTPAGE_KEY:
|
||||
case NANO_NEXTPAGE_FKEY:
|
||||
case KEY_NPAGE:
|
||||
case ' ':
|
||||
selected += (editwinrows - lineno % editwinrows) * width;
|
||||
if (selected >= numents)
|
||||
@@ -2615,7 +2609,6 @@ char *do_browser(const char *inpath)
|
||||
case NANO_HELP_FKEY:
|
||||
do_help();
|
||||
break;
|
||||
case KEY_ENTER:
|
||||
case NANO_ENTER_KEY:
|
||||
case 's': /* More Pico compatibility */
|
||||
case 'S':
|
||||
@@ -2678,10 +2671,8 @@ char *do_browser(const char *inpath)
|
||||
return do_browser(path);
|
||||
|
||||
/* Goto a specific directory */
|
||||
case 'g': /* Pico compatibility */
|
||||
case 'G':
|
||||
case NANO_GOTO_KEY:
|
||||
|
||||
case NANO_GOTO_FKEY:
|
||||
curs_set(1);
|
||||
j = statusq(0, gotodir_list, "",
|
||||
#ifndef NANO_SMALL
|
||||
@@ -2726,11 +2717,10 @@ char *do_browser(const char *inpath)
|
||||
return do_browser(path);
|
||||
|
||||
/* Stuff we want to abort the browser */
|
||||
case 'q':
|
||||
case 'Q':
|
||||
case 'e': /* Pico compatibility, yeech */
|
||||
case 'E':
|
||||
case NANO_CANCEL_KEY:
|
||||
case NANO_EXIT_KEY:
|
||||
case NANO_EXIT_FKEY:
|
||||
abort = 1;
|
||||
break;
|
||||
@@ -2806,12 +2796,11 @@ char *do_browser(const char *inpath)
|
||||
}
|
||||
}
|
||||
wrefresh(edit);
|
||||
} while ((kbinput = wgetch(edit)) != NANO_EXIT_KEY);
|
||||
} while ((kbinput = get_kbinput(edit, &meta, ISSET(REBIND_DELETE))) != NANO_EXIT_KEY && kbinput != NANO_EXIT_FKEY);
|
||||
curs_set(1);
|
||||
blank_edit();
|
||||
titlebar(NULL);
|
||||
edit_refresh();
|
||||
kb = keypad_on(edit, kb);
|
||||
|
||||
/* cleanup */
|
||||
free_charptrarray(filelist, numents);
|
||||
@@ -2889,7 +2878,7 @@ void load_history(void)
|
||||
|
||||
if (homenv != NULL || userage != NULL) {
|
||||
hist = fopen(nanohist, "r");
|
||||
if (!hist) {
|
||||
if (hist == NULL) {
|
||||
if (errno != ENOENT) {
|
||||
/* Don't save history when we quit. */
|
||||
UNSET(HISTORYLOG);
|
||||
@@ -2942,7 +2931,7 @@ void save_history(void)
|
||||
|
||||
if (homenv != NULL || userage != NULL) {
|
||||
hist = fopen(nanohist, "wb");
|
||||
if (!hist) {
|
||||
if (hist == NULL) {
|
||||
rcfile_msg(_("Unable to write ~/.nano_history file, %s"), strerror(errno));
|
||||
} else {
|
||||
/* set rw only by owner for security ?? */
|
||||
@@ -2968,7 +2957,7 @@ void save_history(void)
|
||||
goto come_from;
|
||||
}
|
||||
}
|
||||
come_from:
|
||||
come_from:
|
||||
fclose(hist);
|
||||
}
|
||||
free(nanohist);
|
||||
@@ -29,8 +29,11 @@
|
||||
|
||||
/* Global variables */
|
||||
|
||||
#ifndef DISABLE_WRAPJUSTIFY
|
||||
/* wrap_at might be set in rcfile.c or nano.c */
|
||||
int wrap_at = -CHARS_FROM_EOL;/* Right justified fill value, allows resize */
|
||||
#endif
|
||||
|
||||
char *last_search = NULL; /* Last string we searched for */
|
||||
char *last_replace = NULL; /* Last replacement string */
|
||||
int search_last_line; /* Is this the last search line? */
|
||||
@@ -129,7 +132,7 @@ syntaxtype *syntaxes = NULL;
|
||||
char *syntaxstr = NULL;
|
||||
#endif
|
||||
|
||||
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_HELP) || (!defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION))
|
||||
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_HELP) || !defined(DISABLE_MOUSE)
|
||||
const shortcut *currshortcut; /* Current shortcut list we're using */
|
||||
#endif
|
||||
|
||||
@@ -225,7 +228,7 @@ void toggle_init(void)
|
||||
*toggle_nohelp_msg, *toggle_cuttoend_msg,
|
||||
*toggle_noconvert_msg, *toggle_dos_msg, *toggle_mac_msg,
|
||||
*toggle_backup_msg, *toggle_smooth_msg;
|
||||
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
|
||||
#ifndef DISABLE_MOUSE
|
||||
char *toggle_mouse_msg;
|
||||
#endif
|
||||
#ifndef DISABLE_WRAPPING
|
||||
@@ -247,7 +250,7 @@ void toggle_init(void)
|
||||
toggle_autoindent_msg = _("Auto indent");
|
||||
toggle_suspend_msg = _("Suspend");
|
||||
toggle_nohelp_msg = _("Help mode");
|
||||
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
|
||||
#ifndef DISABLE_MOUSE
|
||||
toggle_mouse_msg = _("Mouse support");
|
||||
#endif
|
||||
toggle_cuttoend_msg = _("Cut to end");
|
||||
@@ -260,7 +263,7 @@ void toggle_init(void)
|
||||
toggle_syntax_msg = _("Color syntax highlighting");
|
||||
#endif
|
||||
#ifndef DISABLE_WRAPPING
|
||||
toggle_wrap_msg = _("Auto wrap");
|
||||
toggle_wrap_msg = _("Auto line wrap");
|
||||
#endif
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
toggle_load_msg = _("Multiple file buffers");
|
||||
@@ -273,7 +276,7 @@ void toggle_init(void)
|
||||
#ifndef DISABLE_WRAPPING
|
||||
toggle_init_one(TOGGLE_WRAP_KEY, toggle_wrap_msg, NO_WRAP);
|
||||
#endif
|
||||
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
|
||||
#ifndef DISABLE_MOUSE
|
||||
toggle_init_one(TOGGLE_MOUSE_KEY, toggle_mouse_msg, USE_MOUSE);
|
||||
#endif
|
||||
toggle_init_one(TOGGLE_CUTTOEND_KEY, toggle_cuttoend_msg, CUT_TO_END);
|
||||
@@ -321,10 +324,11 @@ void shortcut_init(int unjustify)
|
||||
const char *nano_help_msg = "", *nano_writeout_msg = "", *nano_exit_msg =
|
||||
"", *nano_goto_msg = "", *nano_justify_msg =
|
||||
"", *nano_replace_msg = "", *nano_insert_msg =
|
||||
"", *nano_whereis_msg = "", *nano_prevpage_msg =
|
||||
"", *nano_nextpage_msg = "", *nano_cut_msg =
|
||||
"", *nano_uncut_msg = "", *nano_cursorpos_msg =
|
||||
"", *nano_spell_msg = "", *nano_up_msg = "", *nano_down_msg =
|
||||
"", *nano_whereis_msg = "", *nano_whereis_next_msg =
|
||||
"", *nano_prevpage_msg = "", *nano_nextpage_msg =
|
||||
"", *nano_cut_msg = "", *nano_uncut_msg =
|
||||
"", *nano_cursorpos_msg = "", *nano_spell_msg =
|
||||
"", *nano_up_msg = "", *nano_down_msg =
|
||||
"", *nano_forward_msg = "", *nano_back_msg = "", *nano_home_msg =
|
||||
"", *nano_end_msg = "", *nano_firstline_msg =
|
||||
"", *nano_lastline_msg = "", *nano_refresh_msg =
|
||||
@@ -336,7 +340,8 @@ void shortcut_init(int unjustify)
|
||||
"", *nano_gotodir_msg = "", *nano_case_msg =
|
||||
"", *nano_reverse_msg = "", *nano_execute_msg =
|
||||
"", *nano_dos_msg = "", *nano_mac_msg =
|
||||
"", *nano_backup_msg = "", *nano_editstr_msg = "";
|
||||
"", *nano_backup_msg = "", *nano_editstr_msg =
|
||||
"", *nano_parabegin_msg = "", *nano_paraend_msg = "";
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
const char *nano_openprev_msg = "", *nano_opennext_msg =
|
||||
@@ -349,7 +354,7 @@ void shortcut_init(int unjustify)
|
||||
nano_help_msg = _("Invoke the help menu");
|
||||
nano_writeout_msg = _("Write the current file to disk");
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
nano_exit_msg = _("Close currently loaded file/Exit from nano");
|
||||
nano_exit_msg = _("Close current file buffer/Exit from nano");
|
||||
#else
|
||||
nano_exit_msg = _("Exit from nano");
|
||||
#endif
|
||||
@@ -359,6 +364,7 @@ void shortcut_init(int unjustify)
|
||||
nano_replace_msg = _("Replace text within the editor");
|
||||
nano_insert_msg = _("Insert another file into the current one");
|
||||
nano_whereis_msg = _("Search for text within the editor");
|
||||
nano_whereis_next_msg = _("Repeat last search");
|
||||
nano_prevpage_msg = _("Move to the previous screen");
|
||||
nano_nextpage_msg = _("Move to the next screen");
|
||||
nano_cut_msg = _("Cut the current line and store it in the cutbuffer");
|
||||
@@ -393,14 +399,16 @@ void shortcut_init(int unjustify)
|
||||
nano_mac_msg = _("Write file out in Mac format");
|
||||
nano_backup_msg = _("Back up original file when saving");
|
||||
nano_editstr_msg = _("Edit the previous search/replace strings");
|
||||
nano_parabegin_msg = _("Go to the beginning of the current paragraph");
|
||||
nano_paraend_msg = _("Go to the end of the current paragraph");
|
||||
#ifdef HAVE_REGEX_H
|
||||
nano_regexp_msg = _("Use regular expressions");
|
||||
nano_bracket_msg = _("Find other bracket");
|
||||
#endif
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
nano_openprev_msg = _("Open previously loaded file");
|
||||
nano_opennext_msg = _("Open next loaded file");
|
||||
nano_multibuffer_msg = _("Toggle insert into new buffer");
|
||||
nano_openprev_msg = _("Switch to previous file buffer");
|
||||
nano_opennext_msg = _("Switch to next file buffer");
|
||||
nano_multibuffer_msg = _("Toggle insert into new file buffer");
|
||||
#endif
|
||||
#endif /* !DISABLE_HELP */
|
||||
|
||||
@@ -564,6 +572,11 @@ void shortcut_init(int unjustify)
|
||||
IFHELP(nano_bracket_msg, NANO_BRACKET_KEY),
|
||||
0, 0, VIEW, do_find_bracket);
|
||||
#endif
|
||||
|
||||
sc_init_one(&main_list, -9, _("Where Is Next"),
|
||||
IFHELP(nano_whereis_next_msg, NANO_WHEREIS_NEXT_KEY), 0, 0,
|
||||
NOVIEW, do_research);
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
sc_init_one(&main_list, -9, _("Previous File"),
|
||||
IFHELP(nano_openprev_msg, NANO_OPENPREV_KEY),
|
||||
@@ -578,44 +591,54 @@ void shortcut_init(int unjustify)
|
||||
sc_init_one(&whereis_list, NANO_HELP_KEY, _("Get Help"),
|
||||
IFHELP(nano_help_msg, 0), 0, 0, VIEW, do_help);
|
||||
|
||||
/* Translators: try to keep this string under 12 characters long */
|
||||
/* Translators: try to keep this string under 10 characters long */
|
||||
sc_init_one(&whereis_list, NANO_CANCEL_KEY, _("Cancel"),
|
||||
IFHELP(nano_cancel_msg, 0), 0, 0, VIEW, 0);
|
||||
|
||||
/* Translators: try to keep this string under 12 characters long */
|
||||
/* Translators: try to keep this string under 10 characters long */
|
||||
sc_init_one(&whereis_list, NANO_FIRSTLINE_KEY, _("First Line"),
|
||||
IFHELP(nano_firstline_msg, 0),
|
||||
0, 0, VIEW, do_first_line);
|
||||
|
||||
/* Translators: try to keep this string under 12 characters long */
|
||||
/* Translators: try to keep this string under 10 characters long */
|
||||
sc_init_one(&whereis_list, NANO_LASTLINE_KEY, _("Last Line"),
|
||||
IFHELP(nano_lastline_msg, 0), 0, 0, VIEW, do_last_line);
|
||||
|
||||
/* Translators: try to keep this string under 12 characters long */
|
||||
/* Translators: try to keep this string under 10 characters long */
|
||||
sc_init_one(&whereis_list, NANO_OTHERSEARCH_KEY, _("Replace"),
|
||||
IFHELP(nano_replace_msg, 0), 0, 0, VIEW, do_replace);
|
||||
|
||||
/* Translators: try to keep this string under 12 characters long */
|
||||
/* Translators: try to keep this string under 10 characters long */
|
||||
sc_init_one(&whereis_list, NANO_FROMSEARCHTOGOTO_KEY, _("Go To Line"),
|
||||
IFHELP(nano_goto_msg, 0), 0, 0, VIEW, do_gotoline_void);
|
||||
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
/* Translators: try to keep this string under 10 characters long */
|
||||
sc_init_one(&whereis_list, NANO_PARABEGIN_KEY, _("Beg of Par"),
|
||||
IFHELP(nano_parabegin_msg, 0), 0, 0, VIEW, do_para_begin);
|
||||
|
||||
/* Translators: try to keep this string under 10 characters long */
|
||||
sc_init_one(&whereis_list, NANO_PARAEND_KEY, _("End of Par"),
|
||||
IFHELP(nano_paraend_msg, 0), 0, 0, VIEW, do_para_end);
|
||||
#endif
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* Translators: try to keep this string under 12 characters long */
|
||||
/* Translators: try to keep this string under 10 characters long */
|
||||
sc_init_one(&whereis_list, TOGGLE_CASE_KEY, _("Case Sens"),
|
||||
IFHELP(nano_case_msg, 0), 0, 0, VIEW, 0);
|
||||
|
||||
/* Translators: try to keep this string under 12 characters long */
|
||||
/* Translators: try to keep this string under 10 characters long */
|
||||
sc_init_one(&whereis_list, TOGGLE_BACKWARDS_KEY, _("Direction"),
|
||||
IFHELP(nano_reverse_msg, 0), 0, 0, VIEW, 0);
|
||||
|
||||
#ifdef HAVE_REGEX_H
|
||||
/* Translators: try to keep this string under 12 characters long */
|
||||
/* Translators: try to keep this string under 10 characters long */
|
||||
sc_init_one(&whereis_list, TOGGLE_REGEXP_KEY, _("Regexp"),
|
||||
IFHELP(nano_regexp_msg, 0), 0, 0, VIEW, 0);
|
||||
#endif
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* Translators: try to keep this string under 12 characters long */
|
||||
/* Translators: try to keep this string under 10 characters long */
|
||||
sc_init_one(&whereis_list, KEY_UP, _("History"),
|
||||
IFHELP(nano_editstr_msg, 0), NANO_UP_KEY, 0, VIEW, 0);
|
||||
#endif
|
||||
@@ -820,7 +843,7 @@ void shortcut_init(int unjustify)
|
||||
IFHELP(nano_cancel_msg, 0), 0, 0, VIEW, 0);
|
||||
#endif
|
||||
|
||||
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_HELP) || (!defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION))
|
||||
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_HELP) || !defined(DISABLE_MOUSE)
|
||||
currshortcut = main_list;
|
||||
#endif
|
||||
#ifndef NANO_SMALL
|
||||
225
src/move.c
Normal file
225
src/move.c
Normal file
@@ -0,0 +1,225 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* move.c *
|
||||
* *
|
||||
* Copyright (C) 1999-2003 Chris Allegretta *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2, or (at your option) *
|
||||
* any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include "proto.h"
|
||||
#include "nano.h"
|
||||
|
||||
int do_home(void)
|
||||
{
|
||||
current_x = 0;
|
||||
placewewant = 0;
|
||||
check_statblank();
|
||||
update_line(current, current_x);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int do_end(void)
|
||||
{
|
||||
current_x = strlen(current->data);
|
||||
placewewant = xplustabs();
|
||||
check_statblank();
|
||||
update_line(current, current_x);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int do_page_up(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
#ifndef DISABLE_WRAPPING
|
||||
wrap_reset();
|
||||
#endif
|
||||
|
||||
/* If edittop is the first line of the file, move current up there
|
||||
* and put the cursor at the beginning of the line. */
|
||||
if (edittop == fileage) {
|
||||
current = fileage;
|
||||
placewewant = 0;
|
||||
} else {
|
||||
/* Move the top line of the edit window up a page. */
|
||||
for (i = 0; i < editwinrows - 2 && edittop->prev != NULL; i++)
|
||||
edittop = edittop->prev;
|
||||
#ifndef NANO_SMALL
|
||||
/* If we're in smooth scrolling mode and there was at least one
|
||||
* page of text left, move the current line of the edit window
|
||||
* up a page. */
|
||||
if (ISSET(SMOOTHSCROLL) && current->lineno > editwinrows - 2)
|
||||
for (i = 0; i < editwinrows - 2; i++)
|
||||
current = current->prev;
|
||||
/* If we're not in smooth scrolling mode and there was at least
|
||||
* one page of text left, put the cursor at the beginning of the
|
||||
* top line of the edit window, as Pico does. */
|
||||
else {
|
||||
#endif
|
||||
current = edittop;
|
||||
placewewant = 0;
|
||||
#ifndef NANO_SMALL
|
||||
}
|
||||
#endif
|
||||
}
|
||||
/* Get the equivalent x-coordinate of the new line. */
|
||||
current_x = actual_x(current->data, placewewant);
|
||||
|
||||
edit_refresh();
|
||||
|
||||
check_statblank();
|
||||
return 1;
|
||||
}
|
||||
|
||||
int do_page_down(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
#ifndef DISABLE_WRAPPING
|
||||
wrap_reset();
|
||||
#endif
|
||||
|
||||
/* If the last line of the file is onscreen, move current down
|
||||
* there and put the cursor at the beginning of the line. */
|
||||
if (edittop->lineno + editwinrows > filebot->lineno) {
|
||||
current = filebot;
|
||||
placewewant = 0;
|
||||
} else {
|
||||
/* Move the top line of the edit window down a page. */
|
||||
for (i = 0; i < editwinrows - 2; i++)
|
||||
edittop = edittop->next;
|
||||
#ifndef NANO_SMALL
|
||||
/* If we're in smooth scrolling mode and there was at least one
|
||||
* page of text left, move the current line of the edit window
|
||||
* down a page. */
|
||||
if (ISSET(SMOOTHSCROLL) && current->lineno + editwinrows - 2 <= filebot->lineno)
|
||||
for (i = 0; i < editwinrows - 2; i++)
|
||||
current = current->next;
|
||||
/* If we're not in smooth scrolling mode and there was at least
|
||||
* one page of text left, put the cursor at the beginning of the
|
||||
* top line of the edit window, as Pico does. */
|
||||
else {
|
||||
#endif
|
||||
current = edittop;
|
||||
placewewant = 0;
|
||||
#ifndef NANO_SMALL
|
||||
}
|
||||
#endif
|
||||
}
|
||||
/* Get the equivalent x-coordinate of the new line. */
|
||||
current_x = actual_x(current->data, placewewant);
|
||||
|
||||
edit_refresh();
|
||||
|
||||
check_statblank();
|
||||
return 1;
|
||||
}
|
||||
|
||||
int do_up(void)
|
||||
{
|
||||
#ifndef DISABLE_WRAPPING
|
||||
wrap_reset();
|
||||
#endif
|
||||
check_statblank();
|
||||
|
||||
if (current->prev == NULL)
|
||||
return 0;
|
||||
|
||||
assert(current_y == current->lineno - edittop->lineno);
|
||||
current = current->prev;
|
||||
current_x = actual_x(current->data, placewewant);
|
||||
if (current_y > 0) {
|
||||
update_line(current->next, 0);
|
||||
/* It was necessary to change current first, so the mark
|
||||
* display will change! */
|
||||
update_line(current, current_x);
|
||||
} else
|
||||
#ifndef NANO_SMALL
|
||||
if (ISSET(SMOOTHSCROLL))
|
||||
edit_update(current, TOP);
|
||||
else
|
||||
#endif
|
||||
edit_update(current, CENTER);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Return value 1 means we moved down, 0 means we were already at the
|
||||
* bottom. */
|
||||
int do_down(void)
|
||||
{
|
||||
#ifndef DISABLE_WRAPPING
|
||||
wrap_reset();
|
||||
#endif
|
||||
check_statblank();
|
||||
|
||||
if (current->next == NULL)
|
||||
return 0;
|
||||
|
||||
assert(current_y == current->lineno - edittop->lineno);
|
||||
current = current->next;
|
||||
current_x = actual_x(current->data, placewewant);
|
||||
|
||||
/* Note that current_y is zero-based. This test checks for the
|
||||
* cursor's being not on the last row of the edit window. */
|
||||
if (current_y != editwinrows - 1) {
|
||||
update_line(current->prev, 0);
|
||||
update_line(current, current_x);
|
||||
} else
|
||||
#ifndef NANO_SMALL
|
||||
if (ISSET(SMOOTHSCROLL))
|
||||
/* In this case current_y does not change. The cursor remains
|
||||
* at the bottom of the edit window. */
|
||||
edit_update(edittop->next, TOP);
|
||||
else
|
||||
#endif
|
||||
edit_update(current, CENTER);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int do_left(void)
|
||||
{
|
||||
if (current_x > 0)
|
||||
current_x--;
|
||||
else if (current != fileage) {
|
||||
do_up();
|
||||
current_x = strlen(current->data);
|
||||
}
|
||||
placewewant = xplustabs();
|
||||
check_statblank();
|
||||
update_line(current, current_x);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int do_right(void)
|
||||
{
|
||||
assert(current_x <= strlen(current->data));
|
||||
|
||||
if (current->data[current_x] != '\0')
|
||||
current_x++;
|
||||
else if (current->next != NULL) {
|
||||
do_down();
|
||||
current_x = 0;
|
||||
}
|
||||
placewewant = xplustabs();
|
||||
check_statblank();
|
||||
update_line(current, current_x);
|
||||
return 1;
|
||||
}
|
||||
@@ -57,6 +57,10 @@
|
||||
#ifndef DISABLE_WRAPJUSTIFY
|
||||
static int fill = 0; /* Fill - where to wrap lines, basically */
|
||||
#endif
|
||||
#ifndef DISABLE_WRAPPING
|
||||
static int same_line_wrap = 0; /* Whether wrapped text should be
|
||||
prepended to the next line */
|
||||
#endif
|
||||
|
||||
static struct termios oldterm; /* The user's original term settings */
|
||||
static struct sigaction act; /* For all our fun signal handlers */
|
||||
@@ -66,9 +70,6 @@ static sigjmp_buf jmpbuf; /* Used to return to mainloop after SIGWINCH */
|
||||
/* What we do when we're all set to exit */
|
||||
RETSIGTYPE finish(int sigage)
|
||||
{
|
||||
keypad(edit, TRUE);
|
||||
keypad(bottomwin, TRUE);
|
||||
|
||||
if (!ISSET(NO_HELP)) {
|
||||
mvwaddstr(bottomwin, 1, 0, hblank);
|
||||
mvwaddstr(bottomwin, 2, 0, hblank);
|
||||
@@ -232,28 +233,22 @@ void window_init(void)
|
||||
if (bottomwin != NULL)
|
||||
delwin(bottomwin);
|
||||
|
||||
/* Set up the main text window */
|
||||
/* Set up the main text window. */
|
||||
edit = newwin(editwinrows, COLS, 2, 0);
|
||||
|
||||
/* And the other windows */
|
||||
/* And the other windows. */
|
||||
topwin = newwin(2, COLS, 0, 0);
|
||||
bottomwin = newwin(3 - no_help(), COLS, LINES - 3 + no_help(), 0);
|
||||
|
||||
#ifdef PDCURSES
|
||||
/* Oops, I guess we need this again. Moved here so the keypad still
|
||||
works after a Meta-X, for example */
|
||||
/* This is so the keypad still works after a Meta-X, for example. */
|
||||
keypad(edit, TRUE);
|
||||
keypad(bottomwin, TRUE);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
|
||||
#ifndef DISABLE_MOUSE
|
||||
void mouse_init(void)
|
||||
{
|
||||
if (ISSET(USE_MOUSE)) {
|
||||
keypad_on(edit, 1);
|
||||
keypad_on(bottomwin, 1);
|
||||
|
||||
mousemask(BUTTON1_RELEASED, NULL);
|
||||
mouseinterval(50);
|
||||
} else
|
||||
@@ -367,12 +362,15 @@ void help_init(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 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. "
|
||||
"Alternative keys are shown in parentheses:\n\n");
|
||||
"sequences are notated with a caret (^) symbol and can be "
|
||||
"entered either by using the Control (Ctrl) key or pressing the "
|
||||
"Esc key twice. 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. Also, pressing Esc "
|
||||
"twice and then typing a three-digit number from 000 to 255 "
|
||||
"will enter the character with the corresponding ASCII code. "
|
||||
"The following keystrokes are available in the main editor "
|
||||
"window. Alternative keys are shown in parentheses:\n\n");
|
||||
|
||||
allocsize += strlen(ptr);
|
||||
|
||||
@@ -636,10 +634,11 @@ void usage(void)
|
||||
print1opt("-F", "--multibuffer", _("Enable multiple file buffers"));
|
||||
#endif
|
||||
#ifdef ENABLE_NANORC
|
||||
#ifndef NANO_SMALL
|
||||
print1opt("-H", "--historylog", _("Log & read search/replace string history"));
|
||||
#endif
|
||||
print1opt("-I", "--ignorercfiles", _("Don't look at nanorc files"));
|
||||
#endif
|
||||
print1opt("-K", "--keypad", _("Use alternate keypad routines"));
|
||||
#ifndef NANO_SMALL
|
||||
print1opt("-M", "--mac", _("Write file in Mac format"));
|
||||
print1opt("-N", "--noconvert", _("Don't convert files from DOS/Mac format"));
|
||||
@@ -660,11 +659,12 @@ void usage(void)
|
||||
#endif
|
||||
print1opt("-c", "--const", _("Constantly show cursor position"));
|
||||
#ifndef NANO_SMALL
|
||||
print1opt("-d", "--rebinddelete", _("Fix Backspace if it acts like Delete"));
|
||||
print1opt("-i", "--autoindent", _("Automatically indent new lines"));
|
||||
print1opt("-k", "--cut", _("Let ^K cut from cursor to end of line"));
|
||||
#endif
|
||||
print1opt("-l", "--nofollow", _("Don't follow symbolic links, overwrite"));
|
||||
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
|
||||
#ifndef DISABLE_MOUSE
|
||||
print1opt("-m", "--mouse", _("Enable mouse"));
|
||||
#endif
|
||||
#ifndef DISABLE_OPERATINGDIR
|
||||
@@ -720,7 +720,7 @@ void version(void)
|
||||
#ifdef DISABLE_JUSTIFY
|
||||
printf(" --disable-justify");
|
||||
#endif
|
||||
#if defined(DISABLE_MOUSE) || !defined(NCURSES_MOUSE_VERSION)
|
||||
#ifdef DISABLE_MOUSE
|
||||
printf(" --disable-mouse");
|
||||
#endif
|
||||
#ifdef DISABLE_OPERATINGDIR
|
||||
@@ -887,7 +887,7 @@ int open_pipe(const char *command)
|
||||
}
|
||||
#endif /* NANO_SMALL */
|
||||
|
||||
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
|
||||
#ifndef DISABLE_MOUSE
|
||||
void do_mouse(void)
|
||||
{
|
||||
MEVENT mevent;
|
||||
@@ -917,7 +917,7 @@ void do_mouse(void)
|
||||
for(; current_y > mevent.y && current->prev != NULL; current_y--)
|
||||
current = current->prev;
|
||||
|
||||
xcur = actual_x(current, get_page_start(xplustabs()) + mevent.x);
|
||||
xcur = actual_x(current->data, get_page_start(xplustabs()) + mevent.x);
|
||||
|
||||
/* Selecting where the cursor is toggles the mark. As does
|
||||
selecting beyond the line length with the cursor at the end of
|
||||
@@ -990,7 +990,7 @@ void do_char(char ch)
|
||||
/* more dangerousness fun =) */
|
||||
current->data = charealloc(current->data, current_len + 2);
|
||||
assert(current_x <= current_len);
|
||||
memmove(¤t->data[current_x + 1],
|
||||
charmove(¤t->data[current_x + 1],
|
||||
¤t->data[current_x],
|
||||
current_len - current_x + 1);
|
||||
current->data[current_x] = ch;
|
||||
@@ -1022,82 +1022,10 @@ void do_char(char ch)
|
||||
|
||||
int do_backspace(void)
|
||||
{
|
||||
int refresh = 0;
|
||||
if (current_x > 0) {
|
||||
assert(current_x <= strlen(current->data));
|
||||
/* Let's get dangerous */
|
||||
memmove(¤t->data[current_x - 1], ¤t->data[current_x],
|
||||
strlen(current->data) - current_x + 1);
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "current->data now = \"%s\"\n", current->data);
|
||||
#endif
|
||||
align(¤t->data);
|
||||
#ifndef NANO_SMALL
|
||||
if (current_x <= mark_beginx && mark_beginbuf == current)
|
||||
mark_beginx--;
|
||||
#endif
|
||||
if (current != fileage || current_x > 0) {
|
||||
do_left();
|
||||
#ifdef ENABLE_COLOR
|
||||
refresh = 1;
|
||||
#endif
|
||||
} else {
|
||||
filestruct *previous;
|
||||
const filestruct *tmp;
|
||||
|
||||
if (current == fileage)
|
||||
return 0; /* Can't delete past top of file */
|
||||
|
||||
previous = current->prev;
|
||||
current_x = strlen(previous->data);
|
||||
placewewant = strlenpt(previous->data);
|
||||
#ifndef NANO_SMALL
|
||||
if (current == mark_beginbuf) {
|
||||
mark_beginx += current_x;
|
||||
mark_beginbuf = previous;
|
||||
}
|
||||
#endif
|
||||
previous->data = charealloc(previous->data,
|
||||
current_x + strlen(current->data) + 1);
|
||||
strcpy(previous->data + current_x, current->data);
|
||||
|
||||
unlink_node(current);
|
||||
delete_node(current);
|
||||
tmp = current;
|
||||
current = (previous->next ? previous->next : previous);
|
||||
renumber(current);
|
||||
/* We had to renumber before doing update_line. */
|
||||
if (tmp == edittop)
|
||||
page_up();
|
||||
|
||||
/* Ooops, sanity check */
|
||||
if (tmp == filebot) {
|
||||
filebot = current;
|
||||
editbot = current;
|
||||
|
||||
/* Recreate the magic line if we're deleting it AND if the
|
||||
line we're on now is NOT blank. if it is blank we
|
||||
can just use IT for the magic line. This is how Pico
|
||||
appears to do it, in any case. */
|
||||
if (current->data[0] != '\0') {
|
||||
new_magicline();
|
||||
fix_editbot();
|
||||
}
|
||||
}
|
||||
|
||||
current = previous;
|
||||
if (current_y > 0)
|
||||
current_y--;
|
||||
totlines--;
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "After, data = \"%s\"\n", current->data);
|
||||
#endif
|
||||
refresh = 1;
|
||||
do_delete();
|
||||
}
|
||||
|
||||
totsize--;
|
||||
set_modified();
|
||||
if (refresh)
|
||||
edit_refresh();
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1115,7 +1043,7 @@ int do_delete(void)
|
||||
|
||||
if (current_x != strlen(current->data)) {
|
||||
/* Let's get dangerous */
|
||||
memmove(¤t->data[current_x], ¤t->data[current_x + 1],
|
||||
charmove(¤t->data[current_x], ¤t->data[current_x + 1],
|
||||
strlen(current->data) - current_x);
|
||||
|
||||
align(¤t->data);
|
||||
@@ -1361,24 +1289,25 @@ int do_mark(void)
|
||||
#ifdef NANO_SMALL
|
||||
nano_disabled_msg();
|
||||
#else
|
||||
if (!ISSET(MARK_ISSET)) {
|
||||
TOGGLE(MARK_ISSET);
|
||||
if (ISSET(MARK_ISSET)) {
|
||||
statusbar(_("Mark Set"));
|
||||
SET(MARK_ISSET);
|
||||
mark_beginbuf = current;
|
||||
mark_beginx = current_x;
|
||||
} else {
|
||||
statusbar(_("Mark UNset"));
|
||||
UNSET(MARK_ISSET);
|
||||
edit_refresh();
|
||||
}
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef DISABLE_WRAPPING
|
||||
void wrap_reset(void)
|
||||
{
|
||||
UNSET(SAMELINEWRAP);
|
||||
same_line_wrap = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_WRAPPING
|
||||
/* We wrap the given line. Precondition: we assume the cursor has been
|
||||
@@ -1463,7 +1392,7 @@ int do_wrap(filestruct *inptr)
|
||||
/* We prepend the wrapped text to the next line, if the flag is set,
|
||||
* and there is a next line, and prepending would not make the line
|
||||
* too long. */
|
||||
if (ISSET(SAMELINEWRAP) && inptr->next) {
|
||||
if (same_line_wrap && inptr->next) {
|
||||
wrap_line = inptr->next->data;
|
||||
wrap_line_len = strlen(wrap_line);
|
||||
|
||||
@@ -1541,7 +1470,7 @@ int do_wrap(filestruct *inptr)
|
||||
* other sundry things. */
|
||||
|
||||
/* later wraps of this line will be prepended to the next line. */
|
||||
SET(SAMELINEWRAP);
|
||||
same_line_wrap = 1;
|
||||
|
||||
/* Each line knows its line number. We recalculate these if we
|
||||
* inserted a new line. */
|
||||
@@ -1579,8 +1508,8 @@ int do_wrap(filestruct *inptr)
|
||||
#endif /* !DISABLE_WRAPPING */
|
||||
|
||||
#ifndef DISABLE_SPELLER
|
||||
/* word is misspelled in the file. Let the user replace it. We return
|
||||
False if the user cancels. */
|
||||
/* A word is misspelled in the file. Let the user replace it. We
|
||||
* return False if the user cancels. */
|
||||
int do_int_spell_fix(const char *word)
|
||||
{
|
||||
char *save_search;
|
||||
@@ -2250,17 +2179,17 @@ int break_line(const char *line, int goal, int force)
|
||||
space_loc++;
|
||||
return space_loc;
|
||||
}
|
||||
#endif /* !DISABLE_JUSTIFY */
|
||||
|
||||
/* This function justifies the current paragraph. */
|
||||
int do_justify(void)
|
||||
/* This function performs operations on paragraphs: justify, go to
|
||||
* beginning, and go to end. */
|
||||
int do_para_operation(int operation)
|
||||
{
|
||||
#ifdef DISABLE_JUSTIFY
|
||||
nano_disabled_msg();
|
||||
return 1;
|
||||
#else
|
||||
|
||||
/* To explain the justifying algorithm, I first need to define some
|
||||
/* operation == 0 means we're justifying the paragraph, operation == 1
|
||||
* means we're moving to the beginning line of the paragraph, and
|
||||
* operation == 2 means we're moving to the ending line of the
|
||||
* paragraph.
|
||||
*
|
||||
* To explain the justifying algorithm, I first need to define some
|
||||
* phrases about paragraphs and quotation:
|
||||
* A line of text consists of a "quote part", followed by an
|
||||
* "indentation part", followed by text. The functions quote_length()
|
||||
@@ -2320,6 +2249,10 @@ int do_justify(void)
|
||||
filestruct *line; /* generic line of text */
|
||||
size_t i; /* generic loop variable */
|
||||
|
||||
static int no_restart = 0;
|
||||
/* whether we're blocking restarting when searching for the
|
||||
* beginning line of the paragraph */
|
||||
|
||||
#ifdef HAVE_REGEX_H
|
||||
regex_t qreg; /* qreg is the compiled quotation regexp.
|
||||
* We no longer care about quotestr. */
|
||||
@@ -2339,13 +2272,15 @@ int do_justify(void)
|
||||
/* Here is an assumption that is always true anyway. */
|
||||
assert(current != NULL);
|
||||
|
||||
current_x = 0;
|
||||
|
||||
restart_bps:
|
||||
/* Here we find the first line of the paragraph to justify. If the
|
||||
* current line is in a paragraph, then we move back to the first line.
|
||||
* Otherwise we move down to the first line that is in a paragraph. */
|
||||
quote_len = quote_length(IFREG(current->data, &qreg));
|
||||
indent_len = indent_length(current->data + quote_len);
|
||||
|
||||
current_x = 0;
|
||||
if (current->data[quote_len + indent_len] != '\0') {
|
||||
/* This line is part of a paragraph. So we must search back to
|
||||
* the first line of this paragraph. First we check items 1) and
|
||||
@@ -2371,6 +2306,25 @@ int do_justify(void)
|
||||
current = current->prev;
|
||||
current_y--;
|
||||
}
|
||||
} else if (operation == 1) {
|
||||
/* This line is not part of a paragraph. Move up until we get
|
||||
* to a non "blank" line, and then move down once. */
|
||||
do {
|
||||
/* There is no previous paragraph, so nothing to move to. */
|
||||
if (current->prev == NULL) {
|
||||
placewewant = 0;
|
||||
if (current_y < 0)
|
||||
edit_update(current, CENTER);
|
||||
else
|
||||
edit_refresh();
|
||||
return 0;
|
||||
}
|
||||
current = current->prev;
|
||||
current_y--;
|
||||
quote_len = quote_length(IFREG(current->data, &qreg));
|
||||
indent_len = indent_length(current->data + quote_len);
|
||||
} while (current->data[quote_len + indent_len] == '\0');
|
||||
current = current->next;
|
||||
} else {
|
||||
/* This line is not part of a paragraph. Move down until we get
|
||||
* to a non "blank" line. */
|
||||
@@ -2416,12 +2370,29 @@ int do_justify(void)
|
||||
par_len++;
|
||||
}
|
||||
#ifdef HAVE_REGEX_H
|
||||
/* We no longer need to check quotation. */
|
||||
regfree(&qreg);
|
||||
/* We no longer need to check quotation, unless we're searching for
|
||||
* the beginning of the paragraph. */
|
||||
if (operation != 1)
|
||||
regfree(&qreg);
|
||||
#endif
|
||||
/* Now par_len is the number of lines in this paragraph. Should never
|
||||
* call quotes_match() or quote_length() again. */
|
||||
|
||||
/* If we're searching for the beginning of the paragraph, skip the
|
||||
* justification. If we're searching for the end of the paragraph,
|
||||
* move down the number of lines in the paragraph and skip the
|
||||
* justification. */
|
||||
if (operation == 1)
|
||||
goto skip_justify;
|
||||
else if (operation == 2) {
|
||||
while (par_len > 0) {
|
||||
current = current->next;
|
||||
current_y++;
|
||||
par_len--;
|
||||
}
|
||||
goto skip_justify;
|
||||
}
|
||||
|
||||
/* Next step, we loop through the lines of this paragraph, justifying
|
||||
* each one individually. */
|
||||
SET(JUSTIFY_MODE);
|
||||
@@ -2491,7 +2462,7 @@ int do_justify(void)
|
||||
current->next->data = charealloc(current->next->data,
|
||||
next_line_len + line_len - break_pos + 1);
|
||||
|
||||
memmove(current->next->data + indent_len + line_len - break_pos,
|
||||
charmove(current->next->data + indent_len + line_len - break_pos,
|
||||
current->next->data + indent_len,
|
||||
next_line_len - indent_len + 1);
|
||||
strcpy(current->next->data + indent_len,
|
||||
@@ -2565,7 +2536,7 @@ int do_justify(void)
|
||||
totsize -= indent_len;
|
||||
current_y--;
|
||||
} else {
|
||||
memmove(current->next->data + indent_len,
|
||||
charmove(current->next->data + indent_len,
|
||||
current->next->data + indent_len + break_pos + 1,
|
||||
next_line_len - break_pos - indent_len);
|
||||
null_at(¤t->next->data,
|
||||
@@ -2578,8 +2549,8 @@ int do_justify(void)
|
||||
}
|
||||
UNSET(JUSTIFY_MODE);
|
||||
|
||||
/* We are now done justifying the paragraph. There are cleanup things to
|
||||
* do, and we check for unjustify. */
|
||||
/* We are now done justifying the paragraph. There are cleanup things
|
||||
* to do, and we check for unjustify. */
|
||||
|
||||
/* totlines, totsize, and current_y have been maintained above. We
|
||||
* now set last_par_line to the new end of the paragraph, update
|
||||
@@ -2592,6 +2563,59 @@ int do_justify(void)
|
||||
renumber(first_mod_line);
|
||||
}
|
||||
|
||||
skip_justify:
|
||||
if (operation == 1) {
|
||||
/* We're on the same line we started on. Search for the first
|
||||
* non-"blank" line before the line we're on (if there is one),
|
||||
* continually restart that search from the current position
|
||||
* until we find a line that's part of a paragraph, and then
|
||||
* search once more from there, so that we end up on the first
|
||||
* line of that paragraph. In the process, skip over lines
|
||||
* consisting only of spacing characters, as searching for the
|
||||
* end of the paragraph does. Then update the screen. */
|
||||
if (current != fileage && current == current_save && !no_restart) {
|
||||
while (current->prev != NULL) {
|
||||
int j, j_space = 0;
|
||||
current = current->prev;
|
||||
current_y--;
|
||||
for (j = 0; j < strlen(current->data); j++) {
|
||||
if (isspace(current->data[j]))
|
||||
j_space++;
|
||||
else {
|
||||
j = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (j != j_space && strlen(current->data) >=
|
||||
(quote_len + indent_len) &&
|
||||
current->data[quote_len + indent_len] != '\0') {
|
||||
no_restart = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
goto restart_bps;
|
||||
} else
|
||||
no_restart = 0;
|
||||
#ifdef HAVE_REGEX_H
|
||||
/* We no longer need to check quotation, if we were
|
||||
* searching for the beginning of the paragraph. */
|
||||
regfree(&qreg);
|
||||
#endif
|
||||
if (current_y < 0)
|
||||
edit_update(current, CENTER);
|
||||
else
|
||||
edit_refresh();
|
||||
return 0;
|
||||
} else if (operation == 2) {
|
||||
/* We've already moved to the end of the paragraph. Update the
|
||||
* screen. */
|
||||
if (current_y > editwinrows - 1)
|
||||
edit_update(current, CENTER);
|
||||
else
|
||||
edit_refresh();
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (current_y > editwinrows - 1)
|
||||
edit_update(current, CENTER);
|
||||
else
|
||||
@@ -2606,7 +2630,7 @@ int do_justify(void)
|
||||
/* Now get a keystroke and see if it's unjustify; if not, unget the
|
||||
* keystroke and return. */
|
||||
|
||||
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
|
||||
#ifndef DISABLE_MOUSE
|
||||
/* If it was a mouse click, parse it with do_mouse() and it might
|
||||
* become the unjustify key. Else give it back to the input stream. */
|
||||
if ((i = wgetch(edit)) == KEY_MOUSE)
|
||||
@@ -2669,9 +2693,31 @@ int do_justify(void)
|
||||
display_main_list();
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* !DISABLE_JUSTIFY */
|
||||
|
||||
int do_justify(void)
|
||||
{
|
||||
#ifdef DISABLE_JUSTIFY
|
||||
nano_disabled_msg();
|
||||
return 1;
|
||||
#else
|
||||
return do_para_operation(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
int do_para_begin(void)
|
||||
{
|
||||
return do_para_operation(1);
|
||||
}
|
||||
|
||||
int do_para_end(void)
|
||||
{
|
||||
return do_para_operation(2);
|
||||
}
|
||||
#endif
|
||||
|
||||
int do_exit(void)
|
||||
{
|
||||
int i;
|
||||
@@ -2806,6 +2852,12 @@ RETSIGTYPE do_suspend(int signal)
|
||||
/* Restore the terminal settings for the disabled keys */
|
||||
tcsetattr(0, TCSANOW, &oldterm);
|
||||
|
||||
/* Trap SIGHUP and SIGTERM so we can properly deal with them while
|
||||
suspended */
|
||||
act.sa_handler = handle_hupterm;
|
||||
sigaction(SIGHUP, &act, NULL);
|
||||
sigaction(SIGTERM, &act, NULL);
|
||||
|
||||
/* We used to re-enable the default SIG_DFL and raise SIGTSTP, but
|
||||
then we could be (and were) interrupted in the middle of the call.
|
||||
So we do it the mutt way instead */
|
||||
@@ -2817,8 +2869,8 @@ RETSIGTYPE do_cont(int signal)
|
||||
{
|
||||
/* Now we just update the screen instead of having to reenable the
|
||||
SIGTSTP handler. */
|
||||
|
||||
doupdate();
|
||||
|
||||
/* The Hurd seems to need this, otherwise a ^Y after a ^Z will
|
||||
start suspending again. */
|
||||
signal_init();
|
||||
@@ -2933,7 +2985,7 @@ void do_toggle(const toggle *which)
|
||||
case TOGGLE_SUSPEND_KEY:
|
||||
signal_init();
|
||||
break;
|
||||
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
|
||||
#ifndef DISABLE_MOUSE
|
||||
case TOGGLE_MOUSE_KEY:
|
||||
mouse_init();
|
||||
break;
|
||||
@@ -2969,29 +3021,6 @@ void do_toggle(const toggle *which)
|
||||
}
|
||||
#endif /* !NANO_SMALL */
|
||||
|
||||
/* This function returns the correct keystroke, given the A,B,C or D
|
||||
input key. This is a common sequence of many terms which send
|
||||
Esc-O-[A-D] or Esc-[-[A-D]. */
|
||||
int abcd(int input)
|
||||
{
|
||||
switch (input) {
|
||||
case 'A':
|
||||
case 'a':
|
||||
return KEY_UP;
|
||||
case 'B':
|
||||
case 'b':
|
||||
return KEY_DOWN;
|
||||
case 'C':
|
||||
case 'c':
|
||||
return KEY_RIGHT;
|
||||
case 'D':
|
||||
case 'd':
|
||||
return KEY_LEFT;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int optchr;
|
||||
@@ -3001,6 +3030,7 @@ int main(int argc, char *argv[])
|
||||
const shortcut *s;
|
||||
int keyhandled = 0; /* Have we handled the keystroke yet? */
|
||||
int kbinput = -1; /* Input from keyboard */
|
||||
int meta;
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
const toggle *t;
|
||||
@@ -3016,10 +3046,11 @@ int main(int argc, char *argv[])
|
||||
{"multibuffer", 0, 0, 'F'},
|
||||
#endif
|
||||
#ifdef ENABLE_NANORC
|
||||
#ifndef NANO_SMALL
|
||||
{"historylog", 0, 0, 'H'},
|
||||
#endif
|
||||
{"ignorercfiles", 0, 0, 'I'},
|
||||
#endif
|
||||
{"keypad", 0, 0, 'K'},
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
{"quotestr", 1, 0, 'Q'},
|
||||
#endif
|
||||
@@ -3032,8 +3063,9 @@ int main(int argc, char *argv[])
|
||||
{"syntax", 1, 0, 'Y'},
|
||||
#endif
|
||||
{"const", 0, 0, 'c'},
|
||||
{"rebinddelete", 0, 0, 'd'},
|
||||
{"nofollow", 0, 0, 'l'},
|
||||
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
|
||||
#ifndef DISABLE_MOUSE
|
||||
{"mouse", 0, 0, 'm'},
|
||||
#endif
|
||||
#ifndef DISABLE_OPERATINGDIR
|
||||
@@ -3080,11 +3112,11 @@ int main(int argc, char *argv[])
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GETOPT_LONG
|
||||
while ((optchr = getopt_long(argc, argv, "h?BDFHIKMNQ:RST:VY:abcefgijklmo:pr:s:tvwxz",
|
||||
while ((optchr = getopt_long(argc, argv, "h?BDFHIMNQ:RST:VY:abcdefgijklmo:pr:s:tvwxz",
|
||||
long_options, &option_index)) != -1) {
|
||||
#else
|
||||
while ((optchr =
|
||||
getopt(argc, argv, "h?BDFHIKMNQ:RST:VY:abcefgijklmo:pr:s:tvwxz")) != -1) {
|
||||
getopt(argc, argv, "h?BDFHIMNQ:RST:VY:abcdefgijklmo:pr:s:tvwxz")) != -1) {
|
||||
#endif
|
||||
|
||||
switch (optchr) {
|
||||
@@ -3111,16 +3143,15 @@ int main(int argc, char *argv[])
|
||||
break;
|
||||
#endif
|
||||
#ifdef ENABLE_NANORC
|
||||
#ifndef NANO_SMALL
|
||||
case 'H':
|
||||
SET(HISTORYLOG);
|
||||
break;
|
||||
#endif
|
||||
case 'I':
|
||||
SET(NO_RCFILE);
|
||||
break;
|
||||
#endif
|
||||
case 'K':
|
||||
SET(ALT_KEYPAD);
|
||||
break;
|
||||
#ifndef NANO_SMALL
|
||||
case 'M':
|
||||
SET(MAC_FILE);
|
||||
@@ -3173,6 +3204,9 @@ int main(int argc, char *argv[])
|
||||
case 'c':
|
||||
SET(CONSTUPDATE);
|
||||
break;
|
||||
case 'd':
|
||||
SET(REBIND_DELETE);
|
||||
break;
|
||||
#ifndef NANO_SMALL
|
||||
case 'i':
|
||||
SET(AUTOINDENT);
|
||||
@@ -3184,7 +3218,7 @@ int main(int argc, char *argv[])
|
||||
case 'l':
|
||||
SET(NOFOLLOW_SYMLINKS);
|
||||
break;
|
||||
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
|
||||
#ifndef DISABLE_MOUSE
|
||||
case 'm':
|
||||
SET(USE_MOUSE);
|
||||
break;
|
||||
@@ -3385,14 +3419,12 @@ int main(int argc, char *argv[])
|
||||
#endif
|
||||
|
||||
window_init();
|
||||
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
|
||||
#ifndef DISABLE_MOUSE
|
||||
mouse_init();
|
||||
#endif
|
||||
|
||||
if (!ISSET(ALT_KEYPAD)) {
|
||||
keypad(edit, TRUE);
|
||||
keypad(bottomwin, TRUE);
|
||||
}
|
||||
keypad(edit, TRUE);
|
||||
keypad(bottomwin, TRUE);
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "Main: bottom win\n");
|
||||
@@ -3447,7 +3479,7 @@ int main(int argc, char *argv[])
|
||||
if (ISSET(CONSTUPDATE))
|
||||
do_cursorpos(1);
|
||||
|
||||
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_HELP) || (!defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION))
|
||||
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_HELP) || !defined(DISABLE_MOUSE)
|
||||
currshortcut = main_list;
|
||||
#endif
|
||||
|
||||
@@ -3456,160 +3488,12 @@ int main(int argc, char *argv[])
|
||||
raw();
|
||||
#endif
|
||||
|
||||
kbinput = wgetch(edit);
|
||||
kbinput = get_kbinput(edit, &meta, ISSET(REBIND_DELETE));
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "AHA! %c (%d)\n", kbinput, kbinput);
|
||||
#endif
|
||||
if (kbinput == 27) { /* Grab Alt-key stuff first */
|
||||
kbinput = wgetch(edit);
|
||||
if (meta == 1) {
|
||||
switch (kbinput) {
|
||||
/* Alt-O, suddenly very important ;) */
|
||||
case 'O':
|
||||
kbinput = wgetch(edit);
|
||||
/* Shift or Ctrl + Arrows are Alt-O-[2,5,6]-[A,B,C,D] on some terms */
|
||||
if (kbinput == '2' || kbinput == '5' || kbinput == '6')
|
||||
kbinput = wgetch(edit);
|
||||
if ((kbinput <= 'D' && kbinput >= 'A') ||
|
||||
(kbinput <= 'd' && kbinput >= 'a'))
|
||||
kbinput = abcd(kbinput);
|
||||
else if (kbinput <= 'z' && kbinput >= 'j')
|
||||
print_numlock_warning();
|
||||
else if (kbinput <= 'S' && kbinput >= 'P')
|
||||
kbinput = KEY_F(kbinput - 79);
|
||||
#ifdef DEBUG
|
||||
else {
|
||||
fprintf(stderr, "I got Alt-O-%c! (%d)\n",
|
||||
kbinput, kbinput);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case 27:
|
||||
/* If we get Alt-Alt, the next keystroke should be the same as a
|
||||
control sequence */
|
||||
modify_control_seq = 1;
|
||||
keyhandled = 1;
|
||||
break;
|
||||
case '[':
|
||||
kbinput = wgetch(edit);
|
||||
switch (kbinput) {
|
||||
case '1': /* Alt-[-1-[0-5,7-9] = F1-F8 in X at least */
|
||||
kbinput = wgetch(edit);
|
||||
if (kbinput >= '1' && kbinput <= '5') {
|
||||
kbinput = KEY_F(kbinput - 48);
|
||||
wgetch(edit);
|
||||
} else if (kbinput >= '7' && kbinput <= '9') {
|
||||
kbinput = KEY_F(kbinput - 49);
|
||||
wgetch(edit);
|
||||
} else if (kbinput == '~')
|
||||
kbinput = KEY_HOME;
|
||||
#ifdef DEBUG
|
||||
else {
|
||||
fprintf(stderr, "I got Alt-[-1-%c! (%d)\n",
|
||||
kbinput, kbinput);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case '2': /* Alt-[-2-[0,1,3,4] = F9-F12 in many terms */
|
||||
kbinput = wgetch(edit);
|
||||
switch (kbinput) {
|
||||
case '0':
|
||||
kbinput = KEY_F(9);
|
||||
wgetch(edit);
|
||||
break;
|
||||
case '1':
|
||||
kbinput = KEY_F(10);
|
||||
wgetch(edit);
|
||||
break;
|
||||
case '3':
|
||||
kbinput = KEY_F(11);
|
||||
wgetch(edit);
|
||||
break;
|
||||
case '4':
|
||||
kbinput = KEY_F(12);
|
||||
wgetch(edit);
|
||||
break;
|
||||
case '~':
|
||||
kbinput = NANO_INSERTFILE_KEY;
|
||||
break;
|
||||
#ifdef DEBUG
|
||||
default:
|
||||
fprintf(stderr, "I got Alt-[-2-%c! (%d)\n",
|
||||
kbinput, kbinput);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
case '3': /* Alt-[-3 = Delete? */
|
||||
kbinput = NANO_DELETE_KEY;
|
||||
wgetch(edit);
|
||||
break;
|
||||
case '4': /* Alt-[-4 = End? */
|
||||
kbinput = NANO_END_KEY;
|
||||
wgetch(edit);
|
||||
break;
|
||||
case '5': /* Alt-[-5 = Page Up */
|
||||
kbinput = KEY_PPAGE;
|
||||
wgetch(edit);
|
||||
break;
|
||||
case 'V': /* Alt-[-V = Page Up in Hurd Console */
|
||||
case 'I': /* Alt-[-I = Page Up - FreeBSD Console */
|
||||
kbinput = KEY_PPAGE;
|
||||
break;
|
||||
case '6': /* Alt-[-6 = Page Down */
|
||||
kbinput = KEY_NPAGE;
|
||||
wgetch(edit);
|
||||
break;
|
||||
case 'U': /* Alt-[-U = Page Down in Hurd Console */
|
||||
case 'G': /* Alt-[-G = Page Down - FreeBSD Console */
|
||||
kbinput = KEY_NPAGE;
|
||||
break;
|
||||
case '7':
|
||||
kbinput = KEY_HOME;
|
||||
wgetch(edit);
|
||||
break;
|
||||
case '8':
|
||||
kbinput = KEY_END;
|
||||
wgetch(edit);
|
||||
break;
|
||||
case '9': /* Alt-[-9 = Delete in Hurd Console */
|
||||
kbinput = KEY_DC;
|
||||
break;
|
||||
case '@': /* Alt-[-@ = Insert in Hurd Console */
|
||||
case 'L': /* Alt-[-L = Insert - FreeBSD Console */
|
||||
kbinput = NANO_INSERTFILE_KEY;
|
||||
break;
|
||||
case '[': /* Alt-[-[-[A-E], F1-F5 in Linux console */
|
||||
kbinput = wgetch(edit);
|
||||
if (kbinput >= 'A' && kbinput <= 'E')
|
||||
kbinput = KEY_F(kbinput - 64);
|
||||
break;
|
||||
case 'A':
|
||||
case 'B':
|
||||
case 'C':
|
||||
case 'D':
|
||||
case 'a':
|
||||
case 'b':
|
||||
case 'c':
|
||||
case 'd':
|
||||
kbinput = abcd(kbinput);
|
||||
break;
|
||||
case 'H':
|
||||
kbinput = KEY_HOME;
|
||||
break;
|
||||
case 'F':
|
||||
case 'Y': /* End Key in Hurd Console */
|
||||
kbinput = KEY_END;
|
||||
break;
|
||||
default:
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "I got Alt-[-%c! (%d)\n",
|
||||
kbinput, kbinput);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
break;
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
case NANO_OPENPREV_KEY:
|
||||
case NANO_OPENPREV_ALTKEY:
|
||||
@@ -3653,32 +3537,14 @@ int main(int argc, char *argv[])
|
||||
fprintf(stderr, "I got Alt-%c! (%d)\n", kbinput,
|
||||
kbinput);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* Hack, make insert key do something useful, like insert file */
|
||||
else if (kbinput == KEY_IC)
|
||||
kbinput = NANO_INSERTFILE_KEY;
|
||||
|
||||
/* If modify_control_seq is set, we received an Alt-Alt
|
||||
sequence before this, so we make this key a control sequence
|
||||
by subtracting 32, 64, or 96, depending on its value. */
|
||||
if (!keyhandled && modify_control_seq) {
|
||||
if (kbinput == ' ')
|
||||
kbinput -= 32;
|
||||
else if (kbinput >= 'A' && kbinput < 'a')
|
||||
kbinput -= 64;
|
||||
else if (kbinput >= 'a' && kbinput <= 'z')
|
||||
kbinput -= 96;
|
||||
|
||||
modify_control_seq = 0;
|
||||
}
|
||||
|
||||
/* Look through the main shortcut list to see if we've hit a
|
||||
shortcut key */
|
||||
|
||||
if (!keyhandled)
|
||||
#if !defined(DISABLE_BROWSER) || !defined (DISABLE_HELP) || (!defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION))
|
||||
#if !defined(DISABLE_BROWSER) || !defined (DISABLE_HELP) || !defined(DISABLE_MOUSE)
|
||||
for (s = currshortcut; s != NULL && !keyhandled; s = s->next) {
|
||||
#else
|
||||
for (s = main_list; s != NULL && !keyhandled; s = s->next) {
|
||||
@@ -3707,19 +3573,18 @@ int main(int argc, char *argv[])
|
||||
|
||||
#ifdef _POSIX_VDISABLE
|
||||
/* Don't even think about changing this string */
|
||||
if (kbinput == 19)
|
||||
statusbar(_("XOFF ignored, mumble mumble."));
|
||||
if (kbinput == 17)
|
||||
if (kbinput == NANO_CONTROL_Q)
|
||||
statusbar(_("XON ignored, mumble mumble."));
|
||||
if (kbinput == NANO_CONTROL_S)
|
||||
statusbar(_("XOFF ignored, mumble mumble."));
|
||||
#endif
|
||||
/* If we're in raw mode or using Alt-Alt-x, we have to catch
|
||||
Control-S and Control-Q */
|
||||
if (kbinput == 17 || kbinput == 19)
|
||||
if (kbinput == NANO_CONTROL_Q || kbinput == NANO_CONTROL_S)
|
||||
keyhandled = 1;
|
||||
|
||||
/* Catch ^Z by hand when triggered also
|
||||
407 == ^Z in Linux console when keypad() is used? */
|
||||
if (kbinput == 26 || kbinput == 407) {
|
||||
/* Catch ^Z by hand when triggered also */
|
||||
if (kbinput == NANO_SUSPEND_KEY) {
|
||||
if (ISSET(SUSPEND))
|
||||
do_suspend(0);
|
||||
keyhandled = 1;
|
||||
@@ -3728,24 +3593,16 @@ int main(int argc, char *argv[])
|
||||
/* Last gasp, stuff that's not in the main lists */
|
||||
if (!keyhandled)
|
||||
switch (kbinput) {
|
||||
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
|
||||
#ifndef DISABLE_MOUSE
|
||||
case KEY_MOUSE:
|
||||
do_mouse();
|
||||
break;
|
||||
#endif
|
||||
|
||||
case -1: /* Stuff that we don't want to do squat */
|
||||
case 0: /* Erg */
|
||||
case 29: /* Ctrl-] */
|
||||
case 410: /* Must ignore this, it's sent when we resize */
|
||||
#ifdef PDCURSES
|
||||
case 541: /* ???? */
|
||||
case 542: /* Control and alt in Windows *shrug* */
|
||||
case 543: /* Right ctrl key */
|
||||
case 544:
|
||||
case 545: /* Right alt key */
|
||||
#endif
|
||||
|
||||
case NANO_CONTROL_3: /* Ctrl-[ (Esc), which should
|
||||
* have been handled before we
|
||||
* got here */
|
||||
case NANO_CONTROL_5: /* Ctrl-] */
|
||||
break;
|
||||
default:
|
||||
#ifdef DEBUG
|
||||
@@ -29,29 +29,31 @@
|
||||
/* Macros for the flags int... */
|
||||
#define SET(bit) flags |= bit
|
||||
#define UNSET(bit) flags &= ~bit
|
||||
#define ISSET(bit) (flags & bit)
|
||||
#define ISSET(bit) ((flags & bit) != 0)
|
||||
#define TOGGLE(bit) flags ^= bit
|
||||
|
||||
/* Define charalloc as a macro rather than duplicating code */
|
||||
#define charalloc(howmuch) (char *)nmalloc((howmuch) * sizeof(char))
|
||||
#define charealloc(ptr, howmuch) (char *)nrealloc(ptr, (howmuch) * sizeof(char))
|
||||
#define charmove(dest, src, n) memmove(dest, src, (n) * sizeof(char))
|
||||
#ifdef BROKEN_REGEXEC
|
||||
#define regexec(preg, string, nmatch, pmatch, eflags) regexec_safe(preg, string, nmatch, pmatch, eflags)
|
||||
#endif
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* For the backup file copy ... */
|
||||
# define COPYFILEBLOCKSIZE 1024
|
||||
/* For the backup file copy ... */
|
||||
#define COPYFILEBLOCKSIZE 1024
|
||||
#endif
|
||||
|
||||
#ifdef USE_SLANG /* Slang support enabled */
|
||||
#ifdef USE_SLANG
|
||||
/* Slang support enabled */
|
||||
#include <slcurses.h>
|
||||
#define KEY_IC SL_KEY_IC
|
||||
#define KEY_DC SL_KEY_DELETE
|
||||
#define KEY_IC SL_KEY_IC
|
||||
#elif defined(HAVE_NCURSES_H)
|
||||
#include <ncurses.h>
|
||||
#else /* Uh oh */
|
||||
#include <curses.h>
|
||||
#include <curses.h>
|
||||
#endif /* CURSES_H */
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
@@ -87,14 +89,28 @@
|
||||
#define strncasecmp nstrnicmp
|
||||
#endif
|
||||
|
||||
/* Assume ERR is defined as -1. To avoid duplicate case values when
|
||||
some key definitions are missing, we have to set these all to
|
||||
different negative values other than -1. */
|
||||
|
||||
/* HP-UX 10 & 11 do not seem to support KEY_HOME and KEY_END */
|
||||
#ifndef KEY_HOME
|
||||
#define KEY_HOME -1
|
||||
#endif /* KEY_HOME */
|
||||
#define KEY_HOME -2
|
||||
#endif
|
||||
|
||||
#ifndef KEY_END
|
||||
#define KEY_END -1
|
||||
#endif /* KEY_END */
|
||||
#define KEY_END -3
|
||||
#endif
|
||||
|
||||
/* Slang and SunOS 5.7-5.9 do not seem to support KEY_RESIZE */
|
||||
#ifndef KEY_RESIZE
|
||||
#define KEY_RESIZE -4
|
||||
#endif
|
||||
|
||||
/* Slang does not seem to support KEY_SUSPEND */
|
||||
#ifndef KEY_SUSPEND
|
||||
#define KEY_SUSPEND -5
|
||||
#endif
|
||||
|
||||
/* Snatch these out of the ncurses defs, so we can use them in search
|
||||
history regardless of whether we're using ncurses or not */
|
||||
@@ -105,6 +121,10 @@
|
||||
|
||||
#define VERMSG "GNU nano " VERSION
|
||||
|
||||
#ifndef NCURSES_MOUSE_VERSION
|
||||
#define DISABLE_MOUSE 1
|
||||
#endif
|
||||
|
||||
#if defined(DISABLE_WRAPPING) && defined(DISABLE_JUSTIFY)
|
||||
#define DISABLE_WRAPJUSTIFY 1
|
||||
#endif
|
||||
@@ -231,28 +251,27 @@ typedef struct historyheadtype {
|
||||
#define SUSPEND (1<<7)
|
||||
#define NO_WRAP (1<<8)
|
||||
#define AUTOINDENT (1<<9)
|
||||
#define SAMELINEWRAP (1<<10)
|
||||
#define VIEW_MODE (1<<11)
|
||||
#define USE_MOUSE (1<<12)
|
||||
#define USE_REGEXP (1<<13)
|
||||
#define REGEXP_COMPILED (1<<14)
|
||||
#define TEMP_OPT (1<<15)
|
||||
#define CUT_TO_END (1<<16)
|
||||
#define REVERSE_SEARCH (1<<17)
|
||||
#define MULTIBUFFER (1<<18)
|
||||
#define DOS_FILE (1<<19)
|
||||
#define MAC_FILE (1<<20)
|
||||
#define SMOOTHSCROLL (1<<21)
|
||||
#define DISABLE_CURPOS (1<<22) /* Damn, we still need it */
|
||||
#define ALT_KEYPAD (1<<23)
|
||||
#define NO_CONVERT (1<<24)
|
||||
#define BACKUP_FILE (1<<25)
|
||||
#define NO_RCFILE (1<<26)
|
||||
#define COLOR_SYNTAX (1<<27)
|
||||
#define PRESERVE (1<<28)
|
||||
#define HISTORY_CHANGED (1<<29)
|
||||
#define HISTORYLOG (1<<30)
|
||||
#define JUSTIFY_MODE (1<<31)
|
||||
#define VIEW_MODE (1<<10)
|
||||
#define USE_MOUSE (1<<11)
|
||||
#define USE_REGEXP (1<<12)
|
||||
#define REGEXP_COMPILED (1<<13)
|
||||
#define TEMP_OPT (1<<14)
|
||||
#define CUT_TO_END (1<<15)
|
||||
#define REVERSE_SEARCH (1<<16)
|
||||
#define MULTIBUFFER (1<<17)
|
||||
#define DOS_FILE (1<<18)
|
||||
#define MAC_FILE (1<<19)
|
||||
#define SMOOTHSCROLL (1<<20)
|
||||
#define DISABLE_CURPOS (1<<21) /* Damn, we still need it */
|
||||
#define REBIND_DELETE (1<<22)
|
||||
#define NO_CONVERT (1<<23)
|
||||
#define BACKUP_FILE (1<<24)
|
||||
#define NO_RCFILE (1<<25)
|
||||
#define COLOR_SYNTAX (1<<26)
|
||||
#define PRESERVE (1<<27)
|
||||
#define HISTORY_CHANGED (1<<28)
|
||||
#define HISTORYLOG (1<<29)
|
||||
#define JUSTIFY_MODE (1<<30)
|
||||
|
||||
/* Control key sequences, changing these would be very very bad */
|
||||
|
||||
@@ -283,11 +302,12 @@ typedef struct historyheadtype {
|
||||
#define NANO_CONTROL_X 24
|
||||
#define NANO_CONTROL_Y 25
|
||||
#define NANO_CONTROL_Z 26
|
||||
|
||||
#define NANO_CONTROL_3 27
|
||||
#define NANO_CONTROL_4 28
|
||||
#define NANO_CONTROL_5 29
|
||||
#define NANO_CONTROL_6 30
|
||||
#define NANO_CONTROL_7 31
|
||||
#define NANO_CONTROL_8 127
|
||||
|
||||
#define NANO_ALT_A 'a'
|
||||
#define NANO_ALT_B 'b'
|
||||
@@ -322,8 +342,8 @@ typedef struct historyheadtype {
|
||||
#define NANO_ALT_BRACKET ']'
|
||||
#define NANO_ALT_SPACE ' '
|
||||
|
||||
/* Some semi-changeable keybindings; don't play with unless you're sure you
|
||||
know what you're doing */
|
||||
/* Some semi-changeable keybindings; don't play with unless you're sure
|
||||
you know what you're doing */
|
||||
|
||||
#define NANO_INSERTFILE_KEY NANO_CONTROL_R
|
||||
#define NANO_INSERTFILE_FKEY KEY_F(5)
|
||||
@@ -338,6 +358,7 @@ know what you're doing */
|
||||
#define NANO_HELP_FKEY KEY_F(1)
|
||||
#define NANO_WHEREIS_KEY NANO_CONTROL_W
|
||||
#define NANO_WHEREIS_FKEY KEY_F(6)
|
||||
#define NANO_WHEREIS_NEXT_KEY NANO_ALT_W
|
||||
#define NANO_REPLACE_KEY NANO_CONTROL_4
|
||||
#define NANO_REPLACE_FKEY KEY_F(14)
|
||||
#define NANO_ALT_REPLACE_KEY NANO_ALT_R
|
||||
@@ -386,6 +407,8 @@ know what you're doing */
|
||||
#define NANO_EXTCMD_KEY NANO_CONTROL_X
|
||||
#define NANO_NEXTWORD_KEY NANO_CONTROL_SPACE
|
||||
#define NANO_PREVWORD_KEY NANO_ALT_SPACE
|
||||
#define NANO_PARABEGIN_KEY NANO_CONTROL_W
|
||||
#define NANO_PARAEND_KEY NANO_CONTROL_O
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* Toggles do not exist with NANO_SMALL. */
|
||||
@@ -396,7 +419,7 @@ know what you're doing */
|
||||
#define TOGGLE_MOUSE_KEY NANO_ALT_M
|
||||
#define TOGGLE_CUTTOEND_KEY NANO_ALT_K
|
||||
#define TOGGLE_REGEXP_KEY NANO_ALT_R
|
||||
#define TOGGLE_WRAP_KEY NANO_ALT_W
|
||||
#define TOGGLE_WRAP_KEY NANO_ALT_L
|
||||
#define TOGGLE_BACKWARDS_KEY NANO_ALT_B
|
||||
#define TOGGLE_CASE_KEY NANO_ALT_C
|
||||
#define TOGGLE_LOAD_KEY NANO_ALT_F
|
||||
@@ -414,8 +437,8 @@ know what you're doing */
|
||||
#define NOVIEW 0
|
||||
|
||||
typedef enum {
|
||||
CENTER, TOP, NONE
|
||||
} topmidbotnone;
|
||||
TOP, CENTER, NONE
|
||||
} topmidnone;
|
||||
|
||||
/* Minimum editor window rows required for nano to work correctly */
|
||||
#define MIN_EDITOR_ROWS 3
|
||||
@@ -29,7 +29,9 @@
|
||||
|
||||
#include "nano.h"
|
||||
|
||||
#ifndef DISABLE_WRAPJUSTIFY
|
||||
extern int wrap_at;
|
||||
#endif
|
||||
extern int editwinrows;
|
||||
extern int current_x, current_y, totlines;
|
||||
extern int placewewant;
|
||||
@@ -38,7 +40,8 @@ extern int mark_beginx;
|
||||
#endif
|
||||
extern long totsize;
|
||||
extern int temp_opt;
|
||||
extern int wrap_at, flags, tabsize;
|
||||
extern int flags;
|
||||
extern int tabsize;
|
||||
extern int search_last_line;
|
||||
extern int search_offscreen;
|
||||
extern int currslen;
|
||||
@@ -101,7 +104,7 @@ extern shortcut *spell_list;
|
||||
extern shortcut *browser_list, *gotodir_list;
|
||||
#endif
|
||||
|
||||
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_HELP) || (!defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION))
|
||||
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_HELP) || !defined(DISABLE_MOUSE)
|
||||
extern const shortcut *currshortcut;
|
||||
#endif
|
||||
|
||||
@@ -221,7 +224,6 @@ void thanks_for_all_the_fish(void);
|
||||
/* Public functions in move.c */
|
||||
int do_home(void);
|
||||
int do_end(void);
|
||||
void page_up(void);
|
||||
int do_page_up(void);
|
||||
int do_page_down(void);
|
||||
int do_up(void);
|
||||
@@ -237,7 +239,7 @@ void die_too_small(void);
|
||||
void print_view_warning(void);
|
||||
void global_init(int save_cutbuffer);
|
||||
void window_init(void);
|
||||
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
|
||||
#ifndef DISABLE_MOUSE
|
||||
void mouse_init(void);
|
||||
#endif
|
||||
#ifndef DISABLE_HELP
|
||||
@@ -266,20 +268,20 @@ RETSIGTYPE cancel_fork(int signal);
|
||||
int open_pipe(const char *command);
|
||||
#endif
|
||||
#ifndef DISABLE_MOUSE
|
||||
#ifdef NCURSES_MOUSE_VERSION
|
||||
void do_mouse(void);
|
||||
#endif
|
||||
#endif
|
||||
void do_char(char ch);
|
||||
int do_backspace(void);
|
||||
int do_delete(void);
|
||||
int do_tab(void);
|
||||
int do_enter(void);
|
||||
#ifndef NANO_SMALL
|
||||
int do_next_word(void);
|
||||
int do_prev_word(void);
|
||||
#endif
|
||||
int do_mark(void);
|
||||
void wrap_reset(void);
|
||||
#ifndef DISABLE_WRAPPING
|
||||
void wrap_reset(void);
|
||||
int do_wrap(filestruct *inptr);
|
||||
#endif
|
||||
#ifndef DISABLE_SPELLER
|
||||
@@ -311,8 +313,13 @@ filestruct *backup_lines(filestruct *first_line, size_t par_len,
|
||||
size_t quote_len);
|
||||
int breakable(const char *line, int goal);
|
||||
int break_line(const char *line, int goal, int force);
|
||||
int do_para_operation(int operation);
|
||||
#endif /* !DISABLE_JUSTIFY */
|
||||
int do_justify(void);
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
int do_para_begin(void);
|
||||
int do_para_end(void);
|
||||
#endif
|
||||
int do_exit(void);
|
||||
void signal_init(void);
|
||||
RETSIGTYPE handle_hupterm(int signal);
|
||||
@@ -325,7 +332,6 @@ void print_numlock_warning(void);
|
||||
#ifndef NANO_SMALL
|
||||
void do_toggle(const toggle *which);
|
||||
#endif
|
||||
int abcd(int input);
|
||||
|
||||
/* Public functions in rcfile.c */
|
||||
#ifdef ENABLE_NANORC
|
||||
@@ -358,6 +364,7 @@ filestruct *findnextstr(int quiet, int bracket_mode,
|
||||
const filestruct *begin, int beginx,
|
||||
const char *needle);
|
||||
int do_search(void);
|
||||
int do_research(void);
|
||||
void replace_abort(void);
|
||||
#ifdef HAVE_REGEX_H
|
||||
int replace_regexp(char *string, int create_flag);
|
||||
@@ -419,16 +426,28 @@ void *nmalloc(size_t howmuch);
|
||||
void *nrealloc(void *ptr, size_t howmuch);
|
||||
char *mallocstrcpy(char *dest, const char *src);
|
||||
void new_magicline(void);
|
||||
#ifndef NANO_SMALL
|
||||
void mark_order(const filestruct **top, size_t *top_x,
|
||||
const filestruct **bot, size_t *bot_x);
|
||||
#endif
|
||||
#ifndef DISABLE_TABCOMP
|
||||
int check_wildcard_match(const char *text, const char *pattern);
|
||||
#endif
|
||||
|
||||
/* Public functions in winio.c */
|
||||
int get_kbinput(WINDOW *win, int *meta, int rebind_delete);
|
||||
char *get_verbatim_kbinput(WINDOW *win, int *kbinput_len);
|
||||
int get_ignored_kbinput(WINDOW *win);
|
||||
int get_accepted_kbinput(WINDOW *win, int kbinput, int *meta,
|
||||
int rebind_delete);
|
||||
int get_ascii_kbinput(WINDOW *win, int kbinput);
|
||||
int get_escape_seq_kbinput(WINDOW *win, int kbinput);
|
||||
int get_skip_tilde_kbinput(WINDOW *win, int errval, int retval);
|
||||
int do_first_line(void);
|
||||
int do_last_line(void);
|
||||
int xpt(const filestruct *fileptr, int index);
|
||||
size_t xplustabs(void);
|
||||
size_t actual_x(const filestruct *fileptr, size_t xplus);
|
||||
size_t actual_x(const char *str, size_t xplus);
|
||||
size_t strnlenpt(const char *buf, size_t size);
|
||||
size_t strlenpt(const char *buf);
|
||||
void blank_bottombars(void);
|
||||
@@ -437,7 +456,8 @@ void blank_edit(void);
|
||||
void blank_statusbar(void);
|
||||
void blank_statusbar_refresh(void);
|
||||
void check_statblank(void);
|
||||
void nanoget_repaint(const char *buf, const char *inputbuf, int x);
|
||||
char *display_string(const char *buf, size_t start_col, int len);
|
||||
void nanoget_repaint(const char *buf, const char *inputbuf, size_t x);
|
||||
int nanogetstr(int allowtabs, const char *buf, const char *def,
|
||||
#ifndef NANO_SMALL
|
||||
historyheadtype *history_list,
|
||||
@@ -454,21 +474,18 @@ void onekey(const char *keystroke, const char *desc, int len);
|
||||
#ifndef NDEBUG
|
||||
int check_linenumbers(const filestruct *fileptr);
|
||||
#endif
|
||||
int get_page_start(int column);
|
||||
size_t get_page_start(size_t column);
|
||||
void reset_cursor(void);
|
||||
void add_marked_sameline(int begin, int end, filestruct *fileptr, int y,
|
||||
int virt_cur_x, int this_page);
|
||||
void edit_add(const filestruct *fileptr, int yval, int start
|
||||
#ifndef NANO_SMALL
|
||||
, int virt_mark_beginx, int virt_cur_x
|
||||
#endif
|
||||
);
|
||||
void update_line(filestruct *fileptr, int index);
|
||||
void edit_add(const filestruct *fileptr, const char *converted,
|
||||
int yval, size_t start);
|
||||
void update_line(const filestruct *fileptr, size_t index);
|
||||
void update_cursor(void);
|
||||
void center_cursor(void);
|
||||
void edit_refresh(void);
|
||||
void edit_refresh_clearok(void);
|
||||
void edit_update(filestruct *fileptr, topmidbotnone location);
|
||||
void edit_update(filestruct *fileptr, topmidnone location);
|
||||
int statusq(int tabs, const shortcut *s, const char *def,
|
||||
#ifndef NANO_SMALL
|
||||
historyheadtype *history_list,
|
||||
@@ -482,7 +499,6 @@ int do_cursorpos(int constant);
|
||||
int do_cursorpos_void(void);
|
||||
int line_len(const char *ptr);
|
||||
int do_help(void);
|
||||
int keypad_on(WINDOW *win, int newval);
|
||||
void do_replace_highlight(int highlight_flag, const char *word);
|
||||
void fix_editbot(void);
|
||||
#ifdef DEBUG
|
||||
@@ -49,8 +49,10 @@ const static rcoption rcopts[] = {
|
||||
#ifndef DISABLE_WRAPJUSTIFY
|
||||
{"fill", 0},
|
||||
#endif
|
||||
{"keypad", ALT_KEYPAD},
|
||||
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
|
||||
#ifndef NANO_SMALL
|
||||
{"historylog", HISTORYLOG},
|
||||
#endif
|
||||
#ifndef DISABLE_MOUSE
|
||||
{"mouse", USE_MOUSE},
|
||||
#endif
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
@@ -68,6 +70,7 @@ const static rcoption rcopts[] = {
|
||||
{"operatingdir", 0},
|
||||
#endif
|
||||
{"preserve", PRESERVE},
|
||||
{"rebinddelete", REBIND_DELETE},
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
{"quotestr", 0},
|
||||
#endif
|
||||
@@ -84,7 +87,6 @@ const static rcoption rcopts[] = {
|
||||
{"tabsize", 0},
|
||||
{"tempfile", TEMP_OPT},
|
||||
{"view", VIEW_MODE},
|
||||
{"historylog", HISTORYLOG},
|
||||
{NULL, 0}
|
||||
};
|
||||
|
||||
@@ -170,7 +172,7 @@ char *parse_argument(char *ptr)
|
||||
ptr = NULL;
|
||||
else
|
||||
*ptr++ = '\0';
|
||||
rcfile_error(_("argument %s has unterminated \""), ptr_bak);
|
||||
rcfile_error(_("Argument %s has unterminated \""), ptr_bak);
|
||||
} else {
|
||||
*last_quote = '\0';
|
||||
ptr = last_quote + 1;
|
||||
@@ -212,11 +214,11 @@ int colortoint(const char *colorname, int *bright)
|
||||
else if (!strcasecmp(colorname, "black"))
|
||||
mcolor = COLOR_BLACK;
|
||||
else {
|
||||
rcfile_error(_("color %s not understood.\n"
|
||||
"Valid colors are \"green\", \"red\", \"blue\", \n"
|
||||
"\"white\", \"yellow\", \"cyan\", \"magenta\" and \n"
|
||||
"\"black\", with the optional prefix \"bright\".\n"),
|
||||
colorname);
|
||||
rcfile_error(_("Color %s not understood.\n"
|
||||
"Valid colors are \"green\", \"red\", \"blue\", \n"
|
||||
"\"white\", \"yellow\", \"cyan\", \"magenta\" and \n"
|
||||
"\"black\", with the optional prefix \"bright\" \n"
|
||||
"for foreground colors.\n"), colorname);
|
||||
mcolor = -1;
|
||||
}
|
||||
return mcolor;
|
||||
@@ -271,7 +273,7 @@ void parse_syntax(char *ptr)
|
||||
return;
|
||||
|
||||
if (*ptr != '"') {
|
||||
rcfile_error(_("regex strings must begin and end with a \" character\n"));
|
||||
rcfile_error(_("Regex strings must begin and end with a \" character\n"));
|
||||
return;
|
||||
}
|
||||
ptr++;
|
||||
@@ -354,8 +356,14 @@ void parse_colors(char *ptr)
|
||||
}
|
||||
|
||||
if (strstr(fgstr, ",")) {
|
||||
char *bgcolorname;
|
||||
strtok(fgstr, ",");
|
||||
bg = colortoint(strtok(NULL, ","), &bright);
|
||||
bgcolorname = strtok(NULL, ",");
|
||||
if (!strncasecmp(bgcolorname, "bright", 6)) {
|
||||
rcfile_error(_("Background color %s cannot be bright"), bgcolorname);
|
||||
return;
|
||||
}
|
||||
bg = colortoint(bgcolorname, &bright);
|
||||
} else
|
||||
bg = -1;
|
||||
|
||||
@@ -395,7 +403,7 @@ void parse_colors(char *ptr)
|
||||
}
|
||||
|
||||
if (*ptr != '"') {
|
||||
rcfile_error(_("regex strings must begin and end with a \" character\n"));
|
||||
rcfile_error(_("Regex strings must begin and end with a \" character\n"));
|
||||
ptr = parse_next_regex(ptr);
|
||||
continue;
|
||||
}
|
||||
@@ -442,7 +450,7 @@ void parse_colors(char *ptr)
|
||||
|
||||
if (*ptr != '"') {
|
||||
rcfile_error(_
|
||||
("regex strings must begin and end with a \" character\n"));
|
||||
("Regex strings must begin and end with a \" character\n"));
|
||||
continue;
|
||||
}
|
||||
ptr++;
|
||||
@@ -506,7 +514,7 @@ void parse_rcfile(FILE *rcstream)
|
||||
parse_colors(ptr);
|
||||
#endif /* ENABLE_COLOR */
|
||||
else {
|
||||
rcfile_msg(_("command %s not understood"), keyword);
|
||||
rcfile_msg(_("Command %s not understood"), keyword);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -538,7 +546,7 @@ void parse_rcfile(FILE *rcstream)
|
||||
) {
|
||||
if (*ptr == '\n' || *ptr == '\0') {
|
||||
rcfile_error(_
|
||||
("option %s requires an argument"),
|
||||
("Option %s requires an argument"),
|
||||
rcopts[i].name);
|
||||
continue;
|
||||
}
|
||||
@@ -563,7 +571,7 @@ void parse_rcfile(FILE *rcstream)
|
||||
* errors. */
|
||||
j = (int)strtol(option, &first_error, 10);
|
||||
if (errno == ERANGE || *option == '\0' || *first_error != '\0')
|
||||
rcfile_error(_("requested fill size %d invalid"),
|
||||
rcfile_error(_("Requested fill size %d invalid"),
|
||||
j);
|
||||
else
|
||||
wrap_at = j;
|
||||
@@ -587,7 +595,7 @@ void parse_rcfile(FILE *rcstream)
|
||||
* errors. */
|
||||
j = (int)strtol(option, &first_error, 10);
|
||||
if (errno == ERANGE || *option == '\0' || *first_error != '\0')
|
||||
rcfile_error(_("requested tab size %d invalid"),
|
||||
rcfile_error(_("Requested tab size %d invalid"),
|
||||
j);
|
||||
else
|
||||
tabsize = j;
|
||||
@@ -107,18 +107,22 @@ int search_init(int replacing)
|
||||
|
||||
search_init_globals();
|
||||
|
||||
/* If we don't already have a backupstring, set it. */
|
||||
if (backupstring == NULL)
|
||||
backupstring = mallocstrcpy(backupstring, "");
|
||||
backupstring = mallocstrcpy(NULL, "");
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
search_history.current = (historytype *)&search_history.next;
|
||||
#endif
|
||||
|
||||
if (last_search[0] != '\0') {
|
||||
char *disp = display_string(last_search, 0, COLS / 3);
|
||||
|
||||
buf = charalloc(COLS / 3 + 7);
|
||||
/* We use COLS / 3 here because we need to see more on the line */
|
||||
sprintf(buf, " [%.*s%s]", COLS / 3, last_search,
|
||||
strlen(last_search) > COLS / 3 ? "..." : "");
|
||||
sprintf(buf, " [%s%s]", disp,
|
||||
strlenpt(last_search) > COLS / 3 ? "..." : "");
|
||||
free(disp);
|
||||
} else {
|
||||
buf = charalloc(1);
|
||||
buf[0] = '\0';
|
||||
@@ -132,17 +136,23 @@ int search_init(int replacing)
|
||||
"%s%s%s%s%s%s",
|
||||
_("Search"),
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* This string is just a modifier for the search prompt,
|
||||
no grammar is implied */
|
||||
ISSET(CASE_SENSITIVE) ? _(" [Case Sensitive]") : "",
|
||||
ISSET(CASE_SENSITIVE) ? _(" [Case Sensitive]") :
|
||||
#endif
|
||||
"",
|
||||
|
||||
/* This string is just a modifier for the search prompt,
|
||||
no grammar is implied */
|
||||
ISSET(USE_REGEXP) ? _(" [Regexp]") : "",
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* This string is just a modifier for the search prompt,
|
||||
no grammar is implied */
|
||||
ISSET(REVERSE_SEARCH) ? _(" [Backwards]") : "",
|
||||
ISSET(REVERSE_SEARCH) ? _(" [Backwards]") :
|
||||
#endif
|
||||
"",
|
||||
|
||||
replacing ? _(" (to replace)") : "",
|
||||
buf);
|
||||
@@ -150,12 +160,13 @@ int search_init(int replacing)
|
||||
/* Release buf now that we don't need it anymore */
|
||||
free(buf);
|
||||
|
||||
free(backupstring);
|
||||
backupstring = NULL;
|
||||
|
||||
/* Cancel any search, or just return with no previous search */
|
||||
if (i == -1 || (i < 0 && last_search[0] == '\0')) {
|
||||
statusbar(_("Search Cancelled"));
|
||||
reset_cursor();
|
||||
free(backupstring);
|
||||
backupstring = NULL;
|
||||
#ifndef NANO_SMALL
|
||||
search_history.current = search_history.next;
|
||||
#endif
|
||||
@@ -169,29 +180,23 @@ int search_init(int replacing)
|
||||
if (regexp_init(last_search) == 0) {
|
||||
statusbar(regex_error, last_search);
|
||||
reset_cursor();
|
||||
free(backupstring);
|
||||
backupstring = NULL;
|
||||
return -3;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case 0: /* They entered something new */
|
||||
last_replace[0] = '\0';
|
||||
#ifdef HAVE_REGEX_H
|
||||
if (ISSET(USE_REGEXP))
|
||||
if (regexp_init(answer) == 0) {
|
||||
statusbar(regex_error, answer);
|
||||
reset_cursor();
|
||||
free(backupstring);
|
||||
backupstring = NULL;
|
||||
#ifndef NANO_SMALL
|
||||
search_history.current = search_history.next;
|
||||
#endif
|
||||
return -3;
|
||||
}
|
||||
#endif
|
||||
free(backupstring);
|
||||
backupstring = NULL;
|
||||
last_replace[0] = '\0';
|
||||
break;
|
||||
#ifndef NANO_SMALL
|
||||
case TOGGLE_CASE_KEY:
|
||||
@@ -213,8 +218,6 @@ int search_init(int replacing)
|
||||
backupstring = mallocstrcpy(backupstring, answer);
|
||||
return -2; /* Call the opposite search function */
|
||||
case NANO_FROMSEARCHTOGOTO_KEY:
|
||||
free(backupstring);
|
||||
backupstring = NULL;
|
||||
#ifndef NANO_SMALL
|
||||
search_history.current = search_history.next;
|
||||
#endif
|
||||
@@ -226,8 +229,6 @@ int search_init(int replacing)
|
||||
return -3;
|
||||
default:
|
||||
do_early_abort();
|
||||
free(backupstring);
|
||||
backupstring = NULL;
|
||||
return -3;
|
||||
}
|
||||
}
|
||||
@@ -385,7 +386,9 @@ int do_search(void)
|
||||
filestruct *fileptr = current, *didfind;
|
||||
int fileptr_x = current_x;
|
||||
|
||||
#ifndef DISABLE_WRAPPING
|
||||
wrap_reset();
|
||||
#endif
|
||||
i = search_init(0);
|
||||
switch (i) {
|
||||
case -1:
|
||||
@@ -430,6 +433,48 @@ int do_search(void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Search for the next string without prompting. */
|
||||
int do_research(void)
|
||||
{
|
||||
filestruct *fileptr = current, *didfind;
|
||||
int fileptr_x = current_x;
|
||||
#ifdef HAVE_REGEX_H
|
||||
const char *regex_error = _("Invalid regex \"%s\"");
|
||||
#endif /* HAVE_REGEX_H */
|
||||
|
||||
#ifndef DISABLE_WRAPPING
|
||||
wrap_reset();
|
||||
#endif
|
||||
search_init_globals();
|
||||
|
||||
if (last_search[0] != '\0') {
|
||||
|
||||
#ifdef HAVE_REGEX_H
|
||||
if (ISSET(USE_REGEXP))
|
||||
if (regexp_init(last_search) == 0) {
|
||||
statusbar(regex_error, last_search);
|
||||
reset_cursor();
|
||||
return -3;
|
||||
}
|
||||
#endif
|
||||
|
||||
search_last_line = 0;
|
||||
didfind = findnextstr(FALSE, FALSE, current, current_x, last_search);
|
||||
|
||||
if (fileptr == current && fileptr_x == current_x && didfind != NULL)
|
||||
statusbar(_("This is the only occurrence"));
|
||||
else if (current->lineno <= edittop->lineno
|
||||
|| current->lineno >= editbot->lineno)
|
||||
edit_update(current, CENTER);
|
||||
|
||||
} else
|
||||
statusbar(_("No current search pattern"));
|
||||
|
||||
search_abort();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void replace_abort(void)
|
||||
{
|
||||
/* Identical to search_abort, so we'll call it here. If it
|
||||
@@ -587,6 +632,8 @@ int do_replace_loop(const char *prevanswer, const filestruct *begin,
|
||||
|
||||
last_replace = mallocstrcpy(last_replace, answer);
|
||||
while (1) {
|
||||
size_t match_len;
|
||||
|
||||
/* Sweet optimization by Rocco here */
|
||||
fileptr = findnextstr(fileptr || replaceall || search_last_line,
|
||||
FALSE, begin, *beginx, prevanswer);
|
||||
@@ -607,13 +654,27 @@ int do_replace_loop(const char *prevanswer, const filestruct *begin,
|
||||
if (numreplaced == -1)
|
||||
numreplaced = 0;
|
||||
|
||||
#ifdef HAVE_REGEX_H
|
||||
if (ISSET(USE_REGEXP))
|
||||
match_len = regmatches[0].rm_eo - regmatches[0].rm_so;
|
||||
else
|
||||
#endif
|
||||
match_len = strlen(prevanswer);
|
||||
|
||||
if (!replaceall) {
|
||||
char *exp_word;
|
||||
size_t xpt = xplustabs();
|
||||
|
||||
exp_word = display_string(current->data, xpt,
|
||||
strnlenpt(current->data, match_len + current_x) - xpt);
|
||||
|
||||
curs_set(0);
|
||||
do_replace_highlight(TRUE, prevanswer);
|
||||
do_replace_highlight(TRUE, exp_word);
|
||||
|
||||
*i = do_yesno(1, 1, _("Replace this instance?"));
|
||||
|
||||
do_replace_highlight(FALSE, prevanswer);
|
||||
do_replace_highlight(FALSE, exp_word);
|
||||
free(exp_word);
|
||||
curs_set(1);
|
||||
}
|
||||
|
||||
@@ -302,6 +302,28 @@ void new_magicline(void)
|
||||
totsize++;
|
||||
}
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* Set top_x and bot_x to the top and bottom x-coordinates of the mark,
|
||||
* respectively, based on the locations of top and bot. */
|
||||
void mark_order(const filestruct **top, size_t *top_x,
|
||||
const filestruct **bot, size_t *bot_x)
|
||||
{
|
||||
assert(top != NULL && top_x != NULL && bot != NULL && bot_x != NULL);
|
||||
if ((current->lineno == mark_beginbuf->lineno && current_x > mark_beginx)
|
||||
|| current->lineno > mark_beginbuf->lineno) {
|
||||
*top = mark_beginbuf;
|
||||
*top_x = mark_beginx;
|
||||
*bot = current;
|
||||
*bot_x = current_x;
|
||||
} else {
|
||||
*bot = mark_beginbuf;
|
||||
*bot_x = mark_beginx;
|
||||
*top = current;
|
||||
*top_x = current_x;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_TABCOMP
|
||||
/*
|
||||
* Routine to see if a text string is matched by a wildcard pattern.
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user