Compare commits

...

337 Commits

Author SHA1 Message Date
David Lawrence Ramsey
665b1fbac6 GNU nano 1.3.8
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2803 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-30 17:16:16 +00:00
David Lawrence Ramsey
5cbe08fc03 remove unneeded clearok(TRUE) from total_redraw()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2802 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-30 16:18:35 +00:00
David Lawrence Ramsey
73bf89fa56 make do_yesno() refresh the edit window as well as the statusbar before
getting input, as statusq() does


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2801 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-30 05:56:39 +00:00
David Lawrence Ramsey
a73025d731 in do_replace_highlight(), call wnoutrefresh(edit) to make sure that the
highlight is drawn properly


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2800 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-30 04:17:18 +00:00
David Lawrence Ramsey
7bde05399f in do_replace_highlight(), rename variable highlight_flag to highlight,
for consistency


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2799 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-30 03:55:55 +00:00
David Lawrence Ramsey
6168cb7391 cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2798 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-30 03:53:28 +00:00
David Lawrence Ramsey
44e0c03fff in do_yesno(), het input from bottomwin instead of edit, so that the
cursor isn't erroneously put in the edit window while we wait for an
answer


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2797 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-29 19:01:11 +00:00
David Lawrence Ramsey
1aee5cc599 more int -> bool conversions
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2796 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-29 18:17:54 +00:00
David Lawrence Ramsey
85c0b3c37e improve version()'s output
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2795 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-29 17:10:58 +00:00
David Lawrence Ramsey
69163af499 in POTFILES.in, remove source files that contain no translatable strings
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2794 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-29 02:19:02 +00:00
David Lawrence Ramsey
f816119b36 in find_paragraph(), reset placewewant as well as current_x to 0, in
order to avoid a potential screen update problem


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2793 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-29 01:27:33 +00:00
David Lawrence Ramsey
5beae58597 add one missing type change
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2792 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-29 00:17:18 +00:00
David Lawrence Ramsey
4e05b755ed in do_cursorpos(), if constant is TRUE, only display the cursor position
when disable_cursorpos is FALSE; don't refuse to display it when the
cursor position hasn't changed, as that doesn't always keep it properly
updated


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2791 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-28 20:04:14 +00:00
David Lawrence Ramsey
a96c819b50 more comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2790 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-28 19:56:14 +00:00
David Lawrence Ramsey
5593e20964 more comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2789 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-28 19:49:15 +00:00
David Lawrence Ramsey
651853aa21 add missing blank line
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2788 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-28 18:57:28 +00:00
David Lawrence Ramsey
9e21c62c68 formatting fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2787 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-28 17:51:28 +00:00
David Lawrence Ramsey
43d3e9324b comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2786 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-28 17:35:20 +00:00
David Lawrence Ramsey
b2072b0999 cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2785 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-28 14:59:38 +00:00
David Lawrence Ramsey
9905b6ae74 rework the credits handling to display Florian König's name properly
whether we're in a UTF-8 locale or not.  This requires a minor hack, but
it's better than requiring a massive function that we only use once


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2784 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-28 07:26:11 +00:00
David Lawrence Ramsey
3b2fdb00e4 add missing blank line
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2783 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-28 07:16:13 +00:00
David Lawrence Ramsey
2cf6d717f1 add various type changes to avoid problems on systems where int and
ssize_t are different sizes.  Make filestruct->lineno a ssize_t (so that
we can avoid negative line numbers at the "Go To Line" prompt),
current_y a ssize_t (in order to hold the maximum difference between two
filestruct->lineno's), totlines a size_t, and change related variables
to match


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2782 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-28 06:25:34 +00:00
David Lawrence Ramsey
6ad6b85862 more miscellaneous minor fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2781 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-28 06:16:30 +00:00
David Lawrence Ramsey
18d6a7ae1a in do_justify(), save placewewant, and restore it if we unjustify, in
order to avoid a potential screen update problem


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2780 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-28 06:05:54 +00:00
David Lawrence Ramsey
5423680d67 in edit_redraw(), make do_refresh a bool instead of an int
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2779 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-28 05:56:16 +00:00
David Lawrence Ramsey
7f7c66c237 remove now-unused search_last_line global
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2778 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-28 05:27:20 +00:00
David Lawrence Ramsey
b8351c1c8b per Mike Frysinger's suggestion, in the "nanorc" regexes, put "^" back
in the comment regex so that we don't match strings containing #'s
anymore


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2777 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-27 12:25:17 +00:00
David Lawrence Ramsey
27ae93d26b clarify and consolidate the descriptions of the "fill" and "tabsize"
options in the documentation (e.g. "fill 0" acts just like "fill
[negative number]")


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2776 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-27 05:01:32 +00:00
David Lawrence Ramsey
95a2db7a4a add missing "?" to the color name regex of the "nanorc" regexes, so that
regexes like "color ,green" won't be colored as though they're invalid


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2775 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-27 03:47:52 +00:00
David Lawrence Ramsey
23555f29ba add support for case insensitive expression matching when using color
syntax highlighting, via the "icolor" directive, and add it to those
regexes that can use it (ported from Brand Huntsman's old patch)


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2774 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-27 03:07:10 +00:00
David Lawrence Ramsey
a899ab185f simplify the file extension regex for groff
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2773 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-27 03:04:49 +00:00
David Lawrence Ramsey
c5632a7e40 add Mike Frysinger's GCC builtins regex to the "c-file" regexes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2772 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-27 02:56:59 +00:00
David Lawrence Ramsey
9c351e8831 punctuation fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2771 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-26 23:35:55 +00:00
David Lawrence Ramsey
23d3b7457b do the same thing for the equivalent regex for assembler files
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2770 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-26 23:16:14 +00:00
David Lawrence Ramsey
85f6a2daab more last-minute comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2769 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-26 22:59:54 +00:00
David Lawrence Ramsey
6ea410e14e add missing int -> bool conversion
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2768 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-26 22:32:51 +00:00
David Lawrence Ramsey
d4471ebe0e in do_toggle(), properly treat color syntax highlighting as enabled by
default, and only treat wrapping as enabled by default when
DISABLE_WRAPPING isn't defined


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2767 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-26 20:05:01 +00:00
David Lawrence Ramsey
7f77e1dcdd apparently a "[[:space:]]" doesn't work properly inside a "[^ ... ]";
replace it with a literal space and a literal tab, so that include files
are properly colored again


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2766 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-26 19:49:53 +00:00
David Lawrence Ramsey
a8824a197e per Mike Frysinger's suggestion, change the word detection functions'
behavior back to what it was before (for now, until there's a way for
the user to control it), as their new behavior makes them harder to use
when editing source code; by the same token, leave word count's behavior
the way it is, since it's generally not used when editing source code


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2765 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-26 19:03:48 +00:00
David Lawrence Ramsey
059ba19ff7 add Mike Frysinger's regexes for assembler files
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2764 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-26 03:32:03 +00:00
David Lawrence Ramsey
bec2606ce2 in nanorc.sample, banish " " whever possible in favor of "[[:space:]]"
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2763 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-26 03:26:24 +00:00
David Lawrence Ramsey
9d658cec7a add "cxx" and "hxx" to the list of extensions that the "c-file" regexes
apply to, and add "warning" and "error" to them as well


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2762 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-26 02:55:04 +00:00
David Lawrence Ramsey
fe7d53e51e last-minute comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2761 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-25 20:56:36 +00:00
David Lawrence Ramsey
5e50e2f51e in disable_flow_control() and enable_flow_control(), only turn off flow
control on input, as it might be needed for output on slow terminals


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2760 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-23 22:28:56 +00:00
David Lawrence Ramsey
b2ca88cc74 more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2759 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-22 02:31:12 +00:00
David Lawrence Ramsey
7a3f49c019 remove all instances of charcpy() and replace them with strncpy(), for
ease of maintenance


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2758 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-22 00:24:11 +00:00
David Lawrence Ramsey
bebfc6da0f put back erroneously removed bits
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2757 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-21 22:48:38 +00:00
David Lawrence Ramsey
0517c482e4 typo fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2756 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-21 22:37:47 +00:00
David Lawrence Ramsey
16799baccd change some instances of charcpy() back to strncpy(), as the latter's
numm-termination is needed in some places


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2755 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-21 22:32:50 +00:00
David Lawrence Ramsey
d4ea5b69c5 oops; do_yesno() doesn't need display_string(); it only needs to use
actual_x() to get the actual number of characters in buf when it calls
mvwaddnstr()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2754 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-21 21:03:06 +00:00
David Lawrence Ramsey
8d5beb560c in titlebar(), handle VERLEN's being a UTF-8 string
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2753 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-21 20:37:04 +00:00
David Lawrence Ramsey
ba61cc382f fix total_redraw() so that it always keeps the cursor in the same window
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2752 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-21 20:16:26 +00:00
David Lawrence Ramsey
3f301dd437 in do_yesno(), add a missing assert, and use display_string() to display
the prompt, so that we don't end it in the middle of a multibyte
character if it's more than (COLS - 1) bytes long


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2751 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-21 19:47:39 +00:00
David Lawrence Ramsey
c3e52f16ba per Jordi's suggestion, change the toggle for -E/--tabstospaces to
Meta-Q


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2750 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-21 17:44:01 +00:00
David Lawrence Ramsey
b725353ab7 per Jordi's suggestion, remove the Meta-U toggle for -U/--quickblank;
the rcfile option is enough for those that use it regularly


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2749 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-21 16:19:47 +00:00
David Lawrence Ramsey
99466bfa71 more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2748 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-21 15:47:39 +00:00
David Lawrence Ramsey
261da14301 revert last change, since it'll cause problems with arguments containing
spaces


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2747 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-21 15:41:46 +00:00
David Lawrence Ramsey
6dd67790df in configure.ac, add a few more minor consistency fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2746 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-21 15:32:12 +00:00
David Lawrence Ramsey
01e13ea1c1 comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2745 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-21 04:16:12 +00:00
David Lawrence Ramsey
68c10963c4 revert last change, as the multibyte strcoll() functions can't handle
e.g. 2-to-1 character conversions as the original strcoll() can


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2744 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-21 04:11:04 +00:00
David Lawrence Ramsey
d0c4d378b4 add a multibyte case-insensitive version of strcoll(), and make
diralphasort() use it so that filenames are sorted properly according to
the current locale


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2743 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-21 03:26:58 +00:00
David Lawrence Ramsey
6c25819c34 cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2742 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-21 01:41:46 +00:00
David Lawrence Ramsey
bd11c0171b recover properly when the alternate spell checker fails
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2741 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-21 01:33:31 +00:00
David Lawrence Ramsey
739fc8ac3d make sure the function checks are *really* in alphabetical order
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2740 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-20 23:10:24 +00:00
David Lawrence Ramsey
8d0fb01ff2 comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2739 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-20 21:17:01 +00:00
David Lawrence Ramsey
d7cf373358 typo fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2738 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-20 21:03:57 +00:00
David Lawrence Ramsey
e0a0d23f78 remove unnecessary variables from and add missing asserts to
control_mbrep()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2737 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-20 20:58:41 +00:00
David Lawrence Ramsey
da419bcbe4 typo fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2736 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-20 03:01:04 +00:00
David Lawrence Ramsey
b2bff724da update the "Feature Toggles" section in nano.texi to match current nano
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2735 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-19 22:22:01 +00:00
David Lawrence Ramsey
a62e8e3de9 when reading color syntax names or sorting filenames, use mbstrcasecmp()
instead of strcasecmp() to compare them, in case they're UTF-8


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2734 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-19 21:10:48 +00:00
David Lawrence Ramsey
483f3ac1b5 in read_line(), rename variable len to buf_len, for consistency
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2733 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-19 19:57:13 +00:00
David Lawrence Ramsey
90d505cc4a comment and indentation fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2732 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-18 22:33:55 +00:00
David Lawrence Ramsey
9c6d78669e remove the reset_cursor() call in statusq(), as it erroneously leaves
the cursor in the edit window when we're at the "Save File Under
Different Name" prompt


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2731 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-18 22:33:24 +00:00
David Lawrence Ramsey
5290e1bc84 comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2730 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-18 20:47:41 +00:00
David Lawrence Ramsey
b5aaf72b6a in configure.ac, check for possibly unavailable functions in
alphabetical order


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2729 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-18 20:08:43 +00:00
David Lawrence Ramsey
1ea53709d8 formatting fixes for Makefile.am and m4/Makefile.am
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2728 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-18 19:56:30 +00:00
David Lawrence Ramsey
0227ccca7c formatting fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2727 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-18 17:20:54 +00:00
David Lawrence Ramsey
25799f6862 in configure.ac, check for get_wch() instead of wget_wch() to determine
if there's a wide curses library, as it's a more generic function


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2726 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-18 17:06:02 +00:00
David Lawrence Ramsey
c54c4d1eea rename total_update() total_redraw() for consistency
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2725 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-18 15:49:17 +00:00
David Lawrence Ramsey
7431fe5e93 work around slang brain damage in total_update()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2724 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-18 15:15:48 +00:00
David Lawrence Ramsey
166da9c893 fix still more minor display update problems
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2723 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-18 14:30:40 +00:00
David Lawrence Ramsey
cd0210ff3e fix more minor screen update problems
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2722 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-18 14:05:21 +00:00
David Lawrence Ramsey
7098ec233c n is ignored in the mbstowcs() call, so it can be 0 instead of
(size_t)-1


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2721 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-18 05:15:08 +00:00
David Lawrence Ramsey
62898233ac in statusq(), call wrefresh(bottomwin) after getting an answer and
blanking out the statusbar, to make sure that the blanking is done; this
fixes a problem where the statusbar is not properly blanked after using
the "Go To Line" prompt with the NO_HELP flag set


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2720 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-18 04:32:26 +00:00
David Lawrence Ramsey
26e637bf12 in toggle_init(), reorder the toggles to put more toggles with similar
functions together


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2719 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-18 03:37:56 +00:00
David Lawrence Ramsey
d873447f5f clarify the description of the line wrapping toggle
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2718 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-18 03:03:32 +00:00
David Lawrence Ramsey
84635cd8e8 change the short option for --restricted from -Z to -R
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2717 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-17 22:53:41 +00:00
David Lawrence Ramsey
03987abebd fix misplaced long option
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2716 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-17 22:50:55 +00:00
David Lawrence Ramsey
c661853315 add comment
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2715 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-17 22:33:15 +00:00
David Lawrence Ramsey
4f673d802c add a description of -U/--quickblank to nano.texi, plus a few more
miscellaneous documentation fixes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2714 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-17 22:11:43 +00:00
David Lawrence Ramsey
bf51aa4c0a QUICK_BLANK and CONST_UPDATE shouldn't be working at the same time, as
they make the statusbar blank and redraw itself far too many times, and
it makes no sense to use them together anyway; also, clean up
check_statusblank() a little


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2713 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-17 21:52:59 +00:00
David Lawrence Ramsey
954aba7430 formatting fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2712 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-17 21:21:10 +00:00
David Lawrence Ramsey
3435a0ff64 rename the CONSTUPDATE flag to CONST_UPDATE, and clarify its description
in the help text


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2711 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-17 21:08:13 +00:00
David Lawrence Ramsey
66357b5462 add missing #ifdef
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2710 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-17 19:09:18 +00:00
David Lawrence Ramsey
e29111f7ec add -U/--quickblank option, a Meta-U toggle, and a "quickblank" rcfile
option to blank the statusbar after 1 keystroke instead of 25; note that
this is disabled when NANO_SMALL is defined


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2709 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-17 19:06:25 +00:00
David Lawrence Ramsey
6399000a48 move all the rcfile options disabled by NANO_SMALL to the end, for
consistency with the long options in nano.c


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2708 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-17 19:01:00 +00:00
David Lawrence Ramsey
ea01474c4b since the DISABLE_CURPOS flag is only used in winio.c, reduce it to a
static bool there


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2707 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-17 18:27:00 +00:00
David Lawrence Ramsey
077d0647c9 in statusbar(), set statusblank to 25 instead of 26, to match current
Pico


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2706 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-17 18:14:03 +00:00
David Lawrence Ramsey
9b494fa90c more miscellaneous documentation updates
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2705 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-17 18:00:16 +00:00
David Lawrence Ramsey
18a89a6cef more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2704 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-17 17:37:46 +00:00
David Lawrence Ramsey
c4ca596a90 various #ifdef fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2703 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-16 20:58:19 +00:00
David Lawrence Ramsey
5c8197d78f miscellaneous cleanups in do_find_bracket(): rename variables for
consistency, and save the search direction and regexp setting in two
bools instead of one flags variable


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2702 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-16 20:41:20 +00:00
David Lawrence Ramsey
62e117421f add "backwards" and "casesensitive" to the "rcfile" regexes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2701 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-16 18:56:00 +00:00
David Lawrence Ramsey
f3ecffd24d add the "regexp" rcfile option back in at DB's suggestion, the
"casesensitive" and "backwards" rcfile options for consistency,
documentation updates, and related cleanups


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2700 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-16 18:48:30 +00:00
David Lawrence Ramsey
f774017801 document the new Meta-E toggle
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2699 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-16 18:35:55 +00:00
David Lawrence Ramsey
d1cc007136 in usage(), remove inaccurate default listed for -Q/--quotestr
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2698 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-16 17:26:01 +00:00
David Lawrence Ramsey
25fb1025e9 fix assert
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2697 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-16 12:43:08 +00:00
David Lawrence Ramsey
a9a3f4f599 fix compilation with --enable-debug
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2696 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-16 12:17:23 +00:00
David Lawrence Ramsey
e6a55fa1e5 remove stray "]"
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2695 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-16 12:16:24 +00:00
David Lawrence Ramsey
95f7a7431e wording fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2694 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-16 03:11:39 +00:00
David Lawrence Ramsey
fa6c29cc2e in shortcut_init(), clarify the description of ^X when
--enable-multibuffer is used


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2693 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-16 03:07:05 +00:00
David Lawrence Ramsey
b2b6976bd9 change the SMOOTHSCROLL flag to the SMOOTH_SCROLL flag
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2692 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-16 02:13:10 +00:00
David Lawrence Ramsey
7a4aaa53a1 change the NO_UTF8 flag to the USE_UTF8 flag, and reverse its meaning
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2691 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-16 02:09:57 +00:00
David Lawrence Ramsey
77d0feae05 cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2690 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-16 01:56:51 +00:00
David Lawrence Ramsey
c1b960947e comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2689 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-16 01:37:13 +00:00
David Lawrence Ramsey
4846ce7a6a fix memory leak
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2688 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-16 01:36:10 +00:00
David Lawrence Ramsey
34c75746c2 add the "tabstospaces" option to the "rcfile" regexes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2687 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-16 01:25:11 +00:00
David Lawrence Ramsey
3129c2928b move the "tabstospaces" option in nanorc.sample down so the options are
in alphabetical order again


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2686 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-16 01:18:56 +00:00
David Lawrence Ramsey
21374584e2 fix changelog entry
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2685 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-15 23:36:08 +00:00
David Lawrence Ramsey
a2ea733e3b comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2684 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-15 23:35:53 +00:00
David Lawrence Ramsey
40ad177210 revert erroneous help_init() changes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2683 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-15 23:33:54 +00:00
David Lawrence Ramsey
6f143c8124 add the ability to convert (non-verbatim input) typed tabs to spaces
using the -E/--tabstospaces command line options, the "tabstospaces"
rcfile option, and the toggle Meta-E; also, change the short command
line option for --backupdir from -E to -C


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2682 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-15 23:20:56 +00:00
David Lawrence Ramsey
072f86c5f9 in do_spell(), if the spell-checker printed any error messages onscreen,
make sure they're cleared off


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2681 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-15 20:21:02 +00:00
David Lawrence Ramsey
f271f9c962 cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2680 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-15 19:26:48 +00:00
David Lawrence Ramsey
5a6caf0ca8 in do_int_spell_fix(), display highlighted misspelled words using
display_string(), as do_replace_loop() does


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2679 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-15 19:21:04 +00:00
David Lawrence Ramsey
da72453859 add missing blank lines
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2678 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-15 19:15:14 +00:00
David Lawrence Ramsey
203026c632 make --enable-extra only define NANO_EXTRA, and update associated
documentation


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2677 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-15 18:53:47 +00:00
David Lawrence Ramsey
ed7ad33802 change wint_t's back to wchar_t's to fix compilation on Mac OS 10.4.1
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2676 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-15 16:07:14 +00:00
Jordi Mallach
ff6c1997b9 Typo fix by Jens Seidel.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2675 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-15 16:05:42 +00:00
David Lawrence Ramsey
a01690c410 comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2674 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-15 07:38:25 +00:00
David Lawrence Ramsey
ff1a0ea32b cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2673 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-15 07:34:09 +00:00
David Lawrence Ramsey
42e271d2d3 in do_browser(), make mouse clicks in the browser window work properly
when the MORE_SPACE flag is set


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2672 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-15 07:32:58 +00:00
David Lawrence Ramsey
9c06f34ef9 more miscellaneous minor fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2671 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-15 07:18:30 +00:00
David Lawrence Ramsey
ab41ab9246 fix #ifdefs so that nano compiles with NANO_SMALL defined and
DISABLE_TABCOMP undefined


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2670 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-15 06:30:05 +00:00
David Lawrence Ramsey
2515ccc0a0 *more* cleanups to chars.c and related code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2669 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-15 06:04:08 +00:00
David Lawrence Ramsey
d1323e4e35 formatting and comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2668 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-15 03:56:36 +00:00
David Lawrence Ramsey
7ae1a79641 formatting fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2667 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-15 03:15:45 +00:00
David Lawrence Ramsey
e221311f2e don't count punctuation when searching for a whole word in
is_whole_word()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2666 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-15 03:03:45 +00:00
David Lawrence Ramsey
d26f1ebdf1 in open_prevnext_file(), move up a misplaced assert and rename a
variable


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2665 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-15 03:01:41 +00:00
David Lawrence Ramsey
1e64db6629 more miscellaneous fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2664 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-14 23:38:41 +00:00
David Lawrence Ramsey
ce9d299c47 revert the changes to the behavior of Esc Esc [3-digit number from 000
to 255], as it still won't let us type all possible bytes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2663 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-14 23:38:08 +00:00
David Lawrence Ramsey
bdfa927d62 more miscellaneous cleanups
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2662 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-14 23:36:13 +00:00
David Lawrence Ramsey
789867b6a0 comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2661 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-14 04:22:32 +00:00
David Lawrence Ramsey
3a4eb48d5c minor faq updates
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2660 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-14 02:32:37 +00:00
David Lawrence Ramsey
bfc183ba10 more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2659 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-14 02:24:25 +00:00
David Lawrence Ramsey
6209e0eb15 yet *another* cleanup
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2658 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-14 02:08:25 +00:00
David Lawrence Ramsey
e534aae701 comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2657 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-14 02:03:56 +00:00
David Lawrence Ramsey
d5d4dde1eb improve detection of blank characters in the "punct" and "brackets"
rcfile options


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2656 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-14 01:55:56 +00:00
David Lawrence Ramsey
42af2216fe yet another cleanup
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2655 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-13 20:19:03 +00:00
David Lawrence Ramsey
356d2482c5 nisw?blank() should return int, not bool, to match isblank()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2654 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-13 19:51:56 +00:00
David Lawrence Ramsey
399fe939f9 change the behavior of Esc Esc [3-digit number from 000 to 255] so that
it enters the byte with that value regardless of whether we're in UTF-8
mode or not, and update the help text to mention this; this will allow
searching for and replacing raw bytes with their equivalent multibyte
sequences as entered using verbatim input


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2653 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-13 17:26:19 +00:00
David Lawrence Ramsey
40c3cd1aa9 in the "nanorc" regexes in nanorc.sample, tweak the "comment" regex to
color comments that don't start at the beginning of a line


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2652 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-13 16:41:48 +00:00
David Lawrence Ramsey
b300af3f63 simplify is_valid_mbstring() by making it use mbstowcs()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2651 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-13 15:56:29 +00:00
David Lawrence Ramsey
30d0a81656 don't work around invalid multibyte sequences in rcfile options anymore,
but generate errors


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2650 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-13 14:50:32 +00:00
David Lawrence Ramsey
6a0d5b8fec miscellaneous minor fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2649 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-13 14:00:22 +00:00
David Lawrence Ramsey
7b601fdbe1 still more cleanups to chars.c and related code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2648 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-13 13:25:36 +00:00
David Lawrence Ramsey
8b698f4a29 more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2647 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-13 05:16:55 +00:00
David Lawrence Ramsey
9880afc47a remove unneeded blank line
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2646 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-13 05:13:14 +00:00
David Lawrence Ramsey
5ed8819f35 revert the simplification of the display_string() call in
do_replace_loop(), as it breaks display in some ways


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2645 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-13 04:37:28 +00:00
David Lawrence Ramsey
7291daabe3 cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2644 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-13 04:11:20 +00:00
David Lawrence Ramsey
d2edb8a538 when doing history string tab completion, skip over an exact match
unless it's the only match, as the old history code did


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2643 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-13 03:52:33 +00:00
David Lawrence Ramsey
33d07ef055 in do_replace_loop(), simplify the display_string() call that we use to
get the word that we're going to highlight


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2642 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-13 03:19:50 +00:00
David Lawrence Ramsey
f26d386191 simplify the word detection code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2641 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-13 02:48:52 +00:00
David Lawrence Ramsey
67287088dc detect words more accurately by taking punctuation into account, and
convert all word-detecting functions to use the same wrapper function
for ease of maintenance


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2640 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-13 02:40:04 +00:00
David Lawrence Ramsey
d16d0bfb9a document cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2639 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-13 02:24:17 +00:00
David Lawrence Ramsey
5b9f52265a cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2638 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-13 02:22:44 +00:00
David Lawrence Ramsey
a049c8364f in shortcut_init(), allow the mark to be used in view mode, as Pico does
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2637 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-12 23:53:28 +00:00
David Lawrence Ramsey
1a76845aa5 fix changelog entry
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2636 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-12 23:49:05 +00:00
David Lawrence Ramsey
e90f0b8a33 when the mark is on, only do a word count on the marked text
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2635 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-12 23:20:20 +00:00
David Lawrence Ramsey
d232fa2fc3 remove unnecessary screen update
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2634 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-12 22:40:09 +00:00
David Lawrence Ramsey
e010edd1f8 implement word count via Meta-D at the main window
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2633 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-12 22:31:03 +00:00
David Lawrence Ramsey
19462616d4 one last cleanup to chars.c
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2632 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-12 18:05:42 +00:00
David Lawrence Ramsey
d8640480c3 various cleanups to chars.c and related code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2631 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-12 17:48:46 +00:00
David Lawrence Ramsey
6315e2ff39 in do_tab(), remove unneeded variable kbinput
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2630 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-12 16:45:37 +00:00
David Lawrence Ramsey
068edf44fc more formatting fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2629 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-12 16:13:44 +00:00
David Lawrence Ramsey
aeeb96e628 cosmetic and formatting fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2628 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-12 16:00:09 +00:00
David Lawrence Ramsey
3db0dc3d8d add macro charset(), a wrapper that calls memset(), and use it in
resize_variables()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2627 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-12 15:24:36 +00:00
David Lawrence Ramsey
c00f658026 in resize_variables(), use sizeof(char) in the memset() that initializes
hblank instead of assuming that the size of a char is 1


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2626 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-12 15:19:11 +00:00
David Lawrence Ramsey
8767da4e63 comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2625 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-12 02:14:48 +00:00
David Lawrence Ramsey
d0d5b8fc0e in display_string(), don't check for multicolumn characters if the NO_UTF8 flag isn't set
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2624 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-10 20:45:54 +00:00
David Lawrence Ramsey
44491acfef in color_to_int(), assert that colorname isn't NULL, since that case is
now handled elsewhere; also clarify an error message in parse_colors()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2623 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-09 14:04:08 +00:00
David Lawrence Ramsey
8bcac8ad26 in disable_extended_input(), disable extended output processing as well
as extended input processing; also rename it to disable_extended_io()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2622 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-09 04:02:57 +00:00
David Lawrence Ramsey
53aca71420 formatting fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2621 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-09 04:00:03 +00:00
David Lawrence Ramsey
a9d45bba01 in parse_colors(), properly generate an error if we get a color
directive without a regex string


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2620 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-09 01:09:00 +00:00
David Lawrence Ramsey
a644af58a3 update documentation for the "color" regex
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2619 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-08 21:30:50 +00:00
David Lawrence Ramsey
7c78b45e76 in parse_colors(), properly parse a background color without a
foreground color


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2618 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-08 21:17:32 +00:00
David Lawrence Ramsey
746214d5aa make parse_line_column() consistent with the color regex-parsing code
and go back to returning an error on strings like "3,"


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2617 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-08 21:16:14 +00:00
David Lawrence Ramsey
0df61f1aac cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2616 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-08 20:23:06 +00:00
David Lawrence Ramsey
4428975e95 cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2615 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-08 20:13:38 +00:00
David Lawrence Ramsey
c7935e20b7 revert the conversion of each line to a valid multibyte string, as it
doesn't take encodings other than ASCII and Latin-1 into account and
hence isn't accurate enough


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2614 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-08 20:12:57 +00:00
David Lawrence Ramsey
01458cd380 clarify changelog entry
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2613 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-08 19:57:31 +00:00
David Lawrence Ramsey
7bf86e1707 when reading a file in, make sure each line is a valid multibyte string
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2612 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-08 19:50:02 +00:00
David Lawrence Ramsey
23d3cf4515 in doc/faq.html, update the question about the FAQ to mention the
current maintainer


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2611 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-08 18:46:51 +00:00
David Lawrence Ramsey
9af6a203fb typo fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2610 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-08 02:28:06 +00:00
David Lawrence Ramsey
092af14a82 cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2609 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-08 01:35:10 +00:00
Jordi Mallach
3da5580c9c Fix French mandir.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2608 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-07 22:23:45 +00:00
David Lawrence Ramsey
3925bdafda fix erroneous #ifdef that caused a compilation problem when
--enable-nanorc wasn't used and --enable-extra was, and make sure we put
back the keystroke that breaks us out of the credits (if any)


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2607 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-07 03:20:35 +00:00
David Lawrence Ramsey
f47f150c82 preemptively update the version number
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2606 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-07 02:25:23 +00:00
David Lawrence Ramsey
457847f0fe add else's
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2605 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-06 19:35:53 +00:00
David Lawrence Ramsey
7e62d109ba in do_insertfile(), set i to 0 when we get a filename via the file
browser, so that it's read in properly when we exit the file browser


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2604 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-06 19:25:29 +00:00
David Lawrence Ramsey
193b0e56f3 add missing blank line
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2603 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-06 18:41:17 +00:00
David Lawrence Ramsey
9b108c2110 in shortcut_init(), remove unnecessary "Refresh" placeholder in the file
browser shortcut list; also add a few formatting fixes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2602 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-06 18:38:16 +00:00
David Lawrence Ramsey
da33153379 in do_yesno(), allow refreshing the screen via Ctrl-L, as Pico does
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2601 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-06 17:00:08 +00:00
David Lawrence Ramsey
f4595bb5ae in die(), if the current filestruct's been partitioned, unpartition it
before saving the associated file


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2600 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-06 16:27:18 +00:00
David Lawrence Ramsey
c4dbdd55f5 in do_replace_loop(), when moving to the next match, update the screen
using edit_refresh() instead of edit_redraw(), as the latter won't work
properly when we've replaced one or more instances of a string in copy
and haven't yet updated current->data to match copy


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2599 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-06 03:46:32 +00:00
David Lawrence Ramsey
d29b9d5bd6 fix another memory corruption problem in display_string() found by
valgrind


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2598 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-06 03:17:07 +00:00
David Lawrence Ramsey
810d02c6a4 add const
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2597 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-06 01:53:48 +00:00
David Lawrence Ramsey
f99acbf29a make parse_line_column() more consistent: don't return an error on
strings like "3," since we don't return one on strings like ",3"


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2596 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-05 23:12:18 +00:00
David Lawrence Ramsey
6fdc81ae04 various umask-related cleanups
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2595 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-05 19:33:27 +00:00
David Lawrence Ramsey
81dabf2be7 formatting fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2594 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-05 19:20:36 +00:00
David Lawrence Ramsey
3db02389f4 in safe_tempfile(), open a newly created temporary file in "r+b" mode
instead of "w+b" mode, since the latter truncates the file if it already
exists, and we don't need to do that since it's an error if the file
already exists


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2593 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-05 19:18:11 +00:00
David Lawrence Ramsey
cc81436f81 move check_linenumbers() down so that it's near the other debugging
routines


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2592 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-05 19:08:59 +00:00
David Lawrence Ramsey
6529ab434a remove unneeded blank line
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2591 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-04 01:16:46 +00:00
David Lawrence Ramsey
160c5fec87 remove erroneous extra prototype
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2590 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-04 00:24:22 +00:00
David Lawrence Ramsey
81e49a0d4a fix #ifdef
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2589 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-03 21:00:55 +00:00
David Lawrence Ramsey
c10d8ffe9f for consistency, remove -R/--regexp command line option, and allow the
toggle unconditionally


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2588 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-03 20:51:39 +00:00
David Lawrence Ramsey
8fda94246b remove erroneous if block in update_history() preventing the history
list position from being properly moved to the bottom in some cases


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2587 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-03 20:18:46 +00:00
David Lawrence Ramsey
1addd601bc really fix bad #ifdefs; history functions are left out when NANO_SMALL
is defined, and history saving and loading functions are left out when
NANO_SMALL is defined and/or ENABLE_NANORC isn't defined


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2586 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-03 19:28:30 +00:00
David Lawrence Ramsey
8e15674c70 fix more bad #ifdefs
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2585 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-03 19:11:27 +00:00
David Lawrence Ramsey
5854a87070 cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2584 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-03 19:10:47 +00:00
David Lawrence Ramsey
47ae0d764e remove now-unnecessary null_at()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2583 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-03 14:30:52 +00:00
David Lawrence Ramsey
73857558ec typo fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2582 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-03 04:09:45 +00:00
David Lawrence Ramsey
854b71d775 in configure.ac, don't refer to the built-in file browser as crappy
anymore


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2581 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-03 01:43:56 +00:00
David Lawrence Ramsey
cef24f2254 fix #ifdefs so the tiny version of nano compiles again; prepending a
file now uses safe_tempfile() instead of mkstemp() directly, and
safe_tempfile() requires get_full_path() and check_writable_directory()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2580 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-03 01:36:05 +00:00
David Lawrence Ramsey
8d07efac66 comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2579 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-03 01:33:04 +00:00
David Lawrence Ramsey
d922f199a7 define last_kbinput inside the right #ifdef block
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2578 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-02 19:50:18 +00:00
David Lawrence Ramsey
34bdc35d94 readd tab completion of history strings, with a few minor tweaks
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2577 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-02 18:41:31 +00:00
David Lawrence Ramsey
1726050ef9 fix more bad #ifdefs, and add a few formatting fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2576 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-02 05:50:58 +00:00
David Lawrence Ramsey
8234f672d4 typo fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2575 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-02 02:32:39 +00:00
David Lawrence Ramsey
95778fda70 fix mismatched #ifdefs
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2574 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-02 02:27:12 +00:00
David Lawrence Ramsey
dac3bca274 clarify a comment, and don't try to display the buffer name in
die_save_file() if it's been blanked out by get_next_file()'s failure to
find a unique filename


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2573 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-06-01 04:23:52 +00:00
David Lawrence Ramsey
e0b55138b9 add missing blank line
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2572 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-31 17:35:11 +00:00
David Lawrence Ramsey
5e068c6031 rework the file-writing routines so that they can work properly with
already-opened files, such as the mkstemp()-created files used by the
spell-checking code


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2571 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-31 04:28:15 +00:00
David Lawrence Ramsey
bec2f20da0 formatting fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2570 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-31 03:39:59 +00:00
David Lawrence Ramsey
d20c0c34f5 comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2569 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-31 03:36:15 +00:00
David Lawrence Ramsey
0998a64fb9 cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2568 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-31 03:33:30 +00:00
David Lawrence Ramsey
527f1743f6 add documentation updates for -E/--backupdir's new ability to make
filenames unique, and preemptively update the version number


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2567 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-30 02:09:21 +00:00
David Lawrence Ramsey
54b74cee91 in die(), tweak the message displayed when a backup file can't be
written, so as to not duplicate a translted string


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2566 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-29 23:03:28 +00:00
David Lawrence Ramsey
b9b572236a when using a backup directory, make sure all the filenames written are
unique by using get_next_filename() when necessary


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2565 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-29 02:22:55 +00:00
David Lawrence Ramsey
df2a82509b fix mismatched subscript
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2564 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-28 23:51:03 +00:00
David Lawrence Ramsey
1a1ea3d42f cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2563 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-28 23:32:45 +00:00
David Lawrence Ramsey
15aaa2c31a miscellaneous minor fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2562 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-28 23:21:30 +00:00
David Lawrence Ramsey
10796ac2fc cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2561 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-27 13:50:31 +00:00
David Lawrence Ramsey
aff5a1c6b1 add multibyte/wide character support to input_tab(), so that we don't
end up with a string that contains only part of a multibyte character
during tab completion


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2560 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-27 13:06:18 +00:00
David Lawrence Ramsey
217f241be5 document bool fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2559 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-27 03:57:01 +00:00
David Lawrence Ramsey
11846fa576 bool fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2558 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-27 03:52:21 +00:00
David Lawrence Ramsey
32fe95d35e revert last change for now, as it breaks the display of filename matches
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2557 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-26 19:48:41 +00:00
David Lawrence Ramsey
920e350d85 in input_tab(), make sure that we don't set *place to the middle of a
multibyte character


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2556 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-26 19:14:42 +00:00
David Lawrence Ramsey
e5b23bd2ff formatting fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2555 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-26 18:57:56 +00:00
David Lawrence Ramsey
7de678798a cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2554 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-26 18:20:05 +00:00
David Lawrence Ramsey
638cbe5407 yet another comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2553 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-26 18:11:32 +00:00
David Lawrence Ramsey
0e0fef03c5 typo fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2552 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-26 18:05:22 +00:00
David Lawrence Ramsey
f1d3d9581a more miscellaneous minor fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2551 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-26 18:03:17 +00:00
David Lawrence Ramsey
40e4acf55e port over DB's (better) equivalent of the last fix, and tweak a few
comments


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2550 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-26 06:09:07 +00:00
David Lawrence Ramsey
5d8d0b19be remove redundancy
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2549 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-26 05:53:29 +00:00
David Lawrence Ramsey
86d8fc37d7 remove unneeded blank line
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2548 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-26 05:50:46 +00:00
David Lawrence Ramsey
e8bb90bd2b fix changelog entry
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2547 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-26 05:39:53 +00:00
David Lawrence Ramsey
e2ce2792a3 remove redundancy
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2546 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-26 05:33:57 +00:00
David Lawrence Ramsey
045d130cfa really fix one of the last fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2545 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-26 05:27:19 +00:00
David Lawrence Ramsey
31b159c1b3 add various fixes to avoid a hang and several potential assertion
failures when building with DEBUG defined


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2544 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-26 05:17:13 +00:00
David Lawrence Ramsey
e4acb69611 another comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2543 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-26 04:00:39 +00:00
David Lawrence Ramsey
e3970f503c replace all instances of strncpy() with charcpy(), since the only
difference between them is that the former pads strings with nulls when
they're longer than the number of characters specified, which doesn't
appear to be used anywhere


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2542 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-26 03:47:24 +00:00
David Lawrence Ramsey
16f88134f7 more miscellaneous minor fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2541 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-26 03:32:41 +00:00
David Lawrence Ramsey
8b3266e83c fix inaccurate comments
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2540 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-26 02:46:42 +00:00
David Lawrence Ramsey
0a8ec176e4 really fix the off-by-one errors in LINE,COLUMN parsing; the column
number in do_gotolinecolumn() should always be one-based


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2539 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-25 18:44:37 +00:00
David Lawrence Ramsey
86a9452702 in configure.ac, add minor tweaks to some of the test blocks to avoid
XSI:isms


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2538 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-24 22:20:39 +00:00
David Lawrence Ramsey
c5e9a434b1 fix one last off-by-one error that occurs when do_gotolinecolumn() is
used interactively


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2537 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-23 20:16:29 +00:00
David Lawrence Ramsey
67e3b93861 comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2536 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-23 18:49:28 +00:00
David Lawrence Ramsey
e5bc1c45ce oops; free magichistory *properly* when we don't need it anymore
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2535 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-23 17:19:32 +00:00
David Lawrence Ramsey
2fba43c842 free magichistory when we don't need it anymore
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2534 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-23 17:14:46 +00:00
David Lawrence Ramsey
934f9687bb overhaul the history code to work more consistently, and clean up
various parts of it; note that history tab completion has been removed


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2533 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-23 16:30:06 +00:00
Jordi Mallach
7ae4cc6964 Updated French from the TP.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2532 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-23 11:49:50 +00:00
David Lawrence Ramsey
0f476b99b7 comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2531 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-22 04:16:36 +00:00
David Lawrence Ramsey
30f164a015 in save_history(), properly save history when in view mode
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2530 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-21 22:41:23 +00:00
David Lawrence Ramsey
86ce3903f9 in usage(), add formatting fixes and a missing N_()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2529 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-21 17:15:46 +00:00
David Lawrence Ramsey
6f25a67833 various minor fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2528 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-20 02:57:05 +00:00
David Lawrence Ramsey
5754201944 when calling do_gotolinecolymn(), default to the current line and column
if the ones passed in are unspecified or invalid


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2527 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-17 22:27:15 +00:00
David Lawrence Ramsey
172767187e in do_gotolinecolumn(), start the search for a line from fileage instead
of current (again)


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2526 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-17 22:01:55 +00:00
David Lawrence Ramsey
d3d37433ae mention the support for moving to a different column in the prompt
formerly known as the "Go to Line" prompt, and also in the help text
where possible


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2525 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-17 21:49:19 +00:00
David Lawrence Ramsey
f83e5e2b13 fix off-by-one problems with COLUMN; it should be zero-based
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2524 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-17 18:29:05 +00:00
David Lawrence Ramsey
650b39c43d set placewewant more efficiently
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2523 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-17 18:15:00 +00:00
David Lawrence Ramsey
9245f97960 more LINE,COLUMN-related work: fix problems parsing it, and allow it at
the (soon-to-be-renamed) "Go to Line" prompt


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2522 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-17 18:06:26 +00:00
David Lawrence Ramsey
60a9bddcf6 formatting fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2521 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-17 16:54:34 +00:00
David Lawrence Ramsey
e1ce92c90f in do_gotoline(), properly show an error message if we try to go to line
0, since the first line in the file is 1


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2520 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-17 01:55:44 +00:00
David Lawrence Ramsey
c5659d320e add error detection to parse_line_column()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2519 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-17 00:25:50 +00:00
David Lawrence Ramsey
2f0cd35322 add missing comment
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2518 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-16 23:33:53 +00:00
David Lawrence Ramsey
b68c01b753 move duplicate code from the +LINE,COLUMN feature into a separate
function, parse_line_column()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2517 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-16 23:23:15 +00:00
David Lawrence Ramsey
50995bd024 rename another variable
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2516 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-16 20:13:09 +00:00
David Lawrence Ramsey
9c8baed321 comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2515 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-16 19:43:04 +00:00
David Lawrence Ramsey
775eeba38a add the ability to open a file on a specified column as well as a
specified line, by allowing an argument of the form +LINE,COLUMN


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2514 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-16 18:38:16 +00:00
David Lawrence Ramsey
6e925cf330 update the Free Software Foundation's mailing address in various
comments


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2510 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-15 19:57:17 +00:00
David Lawrence Ramsey
066713e87e more indentation fixes and one more cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2509 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-14 23:21:02 +00:00
David Lawrence Ramsey
546f5b3d8a rename a few more variables, and fix some indentation
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2508 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-14 23:14:47 +00:00
David Lawrence Ramsey
e781ddf3b1 still more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2507 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-14 22:44:16 +00:00
David Lawrence Ramsey
6d39f4ba66 document a renamed variable
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2506 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-14 21:19:15 +00:00
David Lawrence Ramsey
5ebd73f9a5 more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2505 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-14 20:52:20 +00:00
David Lawrence Ramsey
02173c05dc in cut_line(), set placewewant properly after cutting a line, to avoid a
problem where the screen won't be updated if (a) we're not on the first
page when we cut the line, and (b) immediately after we cut the line, we
hit End to move to the end of the line after it


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2504 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-14 18:41:25 +00:00
David Lawrence Ramsey
7f4dd35406 another cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2503 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-08 17:08:51 +00:00
David Lawrence Ramsey
8f5e50991b cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2502 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-06 17:03:53 +00:00
David Lawrence Ramsey
340e5ca881 revert one last change that was causing breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2501 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-03 21:42:04 +00:00
David Lawrence Ramsey
75f4b7cb84 remove redundant code
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2500 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-03 21:35:58 +00:00
David Lawrence Ramsey
5e73eec3cc revert one of the previous changes; we don't really need a shortcut for
moving to the next search/replace history string, as we don't have one
for tab completion either


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2499 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-03 20:57:13 +00:00
David Lawrence Ramsey
0f83c89b09 rearrange nanogetstr() to fix breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2498 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-03 03:18:44 +00:00
David Lawrence Ramsey
6bc26a9a8b revert some attempts at simplifying the search/replace history code that
were causing breakage; make "previous history" and "next history" use
separate keys; and display them as "^P" and "^N" instead of using one
sentinel value for both, so that clicking on them with the mouse works
again


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2497 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-05-02 21:48:34 +00:00
David Lawrence Ramsey
198bd592ff document the simplification of a history check in nanogetstr(), and
remove an extra parenthesis so it actually compiles (oops)


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2496 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-29 13:16:05 +00:00
David Lawrence Ramsey
fcdfb7f75f more comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2495 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-29 04:32:38 +00:00
David Lawrence Ramsey
e41e8dbead more comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2494 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-29 03:28:27 +00:00
David Lawrence Ramsey
10f880c62f remove a redundant check in get_history_newer(), and add a few comment
fixes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2493 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-29 03:24:43 +00:00
Jordi Mallach
5e360dc065 Updated Malay from the TP.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2492 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-27 06:14:48 +00:00
David Lawrence Ramsey
6595b715d0 oops; in do_output(), properly allow wrapping when we insert a tab, for
consistency; this is incompatible with Pico, but Pico doesn't wrap
properly when other control characters are on a line, either, so its
behavior with regard to tabs is apparently a bug; besides, we wrap at
all other blank characters, including multibyte ones, so we shouldn't
make an exception for tabs


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2491 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-26 17:21:47 +00:00
Jordi Mallach
56c1e34e5a Update Norwegian bokmaal from the TP.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2490 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-26 04:47:03 +00:00
David Lawrence Ramsey
e4cb3158fd in do_output(), fix an off-by-one error that allowed wrapping when we
inserted a tab, for Pico compatibility


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2489 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-25 22:48:58 +00:00
David Lawrence Ramsey
6439330d59 in shortcut_init(), move the "Refresh" and "Exit" shortcuts to the
beginning of the help browser shortcut list, for consistency


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2488 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-25 21:48:22 +00:00
David Lawrence Ramsey
0bfec6e58d minor bits: fix slang compilation by calling clearok(TRUE) and
wrefresh() on edit instead of curscr, since slang's curses emulation
doesn't include a curscr equivalent; and revert Jordi's removal of a
space in the main help text, as its second paragraph won't be properly
indented by one space without it


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2487 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-25 20:08:29 +00:00
David Lawrence Ramsey
29be8031df comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2486 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-20 14:55:46 +00:00
Jordi Mallach
c5fe41cec8 Update Malay, Romanian and Traditional Chinese from the TP.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2485 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-20 13:26:41 +00:00
Jordi Mallach
72bff8eee4 Err, stable branch has been nano_1_2 for the last two years, doh!
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2484 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-20 13:24:39 +00:00
Jordi Mallach
d4a1c0ad29 Credit Vietnamese translator.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2483 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-20 13:22:08 +00:00
David Lawrence Ramsey
1ccada16ae actually, since copy_file() doesn't allocate ever-increasing space for a
file, it should read the file BUFSIZ bytes at a time; remove erroneous
changelog entry


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2482 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-19 22:37:01 +00:00
David Lawrence Ramsey
5b2f17e591 change all hardcoded instances of 128 bytes to MAX_BUF_SIZE, and #define
MAX_BUF_SIZE as 128 in nano.h


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2481 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-19 21:47:01 +00:00
David Lawrence Ramsey
3705924fc8 cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2480 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-19 20:13:13 +00:00
David Lawrence Ramsey
c596c0c4da miscellaneous bits: make get_next_filename() use an unsigned long, make
num_of_digits() take a size_t instead of a ssize_t, and rename
num_of_digits() to digits()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2479 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-19 16:32:08 +00:00
David Lawrence Ramsey
9cf1df1f06 in do_browser() and do_help(), don't treat NANO_CANCEL_KEY as
NANO_EXIT_KEY anymore, for consistency


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2478 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-19 03:15:21 +00:00
Jordi Mallach
56074a1da6 Update Vietnamese from the TP.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2477 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-18 15:37:49 +00:00
Jordi Mallach
f79a3fa51a Catalan, Italian and Romanian updates from the TP.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2476 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-18 12:40:38 +00:00
Jordi Mallach
b9180f4a82 Remove bogus space from help text.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2475 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-18 12:31:11 +00:00
David Lawrence Ramsey
ad11460eb7 remove more unneeded clearok(TRUE)'s, and avoid an unnecessary update
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2474 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-16 18:27:57 +00:00
David Lawrence Ramsey
04652518fd simplify total_update() to call clearok(TRUE) and wrefresh() on curscr,
which updates the entire screen in fewer function calls


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2473 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-16 18:07:37 +00:00
David Lawrence Ramsey
22425a204d cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2472 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-16 15:57:19 +00:00
David Lawrence Ramsey
e527e458f4 various #include fixes: since proto.h includes nano.h, only include the
former in source files; also add an #include guard to proto.h, and make
the config.h #include in nano.h match the config.h #includes everywhere
else


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2471 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-15 18:07:26 +00:00
David Lawrence Ramsey
ac71fdde97 more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2470 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-15 17:48:20 +00:00
David Lawrence Ramsey
ffda704ef6 cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2469 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-14 17:08:35 +00:00
David Lawrence Ramsey
6a244b689f various minor bits: add miscellaneous comment fixes; in
get_next_filename(), use a long instead of an int for the number
prepended to the filename; and in num_of_digits(), use a ssize_t instead
of an int


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2468 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-14 03:52:28 +00:00
David Lawrence Ramsey
c2b07472e2 in print1opt_full(), if desc should be empty, allow it to be NULL
instead of "", since the latter is not necessarily translated as ""


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2467 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-14 03:13:49 +00:00
Jordi Mallach
f1aed80922 Updated Spanish from the TP.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2466 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-13 22:58:51 +00:00
Jordi Mallach
95660ee4d9 Added Vietnamese translation by Phan Vinh Thinh <teppi82@gmail.com>.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2465 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-13 14:26:02 +00:00
David Lawrence Ramsey
ddedf2dbd4 Back to CVS
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2464 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-04-10 03:59:53 +00:00
42 changed files with 6901 additions and 4567 deletions

469
ChangeLog
View File

@@ -1,3 +1,468 @@
GNU nano 1.3.8 - 2005.06.30
- General:
- Miscellaneous comment fixes. (DLR)
- Various #include fixes. Since proto.h includes nano.h, only
include the former in source files. Also add an #include
guard to proto.h, and make the config.h #include in nano.h
match the config.h #includes everywhere else. (DLR)
- Change all hardcoded instances of 128 bytes to MAX_BUF_SIZE,
and #define MAX_BUF_SIZE as 128 in nano.h. (DLR)
- Display the key to go to the previous strings in the
search/replace history as "^P" instead of "Up". This makes
mouse clicks work properly on it. Changes to shortcut_init(),
help_init(), nanogetstr(), and do_statusbar_input(). (DLR)
- Update the Free Software Foundation's mailing address in
various comments. (DLR)
- Add the ability to open a file on a specified column as well
as a specified line, by allowing an argument of the form
+LINE,COLUMN. New function parse_line_column(); changes to
shortcut_init(), main(), do_gotoline() (renamed
do_gotolinecolumn()), do_gotoline_void() (renamed
do_gotolinecolumn_void()), nano.1, and nano.texi. (DLR,
suggested by PFTank)
- Overhaul the history code to work more consistently, and clean
up various parts of it. New function history_has_changed();
changes to load_history(), writehist(),
thanks_for_all_the_fish(), history_init(), find_node()
(renamed find_history()), update_history(),
get_history_older(), get_history_newer(),
get_history_completion(), do_search(), do_replace(),
nanogetstr(), and statusq(); removal of remove_node() and
insert_node(). (DLR)
- Remove all instances of charcpy() and replace them with
strncpy(), since there's no way to be sure that a charcpy()ed
string will always be properly null-terminated, and strcpy()'s
null termination is the only difference between it and
charcpy(). (DLR)
- When using a backup directory, make sure all the filenames
written are unique by using get_next_filename() when
necessary. Changes to get_next_filename(), write_file(),
die(), usage(), nano.1, nanorc.5, nanorc.sample, and
nano.texi. (DLR, suggested by James Collings)
- Rework the file-writing routines so that they can work
properly with already-opened files, such as the
mkstemp()-created files used by the spell-checking code.
Changes to safe_tempnam() (renamed safe_tempfile()),
write_file(), write_marked(), die(), do_spell(), and
do_exit(). (DLR)
- Remove the -R/--regexp command line option and enable the
toggle at the search prompt in tiny mode, as it already
allows the prepend and append toggles at the search prompt.
For consistency, rename TOGGLE_REGEXP_KEY to NANO_REGEXP_KEY,
and move it out of the toggles block to where NANO_PREPEND_KEY
and NANO_APPEND_KEY are. Also, change the short command line
option for --restricted from -Z to -R. Changes to
shortcut_init(), usage(), main(), search_init(), nano.1,
nano.texi, etc. (DLR)
- Various cleanups and improvements in chars.c. Remove some
unnecessary w?ctype wrappers and variables; change the wctype
wrappers to take wint_t instead of wchar_t to match the
functions they wrap; rename some functions for consistency;
add functions to detect blank characters in a string, for use
in rcfile option parsing; and don't count matches between
valid and invalid multibyte sequences anymore, as it causes
problems when doing a replace. New functions
is_valid_mbstring(), has_blank_chars(), and
has_blank_mbchars(); changes to is_alnum_mbchar(),
is_blank_char() (renamed nisblank()), is_blank_mbchar(),
is_blank_wchar() (renamed niswblank()), is_cntrl_wchar(),
control_rep(), control_mbrep(), make_mbstring() (renamed
make_valid_mbstring()), mbstrncasecmp(), mbstrcasestr(),
mbrevstrcasestr(), etc.; removal of is_alnum_char() and
is_alnum_wchar(). (DLR)
- Implement word count via Meta-D at the main window. Note that
this is disabled when NANO_SMALL is defined. Also, convert
all word detection functions to use the same wrapper function
for ease of maintenance, and make them return more
information. New functions is_punct_mbchar(),
is_word_mbchar(), do_next_word_void(), do_prev_word_void(),
and do_word_count(); changes to shortcut_init(),
do_next_word(), do_prev_word(), is_whole_word(),
do_statusbar_next_word(), and do_statusbar_prev_word(). (DLR)
- Fix #ifdefs so that nano compiles with NANO_SMALL defined and
DISABLE_TABCOMP undefined. Changes to revstrstr() and
free_charptrarray() (renamed free_chararray()). (DLR)
- Change the wctype wrappers to take wchar_t's again, as they
still work the same way with them. This also fixes
compilation on Mac OS X 10.4.1, which doesn't seem to define a
wint_t type. (DLR, found by Emily Jackson)
- Add the ability to convert typed tabs to spaces using
the -E/--tabstospaces command line options, the "tabstospaces"
rcfile option, and the toggle Meta-Q (since QBasic did this by
default :)). Note that this doesn't affect tabs entered using
verbatim input, and that it's disabled when NANO_SMALL is
defined. Also, change the short command line option for
--backupdir from -E to -C. Changes to toggle_init(), usage(),
do_tab(), main(), nanorc.sample, nano.1, nanorc.5, and
nano.texi. (DLR, suggested by many people)
- Change the CONSTUPDATE, REVERSE_SEARCH, and SMOOTHSCROLL flags
to the CONST_UPDATE, BACKWARDS_SEARCH, and SMOOTH_SCROLL
flags, respectively. (DLR)
- Change the SMOOTHSCROLL flag to the SMOOTH_SCROLL flag. (DLR)
- Change the NO_UTF8 flag to the USE_UTF8 flag, and reverse its
meaning. (DLR)
- Add rcfile options "casesensitive" and "backwards", to do
case sensitive and backwards searches by default. Changes to
nanorc.sample and nanorc.5. (DLR)
- Since the DISABLE_CURPOS flag is only used in winio.c, reduce
it to a static bool there. Changes to statusbar() and
disable_cursorpos(). (DLR)
- Add -U/--quickblank option and a "quickblank" rcfile option to
blank the statusbar after 1 keystroke instead of 25. Note
that this obviously has no effect when constant cursor
position display is turned on, and that this is disabled when
NANO_SMALL is defined. Changes to usage(), main(),
statusbar(), nanorc.sample, nano.1, and nanorc.5. (DLR,
suggested by CHAO Wei-Lun)
- Add support for case insensitive expression matching when
using color syntax highlighting, via the "icolor" directive,
and add it to those regexes that can use it. Changes to
parse_colors(), parse_rcfile(), nanorc.sample, and nanorc.5.
(Brand Huntsman, minor tweaks by DLR)
- Add various type changes to avoid problems on systems where
int and ssize_t are different sizes. Make filestruct->lineno
a ssize_t (so that we can avoid negative line numbers at the
"Go To Line" prompt), current_y a ssize_t (in order to hold
the maximum difference between two filestruct->lineno's),
totlines a size_t, and change related variables to match.
(DLR, initial problem with parse_line_column() found by Mike
Frysinger)
- Rework the credits handling to display Florian König's name
properly whether we're in a UTF-8 locale or not, and without
requiring a massive function that we only use once. Changes
to do_credits(); removal of make_valid_mbstring(). (DLR)
- chars.c:
make_mbstring()
- Change erroneous ENABLE_EXTRA #ifdef to NANO_EXTRA to fix a
compilation problem when --enable-nanorc isn't used and
--enable-extra is. (DLR)
- color.c:
update_color()
- Use mbstrcasecmp() instead of strcasecmp(), so that UTF-8
color syntax names are properly detected. (DLR)
- cut.c:
cut_line()
- Set placewewant properly after cutting a line, to avoid a
problem where the screen won't be updated if (a) we're not on
the first page when we cut the line, and (b) immediately after
we cut the line, we hit End to move to the end of the line
after it. (DLR)
- files.c:
read_line()
- Rename variable prev to prevnode to avoid confusion. (DLR)
- Rename variable len to buf_len, for consistency. (DLR)
load_open_file()
- Remove an unneeded clearok(FALSE). (DLR)
get_next_filename()
- Use an unsigned long instead of an int for the number
prepended to the filename. (DLR)
do_insertfile()
- Set i to 0 when we get a filename via the file browser, so
that it's read in properly when we exit the file browser.
(DLR)
open_prevnext_file()
- Move up a misplaced assert. (DLR)
- Rename variable next to next_file, to avoid confusion. (DLR)
write_file()
- Since lineswritten is a size_t, print its value as an unsigned
long instead of an unsigned int. (DLR)
- Declare the size_t i only in the loop where it's used. (DLR)
diralphasort()
- Use mbstrcasecmp() instead of strcasecmp(), so that UTF-8
filenames are sorted properly. (DLR)
cwd_tab_completion(), browser_init()
- Rename variable next to nextdir to avoid confusion. (DLR)
input_tab()
- Since list is a bool, set it to FALSE instead of 0. (DLR)
- Add multibyte/wide character support, so that we don't end up
with a string that contains only part of a multibyte
character during tab completion. (DLR)
- Rename variable buflen to buf_len, for consistency. (DLR)
do_browser()
- Don't treat NANO_CANCEL_KEY as NANO_EXIT_KEY anymore, for
consistency. (DLR)
- When displaying "(dir)" in the available screen space, make
sure that the string it's stored in is always null-terminated.
(DLR)
- Rename variable selectedbackup to old_selected, for
consistency. (DLR)
- Make mouse clicks in the browser window work properly when the
MORE_SPACE flag is set. (DLR)
- Make foo_len a size_t instead of an int. (DLR)
save_history()
- Properly save history when we're in view mode. (DLR)
- global.c:
shortcut_init()
- Move the "Refresh" and "Exit" shortcuts to the beginning of
the help browser shortcut list, for consistency. (DLR)
- Remove unnecessary "Refresh" placeholder in the file browser
shortcut list. (DLR)
- Allow the mark to be used in view mode, as Pico does. (DLR)
- Clarify the description of ^X when --enable-multibuffer is
used. (DLR)
- Change the description of the Meta-B toggle at the search
prompt from "Direction" to "Backwards", for consistency. (DLR)
toggle_init()
- Clarify the descriptions of M-C and M-L. (DLR)
- Reorder the toggles to put more toggles with similar functions
together. (DLR)
thanks_for_all_the_fish()
- Remove free_toggles() and move its code here verbatim, as it's
only called here anyway. (David Benbennick)
- Fix the code to free all open file buffers to work properly
with the previous overhaul of the multibuffer code instead of
going into an infinite loop. (David Benbennick)
- Add additional checks for variables' not being NULL before we
try to free them, to avoid assertion failures. (DLR)
- nano.c:
die()
- Rename variable ret to retval for consistency. (DLR)
- Tweak the message displayed when a backup file can't be
written, so as to not duplicate a translated string. (DLR)
- If the current filestruct's been partitioned, unpartition it
before saving the associated file. (DLR)
resize_variables()
- Use charset() instead of memset() to initialize hblank. (DLR)
copy_filestruct()
- Rename variable prev to copy to avoid confusion. (DLR)
print1opt_full()
- If desc should be empty, allow it to be NULL instead of
"", since the latter is not necessarily translated as "".
(DLR, found by Jordi)
usage()
- Add missing N_() around one message, so that it isn't
erroneously translated twice. (DLR)
- Remove inaccurate default listed for -Q/--quotestr. (DLR)
version()
- Add --enable-utf8 to the displayed compilation options, put
the options in alphabetical order, and handle --enable-tiny
the same way as all the other options. (DLR)
do_tab()
- Remove unneeded variable kbinput. (DLR)
do_int_spell_fix()
- Display highlighted misspelled words using display_string(),
as do_replace_loop() does. (DLR)
do_alt_speller()
- Replace a set_modified() with SET(MODIFIED) to avoid an
unnecessary update, and remove an unneeded clearok(FALSE).
(DLR)
- Move the spell checking error handling block down and refactor
it so that we go back into curses mode, reinitialize the
terminal, turn the cursor back on, and turn the mark back on
if necessary before returning the error message. (DLR)
do_spell()
- If the spell-checker printed any error messages onscreen, call
total_refresh() to make sure they're cleared off. (DLR, found
by CHAO Wei-Lun)
find_paragraph()
- Reset placewewant as well as current_x to 0, in order to avoid
a potential screen update problem. (DLR)
do_justify()
- Save placewewant, and restore it if we unjustify, in order to
avoid a potential screen update problem. (DLR)
do_output()
- Properly allow wrapping when we insert a tab, for consistency.
(DLR)
- Don't set current_len until after it's been asserted that both
current and current->data aren't NULL. (DLR)
do_toggle()
- Properly treat color syntax highlighting as enabled by
default, and only treat wrapping as enabled by default when
DISABLE_WRAPPING isn't defined. (DLR)
disable_extended_input()
- Disable extended output processing as well as extended input
processing, and rename to disable_extended_io(). (DLR)
disable_flow_control(), enable_flow_control()
- Only turn off flow control on output, as it might be needed
for input on slow terminals. (DLR)
- nano.h:
- Add macro charset(), a wrapper that calls memset(). (DLR)
- Readd #defines for the isblank() and iswblank() equivalents.
(DLR)
- In the colortype struct, make bright a bool instead of an int,
for consistency. (DLR)
- proto.h:
- Add missing NANO_SMALL and HAVE_REGEX_H #ifdefs around the
do_find_bracket() prototype. (DLR)
- rcfile.c:
color_to_int()
- Since colorname's being NULL is handled elsewhere now, assert
that it isn't NULL at the beginning of the function. (DLR)
parse_colors()
- Properly parse a background color without a foreground color.
(DLR)
- Properly generate an error if we get a color directive without
a regex string. (DLR)
parse_rcfile()
- Properly generate an error if we get an invalid multibyte
string for an option, instead of working around it. (DLR)
- Use has_blank_mbchars() to check for blank characters in the
"punct" and "brackets" options, and clarify the error message
displayed when we find blank characters. (DLR)
- search.c:
do_gotoline()
- Properly show an error message if we try to go to line 0,
since the first line in the file is 1. (DLR)
- Start the search for a line from fileage instead of current
(again). (DLR)
replace_regexp()
- Rename variables create_flag and new_size to create and
new_line_size, for consistency. (DLR)
- Make new_line_size, search_match_count, and i size_t's, for
consistency. (DLR)
replace_line()
- Make new_line_size and search_match_count size_t's, for
consistency. (DLR)
do_replace_loop()
- When moving to the next match, update the screen using
edit_refresh() instead of edit_redraw(), as the latter won't
work properly when we've replaced one or more instances of a
string in copy and haven't yet updated current->data to match
copy. (DLR)
do_find_bracket()
- Miscellaneous cleanups: rename variables for consistency, and
save the search direction and regexp setting in two bools
instead of one flags variable. (DLR)
- utils.c:
num_of_digits()
- Use a size_t instead of an int, and rename to digits(). (DLR)
align()
- Rename variable strp to str for consistency. (DLR)
- winio.c:
do_statusbar_output()
- Don't set answer_len until after it's been asserted that
answer isn't NULL. (DLR)
display_string()
- Avoid a memory corruption problem by allocating enough space
for len plus a trailing multibyte character and/or tab. (DLR)
- Don't check for multicolumn characters if the NO_UTF8 flag
isn't set. (DLR)
- Free buf_mb when we're done using it. (DLR)
nanogetstr()
- Rename variable def to curranswer to avoid confusion. (DLR)
- Only declare and use the tabbed variable if DISABLE_TABCOMP
isn't defined. (DLR)
- Refactor to replace unnecessary variable answer_len with
curranswer_len, and hence avoid an assertion failure involving
the former. (DLR)
statusq()
- Rename variable which_history to history_list, for
consistency. (DLR)
- Rename variables def and ret to curranswer and retval to avoid
confusion. (DLR)
- Call wnoutrefresh(bottomwin) after getting an answer and
blanking out the statusbar, to make sure that the blanking is
done. This fixes a problem where the statusbar is not
properly blanked after using the "Go To Line" prompt with the
NO_HELP flag set. (DLR)
titlebar()
- Use actual_x() to calculate the number of characters VERMSG
takes up, in case it's UTF-8. (DLR)
do_cursorpos()
- Properly display the value of totsize as unsigned. (DLR)
- If constant is TRUE, only display the cursor position when
disable_cursorpos is FALSE. Don't refuse to display it when
the cursor position hasn't changed, as that doesn't always
keep it properly updated. (DLR, found by Mike Frysinger)
do_help()
- Don't treat NANO_CANCEL_KEY as NANO_EXIT_KEY anymore, for
consistency. (DLR)
statusbar()
- Set statusblank to 25 instead of 26, to match current Pico.
(DLR)
edit_redraw()
- Make do_refresh a bool instead of an int. (DLR)
do_yesno()
- Allow refreshing the screen via Ctrl-L, as Pico does. (DLR)
- Add a missing assert, and use actual_x() to calculate the
number of characters buf takes up, in case it's UTF-8. (DLR)
- Get input from bottomwin instead of edit, so that the cursor
isn't erroneously put in the edit window while we wait for an
answer. (DLR)
- Call wnoutrefresh(edit) to make sure that the edit window is
refreshed before we get input, as statusq() does. (DLR)
total_redraw()
- Simplify to just call wrefresh() on curscr, which updates the
entire screen in one function call without moving the cursor
from the window it's currently in. (DLR)
- When using slang, use SLsmg_touch_screen() and SLsmg_refresh()
to update the screen, as slang doesn't define curscr. (DLR)
do_replace_highlight()
- Use waddch() instead of waddstr() to display a space when we
have a zero-length regex. (DLR)
- Rename variable highlight_flag to highlight, for consistency.
(DLR)
do_credits()
- Save the keystroke that breaks us out of the credits (if any)
and put it back so that it isn't lost. This is especially
needed if the keystroke is part of a multibyte character.
(DLR)
- nano.1:
- Clarify and consolidate the descriptions of --fill and
--tabsize. (DLR)
- nanorc.5:
- Update the description of how the "color" regex works. (DLR)
- Clarify descriptions of the characters that aren't allowed
in the "punct" or "brackets" options. (DLR)
- Use .B instead of \fB ... \fP where possible, as nano.1 does.
(DLR)
- Clarify and consolidate the descriptions of "fill" and
"tabsize". (DLR)
- nano.texi:
- Update the "Feature Toggles" section to match current nano.
(DLR)
- Clarify and consolidate the descriptions of --fill and
--tabsize. (DLR)
- configure.ac:
- Minor tweaks to some of the test blocks to avoid XSI:isms.
(DLR, adapted from a Debian patch for GNU ed by David
Weinehall)
- Don't refer to the built-in file browser as crappy anymore.
(DLR)
- Check for iswpunct() and mbstowcs(). (DLR)
- Change the behavior of --enable-extra to only define
NANO_EXTRA, instead of defining both it and
ENABLE_MULTIBUFFER. (DLR)
- Check for get_wch() instead of wget_wch() to determine if
there's a wide curses library, as it's a more generic
function. (DLR)
- Check for possibly unavailable functions in alphabetical
order. (DLR)
- doc/faq.html:
- Update section 1.1 to mention the current maintainer. (DLR)
- Minor capitalization and wording fixes. (DLR)
- Update description of --enable-extra, and add missing line
breaks. (DLR)
- doc/nanorc.sample:
- In the "nanorc" regexes, tweak the "color" regex to properly
color a line that specifies a background color without a
foreground color, and update the associated comments. (DLR)
- Clarify descriptions of the characters that aren't allowed
in the "punct" or "brackets" options. (DLR)
- Update comment referring to --enable-extra. (DLR)
- Add "cxx" and "hxx" to the list of extensions that the
"c-file" regexes apply to, and add "warning" and "error" to
them as well. (Mike Frysinger)
- Add regexes for assembler files. (Mike Frysinger)
- In the preprocessor directives regex string in the "c-file"
regexes, cover more whitespace characters than just " " by
using "[[:space:]]" instead. (Mike Frysinger) DLR: Extend
this to other regex strings whenever possible.
- Move some overly long split-up regex strings that cover
similar areas onto the same line. (DLR)
- Add GCC builtins to the "c-file" regexes. (Mike Frysinger)
- Simplify the file extension regex for groff. (DLR)
- Clarify and consolidate the descriptions of "fill" and
"tabsize". (DLR)
- Makefile.am, m4/Makefile.am:
- Make sure that the files in EXTRA_DIST are in alphabetical
order, and that the lines are wrapped at 72 characters. (DLR)
- doc/man/fr/Makefile.am:
- Set mandir to @mandir@/fr, so French manpages get installed
where they belong (Jordi).
- THANKS:
- Add new translators to the credits.
GNU nano 1.3.7 - 2005.04.10
- General:
- Miscellaneous comment fixes. (DLR)
@@ -441,7 +906,7 @@ GNU nano 1.3.6 - 2005.03.20
- Refresh bottomwin using the value of currshortcut, and change
the code around do_refresh() calls to accommodate this. (DLR)
- Split out the code that updates the screen before refreshing
it into the new function total_update().
it into the new function total_redraw().
do_help()
- Refresh the screen when Ctrl-L is pressed in the help browser,
as Pico does. (DLR)
@@ -526,7 +991,7 @@ GNU nano 1.3.5 - 2004.11.22
functions open_file(), execute_command(), and mallocstrassn();
changes to read_line(), load_file(), read_file(), open_file(),
get_next_filename(), do_insertfile(), do_insertfile_void(),
do_alt_speller(), and edit_refresh(). (David Benbennick) DLR:
do_alt_speller(), and edit_refresh(). (David Benbennick) DLR:
Add a few minor fixes to make sure that current is set
properly in all cases, indicate on the statusbar when the file
has a mix of DOS and Mac format lines, move the test for DOS

View File

@@ -3,8 +3,8 @@ AUTOMAKE_OPTIONS = gnu no-dependencies
SUBDIRS = doc m4 po src
EXTRA_DIST = ABOUT-NLS AUTHORS BUGS COPYING ChangeLog INSTALL NEWS \
README THANKS TODO UPGRADE config.rpath install-sh missing \
mkinstalldirs nano.spec
EXTRA_DIST = ABOUT-NLS AUTHORS BUGS COPYING ChangeLog INSTALL NEWS \
README THANKS TODO UPGRADE config.rpath install-sh \
missing mkinstalldirs nano.spec
ACLOCAL_AMFLAGS = -I m4

19
NEWS
View File

@@ -1,3 +1,22 @@
2005.06.30 - GNU nano 1.3.8 floats at its own level. This release
contains several new features. Among other things, you
can now move to a specified column number as well as
line number within a file, file backups saved in a
backup directory will have unique names, the search and
replace history routines should work more consistently,
you can get a word count by pressing Meta-D at the edit
window, and there's a new -E/--tabstospaces option to
convert all typed tabs to spaces (--backupdir's short
option has been changed to -C). In terms of bugfixes,
this release contains fixes for minor problems with
screen updates, UTF-8 display, and flow control; a fix
for a segfault when displaying some lines ending with
tabs; better handling of constant cursor position
display; improved color parsing in the rcfile; and
support for the "Regexp" toggle in tiny mode
(-R/--regexp is gone, and --restricted's short option
has been changed to -R), among other things. Enjoy.
2005.04.10 - GNU nano 1.3.7 claws its way to the top. This release
mostly contains bugfixes for the massive amount of new
code in 1.3.6. Among other things, nano builds with

View File

@@ -30,8 +30,8 @@ $ setenv CVS_RSH ssh
After it's set up, use the following command to download the CVS tree:
$ cvs -z3 -d:ext:anoncvs@savannah.gnu.org:/cvsroot/nano checkout nano
If you want to download the stable CVS branch, add "-r nano_1_0_branch":
$ cvs -z3 -d:ext:anoncvs@savannah.gnu.org:/cvsroot/nano checkout -r nano_1_0_branch nano
If you want to download the stable CVS branch, add "-r nano_1_2_branch":
$ cvs -z3 -d:ext:anoncvs@savannah.gnu.org:/cvsroot/nano checkout -r nano_1_2_branch nano
Once you have the sources in the "nano" directory, cd into it, and
execute the "autogen.sh" script in the top directory. This will set up

1
THANKS
View File

@@ -37,6 +37,7 @@ Pierre Tane <tanep@bigfoot.com> French translator
Jacobo Tarrío <jtarrio@trasno.net> Galician translator
Kjetil Torgrim Homme <kjetilho@linpro.no> Norwegian nynorsk translator
Miquel Vidal <miquel@sindominio.net> Catalan translator
Phan Vinh Thinh <teppi82@gmail.com> Vietnamese translator
Pauli Virtanen <pauli.virtanen@saunalahti.fi> Finnish translator
Peio Ziarsolo <peio@sindominio.net> Basque translator

2
TODO
View File

@@ -6,7 +6,7 @@ For version 1.4:
- Support for paragraph searches. [DONE]
- Support for justifying the entire file at once. [DONE]
- Support for filename searches in the file browser.
- Undo/Redo key?
- Undo/Redo keys?
- Rebindable keys?
- Keystroke to implement "Add next sequence as raw" like vi's ^V. [DONE]
- Spell check selected text only. [DONE]

View File

@@ -2,24 +2,24 @@
#
# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# 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 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,
# 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.
# 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
# Foundation, Inc.
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
# USA.
#
# $Id$
AC_INIT([GNU nano], [1.3.7], [nano-devel@gnu.org], [nano])
AC_INIT([GNU nano], [1.3.8], [nano-devel@gnu.org], [nano])
AC_CONFIG_SRCDIR([src/nano.c])
AC_CANONICAL_TARGET([])
AM_INIT_AUTOMAKE
@@ -28,6 +28,7 @@ AC_CONFIG_HEADERS([config.h])
AC_PREREQ(2.54)
dnl Checks for programs.
AC_GNU_SOURCE
AC_PROG_CC
AC_PROG_LN_S
@@ -35,10 +36,12 @@ AC_ISC_POSIX
AC_SYS_LARGEFILE
dnl Internationalization macros.
AM_GNU_GETTEXT_VERSION(0.11.5)
AM_GNU_GETTEXT([external], [need-ngettext])
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h getopt.h libintl.h limits.h regex.h termios.h wchar.h wctype.h)
AC_CHECK_HEADER(regex.h,
@@ -75,17 +78,16 @@ if test x$debug_support != xyes; then
fi
AC_ARG_ENABLE(extra,
[ --enable-extra Enable extra (optional) functions, including easter eggs],
[ --enable-extra Enable extra features, currently only easter eggs],
[if test x$enableval = xyes; then
AC_DEFINE(NANO_EXTRA, 1, [Define this to enable the extra stuff.]) extra_support=yes
AC_DEFINE(ENABLE_MULTIBUFFER, 1, [Define this to enable multiple file buffers.]) multibuffer_support=yes
fi])
AC_ARG_ENABLE(tiny,
[ --enable-tiny Disable features for the sake of size],
[if test x$enableval = xyes; then
AC_DEFINE(NANO_SMALL, 1, [Define this to make the nano executable as small as possible.]) tiny_support=yes
AC_DEFINE(DISABLE_BROWSER, 1, [Define this to disable the built-in (crappy) file browser.])
AC_DEFINE(DISABLE_BROWSER, 1, [Define this to disable the built-in file browser.])
AC_DEFINE(DISABLE_HELP, 1, [Define this to disable the help menu.])
AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routine.])
AC_DEFINE(DISABLE_MOUSE, 1, [Define this to disable the mouse functions.])
@@ -97,7 +99,7 @@ fi])
AC_ARG_ENABLE(browser,
[ --disable-browser Disable mini file browser],
[if test x$enableval != xyes; then
AC_DEFINE(DISABLE_BROWSER, 1, [Define this to disable the built-in (crappy) file browser.])
AC_DEFINE(DISABLE_BROWSER, 1, [Define this to disable the built-in file browser.])
fi])
AC_ARG_ENABLE(help,
@@ -396,13 +398,13 @@ int main(void)
dnl Checks for functions.
AC_CHECK_FUNCS(snprintf vsnprintf isblank strcasecmp strncasecmp strcasestr strnlen getline getdelim)
AC_CHECK_FUNCS(getdelim getline isblank snprintf strcasecmp strcasestr strncasecmp strnlen vsnprintf)
if test x$enable_utf8 != xno; then
AC_CHECK_FUNCS(iswalnum mblen mbtowc wctomb wcwidth iswspace iswblank)
AC_CHECK_FUNCS(iswalnum iswblank iswpunct iswspace mblen mbstowcs mbtowc wctomb wcwidth)
fi
if test x$ac_cv_func_snprintf = xno -o x$ac_cv_func_vsnprintf = xno; then
if test x$ac_cv_func_snprintf = xno || test x$ac_cv_func_vsnprintf = xno; then
AM_PATH_GLIB_2_0(2.0.0,,
AC_MSG_ERROR([
*** snprintf() and/or vsnprintf() not found. GLIB 2.x not found either.
@@ -414,7 +416,6 @@ fi
dnl Checks for typedefs, structures, and compiler characteristics.
dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(getopt_long)
@@ -425,7 +426,7 @@ if eval "test x$CURSES_LIB_NAME = x"; then
AC_CHECK_HEADERS(ncurses.h)
if test x$enable_utf8 != xno; then
AC_CHECK_LIB(ncursesw, wget_wch, [CURSES_LIB="-lncursesw" CURSES_LIB_NAME=ncursesw CURSES_LIB_WIDE=yes])
AC_CHECK_LIB(ncursesw, get_wch, [CURSES_LIB="-lncursesw" CURSES_LIB_NAME=ncursesw CURSES_LIB_WIDE=yes])
fi
if eval "test x$CURSES_LIB_NAME = x"; then
@@ -437,7 +438,7 @@ if eval "test x$CURSES_LIB_NAME = x"; then
AC_CHECK_HEADERS(curses.h)
if test x$enable_utf8 != xno; then
AC_CHECK_LIB(curses, wget_wch, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses CURSES_LIB_WIDE=yes])
AC_CHECK_LIB(curses, get_wch, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses CURSES_LIB_WIDE=yes])
fi
if eval "test x$CURSES_LIB_NAME = x"; then
@@ -470,14 +471,16 @@ if test "x$GLIB_LIBS" != "x"; then
fi
if test x$enable_utf8 != xno && \
test x$CURSES_LIB_WIDE = xyes -a \
x$ac_cv_func_iswalnum = xyes -a \
x$ac_cv_func_mblen = xyes -a \
x$ac_cv_func_mbtowc = xyes -a \
x$ac_cv_func_wctomb = xyes -a \
x$ac_cv_func_wcwidth = xyes && \
test x$ac_cv_func_iswspace = xyes -o x$ac_cv_func_iswblank = xyes; then
AC_DEFINE(NANO_WIDE, 1, [Define this if your system has sufficient wide character support (a wide curses library, iswalnum(), iswspace() or iswblank(), mblen(), mbtowc(), wctomb(), and wcwidth()).])
test x$CURSES_LIB_WIDE = xyes && \
test x$ac_cv_func_iswalnum = xyes && \
test x$ac_cv_func_iswpunct = xyes && \
(test x$ac_cv_func_iswblank = xyes || test x$ac_cv_func_iswspace = xyes) && \
test x$ac_cv_func_mblen = xyes && \
test x$ac_cv_func_mbstowcs = xyes && \
test x$ac_cv_func_mbtowc = xyes && \
test x$ac_cv_func_wctomb = xyes && \
test x$ac_cv_func_wcwidth = xyes; then
AC_DEFINE(NANO_WIDE, 1, [Define this if your system has sufficient wide character support (a wide curses library, iswalnum(), iswpunct(), iswblank() or iswspace(), mblen(), mbstowcs(), mbtowc(), wctomb(), and wcwidth()).])
else
if test x$enable_utf8 = xyes; then
AC_MSG_ERROR([

View File

@@ -62,7 +62,7 @@
<hr width="100%">
<h1><a name="1"></a>1. General</h1>
<h2><a name="1.1"></a>1.1 About this FAQ</h2>
<blockquote><p>This FAQ was written and is maintained by Chris Allegretta &lt;<a href="mailto:chrisa@asty.org">chrisa@asty.org</a>&gt;, who also happens to be the creator of nano. Maybe someone else will volunteer to maintain this FAQ someday, who knows...</p></blockquote>
<blockquote><p>This FAQ was originally written and maintained by Chris Allegretta &lt;<a href="mailto:chrisa@asty.org">chrisa@asty.org</a>&gt;, who also happens to be the creator of nano. It is currently maintained by David Lawrence Ramsey &lt;<a href="mailto:pooka_regent@sluggy.net">pooka_regent@sluggy.net</a>&gt;. Maybe someone else will volunteer to maintain this FAQ someday, who knows...</p></blockquote>
<h2><a name="1.2"></a>1.2. How do I contribute to it?</h2>
<blockquote><p>Your best bet is to send it to the nano email address, <a href="mailto:nano@nano-editor.org">nano@nano-editor.org</a> and if it is useful enough it will be included in future versions.</p></blockquote>
<h2><a name="1.3"></a>1.3. What is GNU nano?</h2>
@@ -80,7 +80,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 &quot;establishes a full duplex terminal connection to a remote host&quot;, 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.3.7. 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.8. 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.3/nano.1.html">here</a>.</p></blockquote>
<hr width="100%">
@@ -154,7 +154,7 @@
<p>There's also the <b>--enable-tiny</b> option which disables everything above, as well as some larger chunks of the program (like the marker code that you use Control-^ to select with). Also, if you know you aren't going to be using other languages you can use <b>--disable-nls</b> to disable internationalization and save a few K to a few dozen K depending on if you have locale support on your system. And finally there's always good old <b>strip</b> to strip all debugging code and code that exists in libraries on your system.</p>
<p>If, on the other hand, you can't live without bells and whistles, you could try:</p>
<pre>
<b>--enable-extra</b> Enable extra functions, including easter eggs
<b>--enable-extra</b> Enable extra features, currently only easter eggs
<b>--enable-nanorc</b> Enable use of .nanorc file
<b>--enable-color</b> Enable color and syntax highlighting
<b>--enable-multibuffer</b> Enable having multiple file buffers open
@@ -163,10 +163,10 @@
Turn off wrapping of text by default when the
user is root</pre></blockquote>
<h2><a name="3.7"></a>3.7. Tell me more about this multibuffer stuff!</h2>
<blockquote><p>To use multiple file buffers, you must be using nano 1.1.0 or newer, and you must have configured nano with <b>--enable-multibuffer</b> or <b>--enable-extra</b> (use nano -V to check). Then when you want to enable inserting a file into its own buffer instead of into the current file, just hit <b>Meta-F</b>, then insert the file as normal with <b>^R</b>. If you always want files to be loaded into their own buffers, use the <b>--multibuffer</b> or <b>-F</b> flag when you invoke nano.</p>
<blockquote><p>To use multiple file buffers, you must be using nano 1.1.0 or newer, and you must have configured nano with <b>--enable-multibuffer</b> (use nano -V to check). Then when you want to enable inserting a file into its own buffer instead of into the current file, just hit <b>Meta-F</b>, then insert the file as normal with <b>^R</b>. If you always want files to be loaded into their own buffers, use the <b>--multibuffer</b> or <b>-F</b> flag when you invoke nano.</p>
<p>You can move between the buffers you have open with the <b>Meta-&lt;</b> and <b>Meta-&gt;</b> keys, or more easily with <b>Meta-,</b> and <b>Meta-.</b> (clear as mud, right? =-). When you have more than one file buffer open, the ^X shortcut will say &quot;Close&quot;, instead of the normal &quot;Exit&quot; when only one buffer is open.</p></blockquote>
<h2><a name="3.8"></a>3.8. Tell me more about this verbatim input stuff!</h2>
<blockquote><p>To use verbatim input, you must be using nano 1.3.1 or newer. When you want to insert a literal character into the file you're editing, such as a control character that nano usually treats as a command, first press <b>Meta-V</b>. (If you're not at a prompt, you'll get the message &quot;Verbatim input&quot;.) Then press the key(s) that generate the character you want.</p>
<blockquote><p>To use verbatim input, you must be using nano 1.3.1 or newer. When you want to insert a literal character into the file you're editing, such as a control character that nano usually treats as a command, first press <b>Meta-V</b>. (If you're not at a prompt, you'll get the message &quot;Verbatim Input&quot;.) Then press the key(s) that generate the character you want.</p>
<p>Alternatively, you can press <b>Meta-V</b> and then type a four-digit hexadecimal code from 0000 to ffff (case-insensitive), and the character with the corresponding value will be inserted instead.</p></blockquote>
<h2><a name="3.9"></a>3.9. How do I make a .nanorc file that nano will read when I start it?</h2>
<blockquote><p>It's not hard at all! But, your version of nano must have been compiled with <b>--enable-nanorc</b>, and again must be version 1.1.12 or newer (use nano -V to check your version and compiled features). Then simply copy the <b>nanorc.sample</b> that came with the nano source or your nano package (most likely in /usr/doc/nano) to .nanorc in your home directory. If you didn't get one, the syntax is simple. Flags are turned on and off by using the word <b>set</b> and the getopt_long flag for the feature, for example &quot;set nowrap&quot; or &quot;set suspend&quot;.</p></blockquote>
@@ -250,6 +250,9 @@
<h2><a name="8"></a>8. ChangeLog</h2>
<blockquote>
<p>
2005/06/15 - Update description of --enable-extra, and add missing line breaks. (DLR)<br>
2005/06/13 - Minor capitalization and wording fixes. (DLR)<br>
2005/06/08 - Updated section 1.1 to mention the current maintainer. (DLR)<br>
2005/03/09 - Added question about opening files with names beginning with '+'s, and added a few more miscellaneous cosmetic fixes. (DLR)<br>
2005/01/03 - Removed now-inaccurate note about verbatim input's not working at prompts, and update its description to mention that it handles hexadecimal values now. (DLR)<br>
2004/11/21 - Listed sh as an example of a Bourne shell. (DLR)<br>

View File

@@ -1,5 +1,7 @@
man_MANS = nano.1 nanorc.5
mandir = @mandir@/fr
BUILT_SOURCES = nano.1.html nanorc.5.html
nano.1.html: nano.1

View File

@@ -6,7 +6,7 @@
.\" Public License for copying conditions. There is NO warranty.
.\"
.\" $Id$
.TH NANO 1 "version 1.3.7" "March 26, 2005"
.TH NANO 1 "version 1.3.8" "June 27, 2005"
.\" Please adjust this date whenever revising the manpage.
.\"
@@ -15,7 +15,7 @@ nano \- Nano's ANOther editor, an enhanced free Pico clone
.SH SYNOPSIS
.B nano
.I [\+LINE]\ [options]\ [file]
.I [\+LINE,COLUMN]\ [options]\ [file]
.br
.SH DESCRIPTION
@@ -32,9 +32,9 @@ replace" and "go to line number".
.SH OPTIONS
.TP
.B \+\fILINE\fP
Places cursor at line number \fILINE\fP on startup, instead of the
default of line 1.
.B \+\fILINE\fP,\fICOLUMN\fP
Places cursor at line number \fILINE\fP and column number \fICOLUMN\fP
on startup, instead of the default of line 1, column 1.
.TP
.B \-?
Same as \fB-h (\-\-help)\fP.
@@ -50,25 +50,23 @@ line.
When saving a file, back up the previous version of it to the current
filename suffixed with a ~.
.TP
.B \-E \fIdir\fP (\-\-backupdir=\fIdir\fP)
Set the directory where \fBnano\fP puts the backup files if file backups
are enabled.
.B \-C \fIdir\fP (\-\-backupdir=\fIdir\fP)
Set the directory where \fBnano\fP puts unique backup files if file
backups are enabled.
.TP
.B \-E (\-\-tabstospaces)
Convert typed tabs to spaces.
.TP
.B \-F (\-\-multibuffer)
Enable multiple file buffers, if available.
.TP
.B \-H (\-\-historylog)
Log search and replace strings to
.I ~/.nano_history
so they may be stored for later editing, if nanorc support is
configured.
Log search and replace strings to \fI~/.nano_history\fP so they can be
stored for later editing, if nanorc support is configured.
.TP
.B \-I (\-\-ignorercfiles)
Don't look at
.I SYSCONFDIR/nanorc
or
.IR ~/.nanorc ,
if nanorc support is available.
Don't look at \fISYSCONFDIR/nanorc\fP or \fI~/.nanorc\fP, if nanorc
support is available.
.TP
.B \-N (\-\-noconvert)
Disable automatic conversion of files from DOS/Mac format.
@@ -81,34 +79,35 @@ Set the quoting string for justifying. The default is
"^([\ \\t]*[|>:}#])+" if regular expression support is available, or
">\ " otherwise.
.TP
.B \-R (\-\-regexp)
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
usual chunk-by-chunk behavior.
.TP
.B \-T \fIcols\fP (\-\-tabsize=\fIcols\fP)
Set the size (width) of a tab to \fIcols\fP columns.
.TP
.B \-V (\-\-version)
Show the current version number and author.
.TP
.B \-Y \fIstr\fP (\-\-syntax=\fIstr\fP)
Specify a specific syntax highlighting from the
.I nanorc
to use, if available.
.TP
.B \-Z (\-\-restricted)
.B \-R (\-\-restricted)
Restricted mode: Don't read or write to any file not specified on the
command line, read any nanorc files, allow suspending, or allow a file
to be appended to, prepended to, or saved under a different name if it
already has one. Also accessible by invoking \fBnano\fP with any name
beginning with 'r' (e.g. "rnano").
.TP
.B \-S (\-\-smooth)
Enable smooth scrolling. Text will scroll line-by-line, instead of the
usual chunk-by-chunk behavior.
.TP
.B \-T \fIcols\fP (\-\-tabsize=\fIcols\fP)
Set the size (width) of a tab to \fIcols\fP columns. The value of
\fIcols\fP must be greater than 0. The default value is 8.
.TP
.B \-U (\-\-quickblank)
Do quick statusbar blanking. Statusbar messages will disappear after 1
keystroke instead of 25. Note that \fB-c\fP cancels this out.
.TP
.B \-V (\-\-version)
Show the current version number and author.
.TP
.B \-Y \fIstr\fP (\-\-syntax=\fIstr\fP)
Specify a specific syntax highlighting from the \fInanorc\fP to use, if
available.
.TP
.B \-c (\-\-const)
Constantly show the cursor position.
Constantly show the cursor position. Note that this cancels out
\fB-U\fP.
.TP
.B \-d (\-\-rebinddelete)
Interpret the Delete key differently so that both Backspace and Delete
@@ -128,8 +127,7 @@ Enable cut from cursor to end of line.
.B \-l (\-\-nofollow)
If the file being edited is a symbolic link, replace the link with
a new file instead of following it. Good for editing files in
.IR /tmp ,
perhaps?
\fI/tmp\fP, perhaps?
.TP
.B \-m (\-\-mouse)
Enable mouse support (if available for your system).
@@ -143,16 +141,17 @@ 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
to vary along with the screen width if resized.
Wrap lines at column \fIcols\fP. If this value is 0 or less, wrapping
will occur at the width of the screen less \fIcols\fP columns, allowing
the wrap point to vary along with the width of the screen if the screen
is resized. The default value is -8.
.TP
.B \-s \fIprog\fP (\-\-speller=\fIprog\fP)
Enable alternative spell checker command.
.TP
.B \-t (\-\-tempfile)
Always save changed buffer without prompting. Same as Pico's -t option.
Always save changed buffer without prompting. Same as Pico's \fB-t\fP
option.
.TP
.B \-v (\-\-view)
View file (read only) mode.
@@ -171,13 +170,9 @@ Ignored, for compatibility with Pico.
.SH INITIALIZATION FILE
\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.
\fISYSCONFDIR/nanorc\fP, then \fI~/.nanorc\fP. Please see
\fBnanorc(5)\fP and the example file \fBnanorc.sample\fP, both of which
should be provided with \fBnano\fP.
.SH NOTES
If no alternative spell checker command is specified on the command
@@ -187,25 +182,20 @@ line or in one of the nanorc files, \fBnano\fP will check the
\fBnano\fP will try to dump the buffer into an emergency file in some
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
respective emergency files.
named \fInano.save\fP 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 their respective emergency files.
.SH BUGS
Please send any comments or bug reports to
.BR nano@nano-editor.org .
Please send any comments or bug reports to \fBnano@nano-editor.org\fP.
The \fBnano\fP mailing list is available from
.BR nano-devel@gnu.org .
The \fBnano\fP mailing list is available from \fBnano-devel@gnu.org\fP.
To subscribe, email to
.B nano-devel-request@gnu.org
with a subject of "subscribe".
To subscribe, email to \fBnano-devel-request@gnu.org\fP with a subject
of "subscribe".
.SH HOMEPAGE
http://www.nano-editor.org/
@@ -218,10 +208,7 @@ http://www.nano-editor.org/
\fI/usr/share/doc/nano/\fP (or equivalent on your system)
.SH AUTHOR
Chris Allegretta <chrisa@asty.org>, et al (see
.I AUTHORS
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).
Chris Allegretta <chrisa@asty.org>, et al (see \fIAUTHORS\fP and
\fITHANKS\fP 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).

View File

@@ -6,7 +6,7 @@
.\" Public License for copying conditions. There is NO warranty.
.\"
.\" $Id$
.TH NANORC 5 "version 1.3.7" "March 26, 2005"
.TH NANORC 5 "version 1.3.8" "June 27, 2005"
.\" Please adjust this date whenever revising the manpage.
.\"
.SH NAME
@@ -22,15 +22,14 @@ replace" and "go to line number".
.PP
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 ,
and then user-specific settings from
.IR ~/.nanorc .
\fISYSCONFDIR/nanorc\fP, and then user-specific settings from
\fI~/.nanorc\fP.
.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
command-line options. Additionally, the "syntax", "color", and "icolor"
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
@@ -41,73 +40,83 @@ Options are unset by default, except for options that take an argument.
The supported commands and arguments are:
.TP 3
\fBset/unset autoindent\fP
.B set/unset autoindent
Use auto-indentation.
.TP
\fBset/unset backup\fP
Create backup files in
.IR filename~ .
.B set/unset backup
Create backup files in \fIfilename~\fP.
.TP
\fBset backupdir "\fIdirectory\fP"\fP
Set the directory where \fBnano\fP puts the backup files if file backups
are enabled.
\fBset brackets "\fIstring\fP"\fP
.B set backupdir "\fIdirectory\fP"
Set the directory where \fBnano\fP puts unique backup files if file
backups are enabled.
.TP
.B set/unset backwards
Do backwards searches by default.
.TP
.B set brackets "\fIstring\fP"
Set the characters treated as closing brackets. They cannot contain
tabs or spaces. Only closing punctuation, optionally followed by
blank characters. Only closing punctuation, optionally followed by
closing brackets, can end sentences.
.TP
\fBset/unset const\fP
.B set/unset casesensitive
Do case sensitive searches by default.
.TP
.B set/unset const
Constantly display the cursor position in the status bar.
.TP
\fBset/unset cut\fP
.B set/unset cut
Use cut to end of line by default.
.TP
\fBset fill \fIn\fP\fP
Wrap lines at column number \fIn\fP. If \fIn\fP is 0 or less, the line
length will be the screen width less \fIn\fP. The default value is -8.
.B set fill \fIn\fP
Wrap lines at column number \fIn\fP. If \fIn\fP is 0 or less, the
maximum line length will be the screen width less \fIn\fP columns. The
default value is -8.
.TP
\fBset/unset historylog\fP
Enable
.I ~/.nano_history
for saving and reading search/replace strings.
.B set/unset historylog
Enable \fI~/.nano_history\fP for saving and reading search/replace
strings.
.TP
\fBset/unset morespace\fP
.B set/unset morespace
Allow use of the blank line below the titlebar as extra editing space.
.TP
\fBset/unset mouse\fP
.B set/unset mouse
Enable mouse support, so that mouse clicks can be used to set the mark
and run shortcuts.
.TP
\fBset/unset multibuffer\fP
.B set/unset multibuffer
Allow inserting files into their own buffers.
.TP
\fBset/unset noconvert\fP
.B set/unset noconvert
Don't convert files from DOS/Mac format.
.TP
\fBset/unset nofollow\fP
.B set/unset nofollow
Don't follow symlinks when writing files.
.TP
\fBset/unset nohelp\fP
.B set/unset nohelp
Don't display the help lists at the bottom of the screen.
.TP
\fBset/unset nowrap\fP
.B set/unset nowrap
Don't wrap text at all.
.TP
\fBset operatingdir "\fIdirectory\fP"\fP
.B set operatingdir "\fIdirectory\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.
.TP
\fBset/unset preserve\fP
.B set/unset preserve
Preserve the XON and XOFF keys (^Q and ^S).
.TP
\fBset punct "\fIstring\fP"\fP
.B set punct "\fIstring\fP"
Set the characters treated as closing punctuation. They cannot contain
tabs or spaces. Only closing punctuation, optionally followed by
blank characters. Only closing punctuation, optionally followed by
closing brackets, can end sentences.
.TP
\fBset quotestr "\fIstring\fP"\fP
.B set quickblank
Do quick statusbar blanking. Statusbar messages will disappear after 1
keystroke instead of 25.
.TP
.B set quotestr "\fIstring\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
@@ -117,67 +126,77 @@ otherwise a literal string. The default value is
if you have regexps, otherwise set quotestr ">\ ". Note that '\\t'
above stands for a literal Tab character.
.TP
\fBset/unset rebinddelete\fP
.B set/unset 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
\fBset/unset regexp\fP
.B set/unset regexp
Do regular expression searches by default.
.TP
\fBset/unset smarthome\fP
.B set/unset smarthome
Make the Home key smarter. When Home is pressed anywhere but at the
very beginning of non-whitespace characters on a line, the cursor will
jump to that beginning (either forwards or backwards). If the cursor is
already at that position, it will jump to the true beginning of the
line.
.TP
\fBset/unset smooth\fP
.B set/unset smooth
Use smooth scrolling by default.
.TP
\fBset speller \fIspellprog\fP\fP
.B set speller \fIspellprog\fP
Use spelling checker \fIspellprog\fP instead of the built-in one, which
calls \fIspell\fP.
.TP
\fBset/unset suspend\fP
.B set/unset suspend
Allow nano to be suspended.
.TP
\fBset tabsize \fIn\fP\fP
Use a tab size of \fIn\fP columns instead of the default (8); must be
greater than 0.
.B set tabsize \fIn\fP
Use a tab size of \fIn\fP columns. The value of \fIn\fP must be greater
than 0. The default value is 8.
.TP
\fBset/unset tempfile\fP
.B set/unset tabstospaces
Convert typed tabs to spaces.
.TP
.B set/unset tempfile
Save automatically on exit, don't prompt.
.TP
\fBset/unset view\fP
.B set/unset view
Disallow file modification.
.TP
\fBset whitespace "\fIstring\fP"\fP
.B set whitespace "\fIstring\fP"
Set the two characters used to display the first characters of tabs and
spaces. They must be single-column characters.
.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.
\fIfileregex\fP. All following \fBcolor\fP and \fBicolor\fP statements
will apply to \fIsyntax\fP until a new syntax is defined.
.TP
.B color \fIfgcolor\fP[,\fIbgcolor\fP] "\fIregex\fP" ...
.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
\fBnano\fP to attempt to use a transparent background.
\fIregex\fP with foreground color \fIfgcolor\fP and background color
\fIbgcolor\fP, at least one of which must be specified. 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 for the foreground. 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"
.B icolor \fIfgcolor\fP,\fIbgcolor\fP "\fIregex\fP" ...
Same as above, except that the expression matching is case insensitive.
.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.
\fI
with foreground color \fIfgcolor\fP and background color \fIbgcolor\fP,
at least one of which must be specified. 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.
.TP
.B icolor \fIfgcolor\fP,\fIbgcolor\fP start="\fIsr\fP" end="\fIer\fP"
Same as above, except that the expression matching is case insensitive.
.SH FILES
.TP
@@ -194,9 +213,6 @@ Per-user configuration file
\fI/usr/share/doc/nano/examples/nanorc.sample\fP (or equivalent on your
system)
.SH AUTHOR
Chris Allegretta <chrisa@asty.org>, et al (see
.I AUTHORS
and
.I THANKS
for details).
This manual page was written by Jordi Mallach <jordi@gnu.org>.
Chris Allegretta <chrisa@asty.org>, et al (see \fIAUTHORS\fP and
\fITHANKS\fP for details). This manual page was written by Jordi
Mallach <jordi@gnu.org>.

View File

@@ -14,23 +14,30 @@
## Backup files to filename~.
# set backup
## The directory to put the backup files in.
## The directory to put unique backup files in.
# set backupdir ""
## The characters treated as closing brackets. They cannot contain tabs
## or spaces. Only closing punctuation, optionally followed by closing
## brackets, can end sentences.
## Do backwards searches by default.
# set backwards
## The characters treated as closing brackets. They cannot contain
## blank characters. Only closing punctuation, optionally followed by
## closing brackets, can end sentences.
##
# set brackets "'")}]>"
## Constantly display the cursor position in the status bar.
## Do case sensitive searches by default.
# set casesensitive
## Constantly display the cursor position in the statusbar. Note that
## this cancels out "quickblank".
# set const
## Use cut to end of line by default.
# set cut
## Set the line length for wrapping text and justifying paragraphs.
## If fill is negative, the line length will be the screen width less
## If fill is 0 or less, the line length will be the screen width less
## this number.
##
# set fill -8
@@ -47,7 +54,7 @@
## Allow multiple file buffers (inserting a file will put it into a
## separate buffer). You must have configured with --enable-multibuffer
## or --enable-extra for this to work.
## for this to work.
##
# set multibuffer
@@ -74,11 +81,16 @@
# set preserve
## The characters treated as closing punctuation. They cannot contain
## tabs or spaces. Only closing punctuation, optionally followed by
## blank characters. Only closing punctuation, optionally followed by
## closing brackets, can end sentences.
##
# set punct ".?!"
## Do quick statusbar blanking. Statusbar messages will disappear after
## 1 keystroke instead of 25. Note that "const" cancels this out.
##
# set quickblank
## 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. Default:
@@ -115,6 +127,9 @@
## Use this tab size instead of the default; it must be greater than 0.
# set tabsize 8
## Convert typed tabs to spaces.
# set tabstospaces
## Save automatically on exit, don't prompt.
# set tempfile
@@ -127,36 +142,49 @@
# set whitespace " "
## Color setup
##
## Format:
##
## syntax "short description" ["filename regex" ...]
##
## color foreground,background "regex" ["regex"...]
## or
## icolor foreground,background "regex" ["regex"...]
##
## "color" will do case sensitive matches, while "icolor" will do case
## insensitive matches.
##
## Legal colors: white, black, red, blue, green, yellow, magenta, cyan.
## You may use the prefix "bright" to mean a stronger color highlight.
## You may use the prefix "bright" to mean a stronger color highlight
## for the foreground.
##
## To use multi-line regexes use the start="regex" end="regex" format.
## To use multi-line regexes, use the start="regex" end="regex" format.
##
## If your system supports transparency, not specifying a background
## color will use a transparent color. If you don't want this, be sure
## to set the background color to black or white.
##
# syntax "c-file" "\.(c|C|cc|cpp|h|H|hh|hpp)$"
# syntax "c-file" "\.(c|C|cc|cpp|cxx|h|H|hh|hpp|hxx)$"
# color red "\<[A-Z_]{2,}\>"
# color green "\<(float|double|bool|char|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|signed|unsigned|inline)\>"
# color green "\<(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\>"
# color brightyellow "\<(for|if|while|do|else|case|default|switch|goto|continue|break|return)\>"
# color brightyellow "\<(try|throw|catch|operator|new|delete)\>"
# color brightcyan "^ *# *(define|undef|include|ifn?def|endif|elif|else|if)"
# color brightcyan "^[[:space:]]*#[[:space:]]*(define|undef|include|ifn?def|endif|elif|else|if|warning|error)"
# color brightmagenta "'([^\]|(\\['abfnrtv\\]))'" "'\\(([0-7][0-7]?)|([0-3][0-7][0-7]))'" "'\\x[0-9A-Fa-f][0-9A-Fa-f]?'"
##
## GCC builtins
##
# color cyan "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(asm|builtin|inline|restrict|typeof)__"
##
## 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=""(\\.|[^\"])*\\[[:space:]]*$" end="^(\\.|[^\"])*""
##
## And we want to have some nice comment highlighting too
# color brightblue "//.*"
@@ -165,7 +193,7 @@
## Here is a short example for HTML
# syntax "HTML" "\.html$"
# color blue start="<" end=">"
# color red "&[^; ]*;"
# color red "&[^;[[:space:]]]*;"
## Here is a short example for TeX files
# syntax "TeX" "\.tex$"
@@ -179,10 +207,10 @@
## Here is an example for groff
##
# syntax "groff" "\.ms$" "\.mm$" "\.me$" "\.tmac$" "^tmac." ".rof"
# syntax "groff" "\.m[ems]$" "\.tmac$" "^tmac." ".rof"
## The argument of .nr or .ds
# color cyan "^\.ds [^ ]*"
# color cyan "^\.nr [^ ]*"
# color cyan "^\.ds [^[[:space:]]]*"
# color cyan "^\.nr [^[[:space:]]]*"
## Single character escapes
# color brightmagenta "\\."
## Highlight the argument of \f or \s in the same color
@@ -194,7 +222,7 @@
# color cyan "(\\|\\\\)n\(.."
# color cyan start="(\\|\\\\)n\[" end="]"
## Requests
# color brightgreen "^\. *[^ ]*"
# color brightgreen "^\.[[:space:]]*[^[[:space:]]]*"
## Comments
# color yellow "^\.\\\".*$"
## Strings
@@ -210,11 +238,7 @@
## Here is an example for perl
##
# syntax "perl" "\.p[lm]$"
# color red "\<(accept|alarm|atan2|bin(d|mode)|c(aller|h(dir|mod|op|own|root)|lose(dir)?|onnect|os|rypt)|d(bm(close|open)|efined|elete|ie|o|ump)|e(ach|of|val|x(ec|ists|it|p))|f(cntl|ileno|lock|ork))\>"
# color red "\<(get(c|login|peername|pgrp|ppid|priority|pwnam|(host|net|proto|serv)byname|pwuid|grgid|(host|net)byaddr|protobynumber|servbyport)|([gs]et|end)(pw|gr|host|net|proto|serv)ent|getsock(name|opt)|gmtime|goto|grep|hex|index|int|ioctl|join)\>"
# color red "\<(keys|kill|last|length|link|listen|local(time)?|log|lstat|m|mkdir|msg(ctl|get|snd|rcv)|next|oct|open(dir)?|ord|pack|pipe|pop|printf?|push|q|qq|qx|rand|re(ad(dir|link)?|cv|do|name|quire|set|turn|verse|winddir)|rindex|rmdir|s|scalar|seek(dir)?)\>"
# color red "\<(se(lect|mctl|mget|mop|nd|tpgrp|tpriority|tsockopt)|shift|shm(ctl|get|read|write)|shutdown|sin|sleep|socket(pair)?|sort|spli(ce|t)|sprintf|sqrt|srand|stat|study|substr|symlink|sys(call|read|tem|write)|tell(dir)?|time|tr(y)?|truncate|umask)\>"
# color red "\<(un(def|link|pack|shift)|utime|values|vec|wait(pid)?|wantarray|warn|write)\>"
# color red "\<(accept|alarm|atan2|bin(d|mode)|c(aller|h(dir|mod|op|own|root)|lose(dir)?|onnect|os|rypt)|d(bm(close|open)|efined|elete|ie|o|ump)|e(ach|of|val|x(ec|ists|it|p))|f(cntl|ileno|lock|ork))\>" "\<(get(c|login|peername|pgrp|ppid|priority|pwnam|(host|net|proto|serv)byname|pwuid|grgid|(host|net)byaddr|protobynumber|servbyport)|([gs]et|end)(pw|gr|host|net|proto|serv)ent|getsock(name|opt)|gmtime|goto|grep|hex|index|int|ioctl|join)\>" "\<(keys|kill|last|length|link|listen|local(time)?|log|lstat|m|mkdir|msg(ctl|get|snd|rcv)|next|oct|open(dir)?|ord|pack|pipe|pop|printf?|push|q|qq|qx|rand|re(ad(dir|link)?|cv|do|name|quire|set|turn|verse|winddir)|rindex|rmdir|s|scalar|seek(dir)?)\>" "\<(se(lect|mctl|mget|mop|nd|tpgrp|tpriority|tsockopt)|shift|shm(ctl|get|read|write)|shutdown|sin|sleep|socket(pair)?|sort|spli(ce|t)|sprintf|sqrt|srand|stat|study|substr|symlink|sys(call|read|tem|write)|tell(dir)?|time|tr(y)?|truncate|umask)\>" "\<(un(def|link|pack|shift)|utime|values|vec|wait(pid)?|wantarray|warn|write)\>"
# color magenta "\<(continue|else|elsif|do|for|foreach|if|unless|until|while|eq|ne|lt|gt|le|ge|cmp|x|my|sub|use|package|can|isa)\>"
# color cyan start="[$@%]" end="( |\\W|-)"
# color yellow "".*"|qq\|.*\|"
@@ -234,7 +258,7 @@
# color blue "//.*"
# color blue start="/\*" end="\*/"
# color brightblue start="/\*\*" end="\*/"
# color brightgreen,green " +$"
# color brightgreen,green "[[:space:]]+$"
## Here is an example for patch files
##
@@ -257,19 +281,34 @@
# color brightwhite "\\f[BIPR]"
# color yellow "\.(br|DS|RS|RE|PD)"
## Here is an example for assembler
##
# syntax "asm-file" "\.(S|s|asm)$"
# color red "\<[A-Z_]{2,}\>"
# color brightgreen "\.(data|subsection|text)"
# color green "\.(align|file|globl|global|hidden|section|size|type|weak)"
# color brightyellow "\.(ascii|asciz|byte|double|float|hword|int|long|short|single|struct|word)"
# icolor brightred "^[[:space:]]*[._A-Z0-9]*:"
# color brightcyan "^[[:space:]]*#[[:space:]]*(define|undef|include|ifn?def|endif|elif|else|if|warning|error)"
## Highlight strings (note: VERY resource intensive)
# color brightyellow "<[^= ]*>" ""(\\.|[^\"])*""
# color brightyellow start=""(\\.|[^\"])*\\[[:space:]]*$" end="^(\\.|[^\"])*""
## Highlight comments
# color brightblue "//.*"
# color brightblue start="/\*" end="\*/"
## Here is an example for your .nanorc
##
# syntax "nanorc" "(\.|/|)nanorc$"
## highlight possible errors and parameters
# color brightwhite "^ *(set|unset|syntax|color).*$"
# icolor brightwhite "^[[:space:]]*(set|unset|syntax|i?color).*$"
## set, unset and syntax
# color cyan "^ *(set|unset) +(autoindent|backup|backupdir|brackets|const|cut|fill|historylog|morespace|mouse|multibuffer|noconvert|nofollow|nohelp|nowrap|operatingdir|preserve|punct|quotestr|rebinddelete|regexp|smarthome|smooth|speller|suspend|tabsize|tempfile)\>"
# color cyan "^ *(set|unset) +(view|whitespace)"
# color green "^ *(set|unset|syntax)\>"
# icolor cyan "^[[:space:]]*(set|unset)[[:space:]]+(autoindent|backup|backupdir|backwards|brackets|casesensitive|const|cut|fill|historylog|morespace|mouse|multibuffer|noconvert|nofollow|nohelp|nowrap|operatingdir|preserve|punct|quickblank|quotestr|rebinddelete)\>" "^[[:space:]]*(set|unset)[[:space:]]+(regexp|smarthome|smooth|speller|suspend|tabsize|tabstospaces|tempfile|view|whitespace)\>"
# icolor green "^[[:space:]]*(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)="
# icolor yellow "^[[:space:]]*i?color[[:space:]]*(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>"
# icolor magenta "^[[:space:]]*i?color\>" "\<(start|end)="
## strings
# color white "\"(\\.|[^\"])*\""
# icolor white "\"(\\.|[^\"])*\""
## comments
# color blue "^ *#.*$"
# icolor blue "^[[:space:]]*#.*$"

View File

@@ -8,8 +8,8 @@
@c Run `makeinfo' rather than `texinfo-format-buffer'.
@smallbook
@set EDITION 0.1
@set VERSION 1.3.7
@set UPDATED 26 Mar 2005
@set VERSION 1.3.8
@set UPDATED 27 Jun 2005
@dircategory Editors
@direntry
@@ -23,7 +23,7 @@
@titlepage
@title GNU @code{nano}
@subtitle a small and friendly text editor.
@subtitle version 1.3.7
@subtitle version 1.3.8
@author Chris Allegretta
@page
@@ -91,7 +91,7 @@ internationalization support, and filename tab completion.
@node Overview, Command Line Options, Introduction, Introduction
@section Overview
@code{nano} +LINE [GNU long option] [option] [ @var{file ...} ]
@code{nano} +LINE,COLUMN [GNU long option] [option] [ @var{file ...} ]
The original goal for @code{nano} was a complete bug-for-bug compatible
emulation of Pico, but @code{nano}'s main goal is to be as compatible as
@@ -106,8 +106,9 @@ Email bug reports to @email{nano@@nano-editor.org}.
@code{nano} takes the following options from the command line:
@table @code
@item +LINE
Start at line number LINE instead of the default of line 1.
@item +LINE,COLUMN
Start at line number LINE and column number COLUMN instead of the
default of line 1, column 1.
@item -?
Same as @code{-h, --help}.
@@ -123,10 +124,13 @@ line.
When saving a file, back up the previous version of it to the current
filename suffixed with a ~.
@item -E, --backupdir=[dir]
Set the directory where @code{nano} puts the backup files if file
@item -C, --backupdir=[dir]
Set the directory where @code{nano} puts unique backup files if file
backups are enabled.
@item -E, --tabstospaces
Convert typed tabs to spaces.
@item -F, --multibuffer
Enable multiple file buffers, if available.
@@ -147,14 +151,23 @@ Set the quoting string for justifying. The default is
if regular expression support is available, or ``> '' otherwise. Note
that @code{\t} above stands for a literal Tab character.
@item -R, --regexp
Turn on regular expression search and search/replace.
@item -R, --restricted
Restricted mode: Don't read or write to any file not specified on the
command line, read any nanorc files, allow suspending, or allow a file
to be appended to, prepended to, or saved under a different name if it
already has one. Also accessible by invoking @code{nano} with any name
beginning with 'r' (e.g. "rnano").
@item -S, --smooth
Enable smooth scrolling.
@item -T [num], --tabsize=[#cols]
Set the displayed tab length to [#cols] columns.
Set the displayed tab length to #cols columns. The value of #cols must
be greater than 0. The default value is 8.
@item -U, --quickblank
Do quick statusbar blanking. Statusbar messages will disappear after 1
keystroke instead of 25. Note that -c cancels this out.
@item -V, --version
Print the version number and copyright and quit.
@@ -163,15 +176,9 @@ Print the version number and copyright and quit.
Specify a specific syntax highlighting from the .nanorc to use, if
available.
@item -Z, --restricted
Restricted mode: Don't read or write to any file not specified on the
command line, read any nanorc files, allow suspending, or allow a file
to be appended to, prepended to, or saved under a different name if it
already has one. Also accessible by invoking @code{nano} with any name
beginning with 'r' (e.g. "rnano").
@item -c, --const
Constantly display the cursor position and line number on the statusbar.
Note that this cancels out -U.
@item -d, --rebinddelete
Interpret the Delete key differently so that both Backspace and Delete
@@ -205,10 +212,10 @@ 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.
Wrap lines at column #cols. If this value is 0 or less, wrapping will
occur at #cols less the width of the screen, allowing it to vary along
with the width of the screen if the screen is resized. The default
value is -8.
@item -s [prog], --speller=[prog]
Invoke [prog] as the spell checker. By default, @code{nano} uses the
@@ -340,13 +347,16 @@ The following global toggles are available:
@table @code
@item Backup File Toggle (Meta-B)
@item Backup Files Toggle (Meta-B)
toggles the -B (@code{--backup}) command line flag.
@item Constant Cursor Position Display Toggle (Meta-C)
toggles the -c (@code{--const}) command line flag.
@item Multiple File Buffers Toggle (Meta-F)
toggles the -F (@code{--multibuffer}) command line flag.
@item Backup File Toggle (Meta-H)
@item Smart Home Key Toggle (Meta-H)
toggles the -A (@code{--smarthome}) command line flag.
@item Auto Indent Toggle (Meta-I)
@@ -355,21 +365,35 @@ toggles the -i (@code{--autoindent}) command line flag.
@item Cut To End Toggle (Meta-K)
toggles the -k (@code{--cut}) command line flag.
@item Auto Line Wrap Toggle (Meta-L)
@item Long Line Wrapping Toggle (Meta-L)
toggles the -w (@code{--nowrap}) command line flag.
@item Mouse Toggle (Meta-M)
@item Mouse Support Toggle (Meta-M)
toggles the -m (@code{--mouse}) command line flag.
@item More Space Toggle (Meta-O)
@item No Conversion From DOS/Mac Format Toggle (Meta-N)
toggles the -N (@code{--noconvert}) command line flag.
@item More Space For Editing Toggle (Meta-O)
toggles the -O (@code{--morespace}) command line flag.
@item Whitespace Display Toggle (Meta-P)
toggles whitespace display mode if you have a "whitespace" option in
your .nanorc.
@item Tabs to Spaces Toggle (Meta-Q)
toggles the -E (@code{--tabstospaces}) command line flag.
@item Smooth Scrolling Toggle (Meta-S)
toggles the -S (@code{--smooth}) command line flag.
@item Expert/Nohelp Toggle (Meta-X)
@item Expert/No Help Toggle (Meta-X)
toggles the -x (@code{--nohelp}) command line flag.
@item Color Syntax Highlighting Toggle (Meta-Y)
toggles color syntax highlighting if you have color syntaxes in your
.nanorc.
@item Suspend Toggle (Meta-Z)
toggles the -z (@code{--suspend}) command line flag.

View File

@@ -1,4 +1,5 @@
EXTRA_DIST = ulonglong.m4 intdiv0.m4 inttypes.m4 inttypes_h.m4 inttypes-pri.m4 \
stdint_h.m4 uintmax_t.m4 isc-posix.m4 lib-ld.m4 lib-link.m4 \
lib-prefix.m4 codeset.m4 glibc21.m4 progtest.m4 gettext.m4 \
iconv.m4 lcmessage.m4 glib-2.0.m4
EXTRA_DIST = codeset.m4 gettext.m4 glib-2.0.m4 glibc21.m4 iconv.m4 \
intdiv0.m4 inttypes_h.m4 inttypes.m4 inttypes-pri.m4 \
isc-posix.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 \
lib-prefix.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 \
ulonglong.m4

View File

@@ -1,3 +1,59 @@
2005-06-28 David Lawrence Ramsey <pooka_regent@sluggy.net>
* POTFILES.in: Remove source files that contain no translatable
strings.
2005-06-19 David Lawrence Ramsey <pooka_regent@sluggy.net>
* pt_BR.po: Typo fix.
2005-06-15 Jordi Mallach <jordi@gnu.org>
* de.po: Typo fix by Jens Seidel.
2005-05-23 Jordi Mallach <jordi@gnu.org>
* fr.po: Updated French translation by
Jean-Philippe Guérard.
2005-04-27 Jordi Mallach <jordi@gnu.org>
* ms.po: Updated Malay translation by
Sharuzzaman Ahmat Raslan.
2005-04-22 Jordi Mallach <jordi@gnu.org>
* ca.po: Updated Norwegian bokmål translation by
Geir Helland.
2005-04-20 Jordi Mallach <jordi@gnu.org>
* ms.po: Updated Malay translation by
Sharuzzaman Ahmat Raslan.
* ro.po: Updated Romanian translation by Laurentiu Buzdugan.
* zh_TW.po: Updated Traditional Chinese translation by
CHAO Wei-Lun.
2005-04-18 Jordi Mallach <jordi@gnu.org>
* vi.po: Updated Vietnamese translation by Phan Vinh Thinh.
2005-04-18 Jordi Mallach <jordi@gnu.org>
* ca.po: Updated Catalan translation.
* it.po: Updated Italian translation by Marco Colombo.
* ro.po: Updated Romanian translation by Laurentiu Buzdugan.
2005-04-14 Jordi Mallach <jordi@gnu.org>
* es.po: Updated Spanish translation by
Ricardo Javier Cárdenes Medina.
2005-04-13 Jordi Mallach <jordi@gnu.org>
* vi.po: New Vietnamese translation by Phan Vinh Thinh.
* LINGUAS: Added "vi".
2005-04-09 Jordi Mallach <jordi@gnu.org>
* zh_TW.po: Added Plural-Forms header and fix format specification

View File

@@ -1,2 +1,2 @@
# List of available languages.
ca cs da de es eu fi fr gl hu id it ms nb nl nn pl pt_BR ro ru rw sr sv tr uk zh_TW
ca cs da de es eu fi fr gl hu id it ms nb nl nn pl pt_BR ro ru rw sr sv tr uk vi zh_TW

View File

@@ -1,17 +1,10 @@
# $Id$
# List of source files containing translatable strings.
# Package source files
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
src/nano.h
src/proto.h

396
po/ca.po

File diff suppressed because it is too large Load Diff

View File

@@ -174,7 +174,7 @@ msgstr "Dateiname zum Speichern"
#: src/files.c:1910
msgid "File exists, OVERWRITE ? "
msgstr "Datei exisitiert, ÜBERSCHREIBEN? "
msgstr "Datei existiert, ÜBERSCHREIBEN? "
#: src/files.c:1923
msgid "Save file under DIFFERENT NAME ? "

1156
po/es.po

File diff suppressed because it is too large Load Diff

396
po/fr.po

File diff suppressed because it is too large Load Diff

438
po/it.po

File diff suppressed because it is too large Load Diff

822
po/ms.po

File diff suppressed because it is too large Load Diff

1144
po/nb.po

File diff suppressed because it is too large Load Diff

View File

@@ -1333,7 +1333,7 @@ msgstr ""
"Cor %s não foi entendida.\n"
"Cores válidas são \"green\" (verde), \"red\" (vermelho), \n"
"\"blue\" (azul), \"yellow\" (amarelo), \"cyan\" (ciano), \n"
"\"magente\" (maguenta) e \"black\" (preto), com o prefixo \n"
"\"magenta\" (maguenta) e \"black\" (preto), com o prefixo \n"
"opcional \"bright\" (claro) para cores de fundo."
#: src/rcfile.c:253 src/search.c:61

435
po/ro.po

File diff suppressed because it is too large Load Diff

View File

@@ -5,19 +5,20 @@
#
# Copyright (C) 2000 Free Software Foundation.
#
# This script 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 of the
# License, or (at your option) any later version.
# This script 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 of the License, or (at
# your option) any later version.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# This script 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 library; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
# USA.
#
# Authors: Kenneth Christiansen <kenneth@gnu.org>
#

1548
po/vi.po Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +1,16 @@
# Traditional Chinese Messages for the nano editor
# Copyright (C) 2004,2005 Free Software Foundation, Inc.
# Copyright (C) 2004, 05 Free Software Foundation, Inc.
# This file is distributed under the same license as the nano package.
# Wei-Lun Chao <chaoweilun@pcmail.com.tw>, 2004, 05
#
msgid ""
msgstr ""
"Project-Id-Version: nano 1.3.6\n"
"Project-Id-Version: nano 1.3.7\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2005-04-09 11:38+0200\n"
"PO-Revision-Date: 2005-04-08 13:22+0800\n"
"POT-Creation-Date: 2005-04-12 20:54-0400\n"
"PO-Revision-Date: 2005-04-19 14:25+0800\n"
"Last-Translator: Wei-Lun Chao <chaoweilun@pcmail.com.tw>\n"
"Language-Team: zh_TW <zh-l10n@linux.org.tw>\n"
"Language-Team: Chinese (traditional) <zh-l10n@linux.org.tw>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -49,7 +49,6 @@ msgstr "新檔案"
msgid "\"%s\" not found"
msgstr "找不到 \"%s\""
#. Don't open character or block files. Sorry, /dev/sndstat!
#: src/files.c:355
#, c-format
msgid "\"%s\" is a directory"
@@ -60,8 +59,6 @@ msgstr "\"%s\" 是一個目錄"
msgid "File \"%s\" is a device file"
msgstr "\"%s\" 是一個裝置檔案"
#. We can't open this dir for some reason.
#. * Complain.
#: src/files.c:359 src/files.c:367 src/files.c:1403 src/files.c:1469
#: src/files.c:1526 src/files.c:1625 src/files.c:2564 src/files.c:2580
#: src/files.c:2639 src/files.c:2848 src/rcfile.c:717
@@ -111,13 +108,12 @@ msgstr "非多重緩衝區模式中此按鍵無效"
msgid "No more open file buffers"
msgstr "無多餘檔案緩衝區可開啟"
#. And indicate the switch on the statusbar.
#: src/files.c:932
#, c-format
msgid "Switched to %s"
msgstr "切換至 %s"
#: src/files.c:933 src/global.c:258 src/winio.c:2783
#: src/files.c:933 src/global.c:258 src/winio.c:2782
msgid "New Buffer"
msgstr "新緩衝區"
@@ -242,7 +238,7 @@ msgstr "置換"
msgid "Go To Line"
msgstr "跳列"
#: src/global.c:239 src/winio.c:3685
#: src/global.c:239 src/winio.c:3684
msgid "Cancel"
msgstr "取消"
@@ -514,55 +510,38 @@ msgstr "跳至目錄"
msgid "Close"
msgstr "關閉"
#. Translators: try to keep this string under 10 characters long
#: src/global.c:401
msgid "WriteOut"
msgstr "寫入"
#. Translators: try to keep this string under 10 characters long
#: src/global.c:406
msgid "Justify"
msgstr "對齊"
#. We allow inserting files in view mode if multibuffers are
#. * available, so that we can view multiple files.
#. If we're using restricted mode, inserting files is disabled since
#. * it allows reading from or writing to files not specified on the
#. * command line.
#. Translators: try to keep this string under 10 characters long
#: src/global.c:422
msgid "Read File"
msgstr "讀檔"
#. Translators: try to keep this string under 10 characters long
#: src/global.c:434
msgid "Where Is"
msgstr "搜尋"
#. Translators: try to keep this string under 10 characters long
#: src/global.c:449
msgid "Cut Text"
msgstr "剪下文字"
#. Translators: try to keep this string under 10 characters long
#: src/global.c:455
msgid "UnJustify"
msgstr "還原對齊"
#. Translators: try to keep this string under 10 characters long
#: src/global.c:460
msgid "UnCut Txt"
msgstr "還原剪下"
#. Translators: try to keep this string under 10 characters long
#: src/global.c:465
msgid "Cur Pos"
msgstr "游標位置"
#. If we're using restricted mode, spell checking is disabled
#. * because it allows reading from or writing to files not specified
#. * on the command line.
#. Translators: try to keep this string under 10 characters long
#: src/global.c:473
msgid "To Spell"
msgstr "拼字檢查"
@@ -643,7 +622,6 @@ msgstr "原形輸入"
msgid "Find Other Bracket"
msgstr "尋找其他括號"
#. Translators: try to keep this string under 12 characters long
#: src/global.c:709
msgid "No Replace"
msgstr "不置換"
@@ -674,13 +652,12 @@ msgstr "備份檔案"
#: src/global.c:920
msgid "Execute Command"
msgstr "外部命令"
msgstr "執行命令"
#: src/global.c:969
msgid "Insert File"
msgstr "插入檔案"
#. Translators: try to keep this string under 22 characters long
#: src/global.c:1010
msgid "Go To Dir"
msgstr "跳至目錄"
@@ -772,105 +749,80 @@ msgid "Window size is too small for nano...\n"
msgstr "視窗尺寸對 nano 而言太小了...\n"
#: src/nano.c:286
#, fuzzy
msgid ""
"Search Command Help Text\n"
"\n"
" Enter the words or characters you would like to search for, and then press "
"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, and then press 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. "
" The previous search string will be shown in brackets after the search prompt. Hitting Enter without entering any text will perform the previous search. "
msgstr ""
"搜尋命令輔助說明\n"
"\n"
" 首先輸入你想要搜尋的字串或字元,然後按下輸入鍵 (Enter)。如果存在著符合 你所"
"輸入的文字,畫面就會更新到最合乎搜尋字串的位置。\n"
"\n"
" 前次搜尋的字串將會顯示在 搜尋: 提示符號後面的括號中。不輸入任何文字而 直接按"
"下輸入鍵則會履行前次的搜尋。如果你已經用標記選擇了一段文字並進行 搜尋替換,就"
"只有在選擇文字中符合者將會被替換。\n"
"\n"
" 以下的功能鍵可用於搜尋模式: \n"
" 首先輸入你想要搜尋的字串或字元,然後按下輸入鍵 (Enter)。如果存在著 符合你所輸入的文字,畫面就會更新到最合乎搜尋字串的位置。\n"
"\n"
" 前次搜尋的字串將會顯示在 搜尋: 提示符號後面的括號中。不輸入任何文字 而直接按下輸入鍵則會履行前次的搜尋。"
#: src/nano.c:295
msgid ""
"If you have selected text with the mark and then search to replace, only "
"matches in the selected text will be replaced.\n"
"If you have selected text with the mark and then search to replace, only matches in the selected text will be replaced.\n"
"\n"
" The following function keys are available in Search mode:\n"
"\n"
msgstr ""
"如果你已經用標記選擇了一段文字 並進行搜尋替換,就只有在選擇文字中符合者將會被替換。\n"
"\n"
" 以下的功能鍵可用於搜尋模式:\n"
"\n"
#: src/nano.c:301
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 ""
"跳列輔助說明\n"
"\n"
" 首先輸入你想去的列數編號並按下輸入鍵 (Enter)。如果文章中的列數比你所輸 入要"
"少,你將會被帶至檔案的最後一列。\n"
" 首先輸入你想去的列數編號並按下輸入鍵 (Enter)。如果文章中的列數比你所輸 入要少,你將會被帶至檔案的最後一列。\n"
"\n"
" 以下的功能鍵可用於跳列模式: \n"
"\n"
#: src/nano.c:310
#, fuzzy
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 file 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). "
" If you have compiled nano with multiple file buffer support, and enable multiple file 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). "
msgstr ""
"插入檔案輔助說明\n"
"\n"
" 先把檔案的名稱鍵入,它將會插入在目前緩衝區的游標所在之處。\n"
"\n"
" 如果你所編譯的 nano 支援多重檔案緩衝區,並且將此功能以命令列旗標 -F 或 --"
"multibuffer、Meta-F 開關,或者 nanorc 檔案來啟動的話,所插入的檔案 將會被載入"
"另外的緩衝區中 (利用 Meta-< 和 > 在檔案緩衝區間切換)。如果 你需要另一個空的緩"
"衝區,那就不要輸入任何檔名,或是在提示符號後鍵入一個 不存在的檔名,然後按下輸"
"入鍵。\n"
"\n"
" 以下的功能鍵可用於插入檔案模式: \n"
"\n"
" 如果你所編譯的 nano 支援多重檔案緩衝區,並且將此功能以命令列旗標 -F 或 --multibuffer、Meta-F 開關,或者 nanorc 檔案來啟動的話,所插入的檔案 將會被載入另外的緩衝區中 (利用 Meta-< 和 > 在檔案緩衝區間切換)。 "
#: src/nano.c:319
msgid ""
"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 ""
"如果你需要另一個空的緩衝區,那就不要輸入任何檔名,或是在提示符號後鍵 入一個不存在的檔名,然後按下輸入鍵。\n"
"\n"
" 以下的功能鍵可用於插入檔案模式:\n"
"\n"
#: src/nano.c:325
#, fuzzy
msgid ""
"Write File Help Text\n"
"\n"
" Type the name that you wish to save the current file as and press Enter to "
"save the file.\n"
" Type the name that you wish to save the current file as and press Enter to save the file.\n"
"\n"
" If you have selected text with the mark, 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 the mark, 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"
@@ -879,9 +831,7 @@ msgstr ""
"\n"
" 先鍵入你想要以此來儲存目前檔案的名稱,並按下輸入鍵來儲存檔案。\n"
"\n"
" 如果已經用標記選擇了文字,那麼你將會被提示,只儲存標記部份到另外的檔 案。為"
"了降低目前檔案只被其中部份覆寫的機會,在此模式下,目前的檔名不會 成為預設"
"值。\n"
" 如果已經用標記選擇了文字,那麼你將會被提示,只儲存標記部份到另外的檔 案。為了降低目前檔案只被其中部份覆寫的機會,在此模式下,目前的檔名不會 成為預設值。\n"
"\n"
" 以下的功能鍵可用於寫入檔案模式: \n"
"\n"
@@ -890,20 +840,14 @@ 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 ""
"檔案選單輔助說明\n"
"\n"
" 檔案選單是用來視覺化瀏覽目錄結構,以選取要讀出或寫入的檔案。你可以 使用上下"
"左右鍵或上頁/下頁來瀏覽,並用 S 或輸入鍵來選取所要的檔案或者 進入所選的目錄。"
"要跳到上層時,選擇在檔案列表頂端名為 \"..\" 的目錄。\n"
" 檔案選單是用來視覺化瀏覽目錄結構,以選取要讀出或寫入的檔案。你可以 使用上下左右鍵或上頁/下頁來瀏覽,並用 S 或輸入鍵來選取所要的檔案或者 進入所選的目錄。要跳到上層時,選擇在檔案列表頂端名為 \"..\" 的目錄。\n"
"\n"
" 以下的功能鍵可用於檔案選單: \n"
"\n"
@@ -914,8 +858,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"
@@ -924,8 +867,7 @@ msgstr ""
"\n"
" 先輸入你想要瀏覽的目錄名稱。\n"
"\n"
" 如果跳格補正的功能沒有被關閉,你可以利用跳格鍵 (TAB) 去 (嘗試) 自動補正目錄"
"名稱。\n"
" 如果跳格補正的功能沒有被關閉,你可以利用跳格鍵 (TAB) 去 (嘗試) 自動 補正目錄名稱。\n"
"\n"
" 以下的功能鍵可用於跳至目錄模式: \n"
"\n"
@@ -934,98 +876,65 @@ msgstr ""
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, or, if you have selected text with the "
"mark, in the selected text.\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, or, if you have selected text with the mark, in the selected text.\n"
"\n"
" The following other functions are available in Spell Check mode:\n"
"\n"
msgstr ""
"拼字檢查輔助說明\n"
"\n"
" 拼字檢查程式會檢查目前檔案中所有文字的拼法。當遇到一個未知的字,它會 被標記"
"起來,並讓你編輯替代文字。對於目前檔案中每一個拼錯的字,都會顯示 置換的提示;"
"或者,如果已經用標記選擇了文字的話,那就只作用於選取的文字 之中。\n"
" 拼字檢查程式會檢查目前檔案中所有文字的拼法。當遇到一個未知的字,它會 被標記起來,並讓你編輯替代文字。對於目前檔案中每一個拼錯的字,都會顯示 置換的提示;或者,如果已經用標記選擇了文字的話,那就只作用於選取的文字 之中。\n"
"\n"
" 以下的功能鍵可用於拼字檢查模式: \n"
"\n"
#: src/nano.c:380
#, fuzzy
msgid ""
"Execute 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 multiple file buffer mode). If "
"you need another blank buffer, do not enter any command.\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 multiple file buffer mode). If you need another blank buffer, do not enter any command.\n"
"\n"
" The following keys are available in Execute Command mode:\n"
"\n"
msgstr ""
"外部命令輔助說明\n"
"執行命令輔助說明\n"
"\n"
" 本選單允許你將 shell 執行的命令輸出結果,插入目前的緩衝區 (或是多重緩衝 區模"
"式下的新緩衝區)。如果你需要另一個空白緩衝區,就不要輸入任何命令。\n"
" 本選單允許你將 shell 執行的命令輸出結果,插入目前的緩衝區 (或是多重緩衝 區模式下的新緩衝區)。如果你需要另一個空白緩衝區,就不要輸入任何命令。\n"
"\n"
" 以下的功能鍵可用於外部命令模式: \n"
" 以下的功能鍵可用於執行命令模式: \n"
"\n"
#. Default to the main help list.
#: src/nano.c:393
#, fuzzy
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"
" "
msgstr ""
"nano 輔助說明\n"
"\n"
" nano 編輯器是設計來在功能性及易用性方面,模仿華盛頓大學的 Pico 文字 編輯器。"
"它含有四個主要部份:頂列顯示程式版本、目前被編輯的檔案名稱, 以及是否這檔案已"
"經更動過。接著是主要編輯區,顯示正在編輯的檔案。狀態 列位於倒數第三列,用來顯"
"示重要的訊息。底部的兩列則顯示編輯器中最常用 到的快捷鍵。\n"
"\n"
" 快捷鍵的記號如以下所定義:控制鍵組 (Control-key) 序列是以一個 \"帽子"
"\" (caret, ^) 符號來表示,它可以藉由控制鍵 (Ctrl) 或是按兩次脫離鍵 (Esc) 來輸"
"入。脫離鍵組 (Escape-key) 序列是以 \"中介\" (Meta, M) 符號表示,它 可以依照你"
"的鍵盤設定,利用 EscAlt 或 Meta 來輸入。另外,按 Esc 兩次 之後再鍵入從 000 "
"到 255 之間的三位數字,則會輸入該 ASCII 碼對應的字 元。下列按鍵組合可用於主要"
"編輯區,替代按鍵則顯示於括弧內: \n"
" nano 編輯器是設計來在功能性及易用性方面,模仿華盛頓大學的 Pico 文字 編輯器。它含有四個主要部份:頂列顯示程式版本、目前被編輯的檔案名稱, 以及是否這檔案已經更動過。接著是主要編輯區,顯示正在編輯的檔案。狀態 列位於倒數第三列,用來顯示重要的訊息。底部的兩列則顯示編輯器中最常用 到的快捷鍵。\n"
"\n"
" "
#: src/nano.c:404
msgid ""
"The notation for shortcuts is as follows: Control-key sequences are notated "
"with a caret (^) symbol and can be entered either by using the Control "
"(Ctrl) key or pressing the Escape (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. "
msgstr ""
msgid "The notation for shortcuts is as follows: Control-key sequences are notated with a caret (^) symbol and can be entered either by using the Control (Ctrl) key or pressing the Escape (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. "
msgstr "快捷鍵的記號定義如下:控制鍵組 (Control-key) 序列是以一個 \"帽子\" (caret, ^) 符號來表示,它可以藉由控制鍵 (Ctrl) 或是按兩次脫離鍵 (Esc) 來輸入。脫離鍵組 (Escape-key) 序列是以 \"中介\" (Meta, M) 符號表示,它 可以依照你的鍵盤設定,利用 EscAlt 或 Meta 來輸入。"
#: src/nano.c:411
msgid ""
"Also, pressing Esc twice and then typing a three-digit decimal number from "
"000 to 255 will enter the character with the corresponding value. The "
"following keystrokes are available in the main editor window. Alternative "
"keys are shown in parentheses:\n"
"Also, pressing Esc twice and then typing a three-digit decimal number from 000 to 255 will enter the character with the corresponding value. The following keystrokes are available in the main editor window. Alternative keys are shown in parentheses:\n"
"\n"
msgstr ""
"另外,按 Esc 兩次 之後再鍵入從 000 到 255 之間的三位數字,則會輸入該 ASCII 碼對應的字 元。下列按鍵組合可用於主要編輯區,替代按鍵則顯示於括弧內:\n"
"\n"
#: src/nano.c:441 src/nano.c:572
msgid "enable/disable"
msgstr "開啟/關閉"
#: src/nano.c:477 src/winio.c:2958
#: src/nano.c:477 src/winio.c:2957
msgid "Up"
msgstr "Up"
@@ -1491,20 +1400,14 @@ msgstr "找不到 \"%.*s%s\""
msgid "Search"
msgstr "搜尋"
#. This string is just a modifier for the search prompt; no
#. * grammar is implied.
#: src/search.c:175
msgid " [Case Sensitive]"
msgstr " [符合大小寫]"
#. This string is just a modifier for the search prompt; no
#. * grammar is implied.
#: src/search.c:182
msgid " [Regexp]"
msgstr " [正規表示式]"
#. This string is just a modifier for the search prompt; no
#. * grammar is implied.
#: src/search.c:189
msgid " [Backwards]"
msgstr " [向後搜尋]"
@@ -1555,101 +1458,91 @@ msgstr "別這樣,理性一點"
msgid "Not a bracket"
msgstr "並非一個括號"
#. Didn't find either a left or right bracket.
#: src/search.c:1115
msgid "No matching bracket"
msgstr "無對應括號"
#: src/utils.c:294 src/utils.c:304
#: src/utils.c:296 src/utils.c:306
msgid "nano is out of memory!"
msgstr "nano 已耗盡記憶體!"
#: src/winio.c:2758 src/winio.c:2763
#: src/winio.c:2757 src/winio.c:2762
msgid "Modified"
msgstr "已更動"
#: src/winio.c:2760
#: src/winio.c:2759
msgid "View"
msgstr "觀看"
#: src/winio.c:2779
#: src/winio.c:2778
msgid "DIR:"
msgstr "目錄:"
#: src/winio.c:2786
#: src/winio.c:2785
msgid "File:"
msgstr "檔案:"
#: src/winio.c:3139
#: src/winio.c:3138
msgid "Refusing zero-length regex match"
msgstr "拒絕符合長度為零的正規表示式"
#. String of yes characters accepted.
#. Same for no.
#. And all, surprise!
#. yesstr, nostr, and allstr are strings of any length. Each string
#. * consists of all characters accepted as a valid character for that
#. * value. The first value will be the one displayed in the
#. * shortcuts. Translators: if possible, specify both the shortcuts
#. * for your language and English. For example, in French: "OoYy"
#. * for "Oui".
#: src/winio.c:3657
#: src/winio.c:3656
msgid "Yy"
msgstr "Yy"
#: src/winio.c:3658
#: src/winio.c:3657
msgid "Nn"
msgstr "Nn"
#: src/winio.c:3659
#: src/winio.c:3658
msgid "Aa"
msgstr "Aa"
#: src/winio.c:3672
#: src/winio.c:3671
msgid "Yes"
msgstr "是"
#: src/winio.c:3677
#: src/winio.c:3676
msgid "All"
msgstr "全部"
#: src/winio.c:3682
#: src/winio.c:3681
msgid "No"
msgstr "否"
#: src/winio.c:3823
#: src/winio.c:3820
#, c-format
msgid "line %ld/%ld (%d%%), col %lu/%lu (%d%%), char %lu/%ld (%d%%)"
msgstr "列 %ld/%ld (%d%%), 行 %lu/%lu (%d%%), 字元 %lu/%ld (%d%%)"
#: src/winio.c:4130
#: src/winio.c:4127
msgid "The nano text editor"
msgstr "nano 文字編輯器"
#: src/winio.c:4131
#: src/winio.c:4128
msgid "version"
msgstr "版本"
#: src/winio.c:4132
#: src/winio.c:4129
msgid "Brought to you by:"
msgstr "來自於:"
#: src/winio.c:4133
#: src/winio.c:4130
msgid "Special thanks to:"
msgstr "特別感謝:"
#: src/winio.c:4134
#: src/winio.c:4131
msgid "The Free Software Foundation"
msgstr "自由軟體基金會"
#: src/winio.c:4135
#: src/winio.c:4132
msgid "For ncurses:"
msgstr "ncurses 部份:"
#: src/winio.c:4136
#: src/winio.c:4133
msgid "and anyone else we forgot..."
msgstr "以及其他我們不記得的人..."
#: src/winio.c:4137
#: src/winio.c:4134
msgid "Thank you for using nano!"
msgstr "謝謝你使用 nano"

View File

@@ -8,14 +8,15 @@
* 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. *
* 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. *
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301, USA. *
* *
**************************************************************************/
@@ -28,7 +29,6 @@
#include <ctype.h>
#include <assert.h>
#include "proto.h"
#include "nano.h"
#ifdef NANO_WIDE
#ifdef HAVE_WCHAR_H
@@ -39,6 +39,22 @@
#endif
#endif
#ifndef HAVE_ISBLANK
/* This function is equivalent to isblank(). */
bool nisblank(int c)
{
return isspace(c) && (c == '\t' || !is_cntrl_char(c));
}
#endif
#if !defined(HAVE_ISWBLANK) && defined(NANO_WIDE)
/* This function is equivalent to iswblank(). */
bool niswblank(wchar_t wc)
{
return iswspace(wc) && (wc == '\t' || !is_cntrl_wchar(wc));
}
#endif
/* Return TRUE if the value of c is in byte range, and FALSE
* otherwise. */
bool is_byte(int c)
@@ -46,19 +62,13 @@ bool is_byte(int c)
return ((unsigned int)c == (unsigned char)c);
}
/* This function is equivalent to isalnum(). */
bool is_alnum_char(int c)
{
return isalnum(c);
}
/* This function is equivalent to isalnum() for multibyte characters. */
bool is_alnum_mbchar(const char *c)
{
assert(c != NULL);
#ifdef NANO_WIDE
if (!ISSET(NO_UTF8)) {
if (ISSET(USE_UTF8)) {
wchar_t wc;
int c_mb_len = mbtowc(&wc, c, MB_CUR_MAX);
@@ -67,30 +77,10 @@ bool is_alnum_mbchar(const char *c)
wc = (unsigned char)*c;
}
return is_alnum_wchar(wc);
return iswalnum(wc);
} else
#endif
return is_alnum_char((unsigned char)*c);
}
#ifdef NANO_WIDE
/* This function is equivalent to isalnum() for wide characters. */
bool is_alnum_wchar(wchar_t wc)
{
return iswalnum(wc);
}
#endif
/* This function is equivalent to isblank(). */
bool is_blank_char(int c)
{
return
#ifdef HAVE_ISBLANK
isblank(c)
#else
isspace(c) && (c == '\t' || !is_cntrl_char(c))
#endif
;
return isalnum((unsigned char)*c);
}
/* This function is equivalent to isblank() for multibyte characters. */
@@ -99,7 +89,7 @@ bool is_blank_mbchar(const char *c)
assert(c != NULL);
#ifdef NANO_WIDE
if (!ISSET(NO_UTF8)) {
if (ISSET(USE_UTF8)) {
wchar_t wc;
int c_mb_len = mbtowc(&wc, c, MB_CUR_MAX);
@@ -108,26 +98,12 @@ bool is_blank_mbchar(const char *c)
wc = (unsigned char)*c;
}
return is_blank_wchar(wc);
return iswblank(wc);
} else
#endif
return is_blank_char((unsigned char)*c);
return isblank((unsigned char)*c);
}
#ifdef NANO_WIDE
/* This function is equivalent to isblank() for wide characters. */
bool is_blank_wchar(wchar_t wc)
{
return
#ifdef HAVE_ISWBLANK
iswblank(wc)
#else
iswspace(wc) && (wc == '\t' || !is_cntrl_wchar(wc))
#endif
;
}
#endif
/* This function is equivalent to iscntrl(), except in that it also
* handles control characters with their high bits set. */
bool is_cntrl_char(int c)
@@ -136,6 +112,16 @@ bool is_cntrl_char(int c)
(127 <= c && c < 160);
}
#ifdef NANO_WIDE
/* This function is equivalent to iscntrl() for wide characters, except
* in that it also handles wide control characters with their high bits
* set. */
bool is_cntrl_wchar(wchar_t wc)
{
return (0 <= wc && wc < 32) || (127 <= wc && wc < 160);
}
#endif
/* This function is equivalent to iscntrl() for multibyte characters,
* except in that it also handles multibyte control characters with
* their high bits set. */
@@ -144,7 +130,7 @@ bool is_cntrl_mbchar(const char *c)
assert(c != NULL);
#ifdef NANO_WIDE
if (!ISSET(NO_UTF8)) {
if (ISSET(USE_UTF8)) {
wchar_t wc;
int c_mb_len = mbtowc(&wc, c, MB_CUR_MAX);
@@ -159,19 +145,41 @@ bool is_cntrl_mbchar(const char *c)
return is_cntrl_char((unsigned char)*c);
}
#ifdef NANO_WIDE
/* This function is equivalent to iscntrl() for wide characters, except
* in that it also handles wide control characters with their high bits
* set. */
bool is_cntrl_wchar(wchar_t wc)
/* This function is equivalent to ispunct() for multibyte characters. */
bool is_punct_mbchar(const char *c)
{
return (0 <= wc && wc < 32) || (127 <= wc && wc < 160);
}
#endif
assert(c != NULL);
/* c is a control character. It displays as ^@, ^?, or ^[ch] where ch
#ifdef NANO_WIDE
if (ISSET(USE_UTF8)) {
wchar_t wc;
int c_mb_len = mbtowc(&wc, c, MB_CUR_MAX);
if (c_mb_len <= 0) {
mbtowc(NULL, NULL, 0);
wc = (unsigned char)*c;
}
return iswpunct(wc);
} else
#endif
return ispunct((unsigned char)*c);
}
/* Return TRUE for a multibyte character found in a word (currently only
* an alphanumeric or punctuation character, and only the latter if
* allow_punct is TRUE) and FALSE otherwise. */
bool is_word_mbchar(const char *c, bool allow_punct)
{
assert(c != NULL);
return is_alnum_mbchar(c) || (allow_punct ? is_punct_mbchar(c) :
FALSE);
}
/* c is a control character. It displays as ^@, ^?, or ^[ch], where ch
* is c + 64. We return that character. */
unsigned char control_rep(unsigned char c)
char control_rep(char c)
{
/* Treat newlines embedded in a line as encoded nulls. */
if (c == '\n')
@@ -182,48 +190,9 @@ unsigned char control_rep(unsigned char c)
return c + 64;
}
/* c is a multibyte control character. It displays as ^@, ^?, or ^[ch]
* where ch is c + 64. We return that multibyte character. */
char *control_mbrep(const char *c, char *crep, int *crep_len)
{
assert(c != NULL);
#ifdef NANO_WIDE
if (!ISSET(NO_UTF8)) {
wchar_t wc, wcrep;
int c_mb_len = mbtowc(&wc, c, MB_CUR_MAX), crep_mb_len;
if (c_mb_len <= 0) {
mbtowc(NULL, NULL, 0);
wc = (unsigned char)*c;
}
wcrep = control_wrep(wc);
crep_mb_len = wctomb(crep, wcrep);
if (crep_mb_len <= 0) {
wctomb(NULL, 0);
crep_mb_len = 0;
}
*crep_len = crep_mb_len;
return crep;
} else {
#endif
*crep_len = 1;
*crep = control_rep((unsigned char)*c);
return crep;
#ifdef NANO_WIDE
}
#endif
}
#ifdef NANO_WIDE
/* c is a wide control character. It displays as ^@, ^?, or ^[ch] where
* ch is c + 64. We return that wide character. */
/* c is a wide control character. It displays as ^@, ^?, or ^[ch],
* where ch is c + 64. We return that wide character. */
wchar_t control_wrep(wchar_t wc)
{
/* Treat newlines embedded in a line as encoded nulls. */
@@ -236,13 +205,45 @@ wchar_t control_wrep(wchar_t wc)
}
#endif
/* c is a multibyte control character. It displays as ^@, ^?, or ^[ch],
* where ch is c + 64. We return that multibyte character. */
char *control_mbrep(const char *c, char *crep, int *crep_len)
{
assert(c != NULL && crep != NULL && crep_len != NULL);
#ifdef NANO_WIDE
if (ISSET(USE_UTF8)) {
wchar_t wc;
if (mbtowc(&wc, c, MB_CUR_MAX) <= 0) {
mbtowc(NULL, NULL, 0);
wc = (unsigned char)*c;
}
*crep_len = wctomb(crep, control_wrep(wc));
if (*crep_len <= 0) {
wctomb(NULL, 0);
*crep_len = 0;
}
} else {
#endif
*crep_len = 1;
*crep = control_rep(*c);
#ifdef NANO_WIDE
}
#endif
return crep;
}
/* This function is equivalent to wcwidth() for multibyte characters. */
int mbwidth(const char *c)
{
assert(c != NULL);
#ifdef NANO_WIDE
if (!ISSET(NO_UTF8)) {
if (ISSET(USE_UTF8)) {
wchar_t wc;
int c_mb_len = mbtowc(&wc, c, MB_CUR_MAX), width;
@@ -252,6 +253,7 @@ int mbwidth(const char *c)
}
width = wcwidth(wc);
if (width == -1)
width++;
@@ -266,14 +268,16 @@ int mb_cur_max(void)
{
return
#ifdef NANO_WIDE
!ISSET(NO_UTF8) ? MB_CUR_MAX :
ISSET(USE_UTF8) ? MB_CUR_MAX :
#endif
1;
}
/* Convert the value in chr to a multibyte character with the same
* wide character value as chr. Return the (dynamically allocated)
* multibyte character and its length. */
* wide character value as chr, if possible. If the conversion
* succeeds, return the (dynamically allocated) multibyte character and
* its length. Otherwise, return an undefined (dynamically allocated)
* multibyte character and a length of zero. */
char *make_mbchar(int chr, int *chr_mb_len)
{
char *chr_mb;
@@ -281,7 +285,7 @@ char *make_mbchar(int chr, int *chr_mb_len)
assert(chr_mb_len != NULL);
#ifdef NANO_WIDE
if (!ISSET(NO_UTF8)) {
if (ISSET(USE_UTF8)) {
chr_mb = charalloc(MB_CUR_MAX);
*chr_mb_len = wctomb(chr_mb, chr);
@@ -292,8 +296,7 @@ char *make_mbchar(int chr, int *chr_mb_len)
} else {
#endif
*chr_mb_len = 1;
chr_mb = charalloc(1);
*chr_mb = (char)chr;
chr_mb = mallocstrncpy(NULL, (char *)&chr, 1);
#ifdef NANO_WIDE
}
#endif
@@ -301,58 +304,6 @@ char *make_mbchar(int chr, int *chr_mb_len)
return chr_mb;
}
#if defined(ENABLE_NANORC) || defined(ENABLE_EXTRA)
/* Convert the string str to a valid multibyte string with the same wide
* character values as str. Return the (dynamically allocated)
* multibyte string. */
char *make_mbstring(const char *str)
{
assert(str != NULL);
#ifdef NANO_WIDE
if (!ISSET(NO_UTF8)) {
char *chr_mb = charalloc(MB_CUR_MAX);
int chr_mb_len;
char *str_mb = charalloc((MB_CUR_MAX * strlen(str)) + 1);
size_t str_mb_len = 0;
while (*str != '\0') {
bool bad_char;
int i;
chr_mb_len = parse_mbchar(str, chr_mb, &bad_char, NULL);
if (bad_char) {
char *bad_chr_mb;
int bad_chr_mb_len;
bad_chr_mb = make_mbchar((unsigned char)*chr_mb,
&bad_chr_mb_len);
for (i = 0; i < bad_chr_mb_len; i++)
str_mb[str_mb_len + i] = bad_chr_mb[i];
str_mb_len += bad_chr_mb_len;
free(bad_chr_mb);
} else {
for (i = 0; i < chr_mb_len; i++)
str_mb[str_mb_len + i] = chr_mb[i];
str_mb_len += chr_mb_len;
}
str += chr_mb_len;
}
free(chr_mb);
null_at(&str_mb, str_mb_len);
return str_mb;
} else
#endif
return mallocstrcpy(NULL, str);
}
#endif
/* Parse a multibyte character from buf. Return the number of bytes
* used. If chr isn't NULL, store the multibyte character in it. If
* bad_chr isn't NULL, set it to TRUE if we have a bad multibyte
@@ -369,7 +320,7 @@ int parse_mbchar(const char *buf, char *chr, bool *bad_chr, size_t
*bad_chr = FALSE;
#ifdef NANO_WIDE
if (!ISSET(NO_UTF8)) {
if (ISSET(USE_UTF8)) {
/* Get the number of bytes in the multibyte character. */
buf_mb_len = mblen(buf, MB_CUR_MAX);
@@ -505,7 +456,7 @@ int nstrncasecmp(const char *s1, const char *s2, size_t n)
}
if (n > 0)
return (tolower(*s1) - tolower(*s2));
return tolower(*s1) - tolower(*s2);
else
return 0;
}
@@ -516,7 +467,7 @@ int nstrncasecmp(const char *s1, const char *s2, size_t n)
int mbstrncasecmp(const char *s1, const char *s2, size_t n)
{
#ifdef NANO_WIDE
if (!ISSET(NO_UTF8)) {
if (ISSET(USE_UTF8)) {
char *s1_mb = charalloc(MB_CUR_MAX);
char *s2_mb = charalloc(MB_CUR_MAX);
wchar_t ws1, ws2;
@@ -524,6 +475,7 @@ int mbstrncasecmp(const char *s1, const char *s2, size_t n)
assert(s1 != NULL && s2 != NULL);
while (n > 0 && *s1 != '\0' && *s2 != '\0') {
bool bad_s1_mb = FALSE, bad_s2_mb = FALSE;
int s1_mb_len, s2_mb_len;
s1_mb_len = parse_mbchar(s1, s1_mb, NULL, NULL);
@@ -531,6 +483,7 @@ int mbstrncasecmp(const char *s1, const char *s2, size_t n)
if (mbtowc(&ws1, s1_mb, s1_mb_len) <= 0) {
mbtowc(NULL, NULL, 0);
ws1 = (unsigned char)*s1_mb;
bad_s1_mb = TRUE;
}
s2_mb_len = parse_mbchar(s2, s2_mb, NULL, NULL);
@@ -538,9 +491,11 @@ int mbstrncasecmp(const char *s1, const char *s2, size_t n)
if (mbtowc(&ws2, s2_mb, s2_mb_len) <= 0) {
mbtowc(NULL, NULL, 0);
ws2 = (unsigned char)*s2_mb;
bad_s2_mb = TRUE;
}
if (n == 0 || towlower(ws1) != towlower(ws2))
if (n == 0 || bad_s1_mb != bad_s2_mb ||
towlower(ws1) != towlower(ws2))
break;
s1 += s1_mb_len;
@@ -551,7 +506,7 @@ int mbstrncasecmp(const char *s1, const char *s2, size_t n)
free(s1_mb);
free(s2_mb);
return (towlower(ws1) - towlower(ws2));
return towlower(ws1) - towlower(ws2);
} else
#endif
return strncasecmp(s1, s2, n);
@@ -582,7 +537,7 @@ const char *nstrcasestr(const char *haystack, const char *needle)
const char *mbstrcasestr(const char *haystack, const char *needle)
{
#ifdef NANO_WIDE
if (!ISSET(NO_UTF8)) {
if (ISSET(USE_UTF8)) {
char *r_mb = charalloc(MB_CUR_MAX);
char *q_mb = charalloc(MB_CUR_MAX);
wchar_t wr, wq;
@@ -595,11 +550,14 @@ const char *mbstrcasestr(const char *haystack, const char *needle)
int r_mb_len, q_mb_len;
while (*q != '\0') {
bool bad_r_mb = FALSE, bad_q_mb = FALSE;
r_mb_len = parse_mbchar(r, r_mb, NULL, NULL);
if (mbtowc(&wr, r_mb, r_mb_len) <= 0) {
mbtowc(NULL, NULL, 0);
wr = (unsigned char)*r;
bad_r_mb = TRUE;
}
q_mb_len = parse_mbchar(q, q_mb, NULL, NULL);
@@ -607,9 +565,11 @@ const char *mbstrcasestr(const char *haystack, const char *needle)
if (mbtowc(&wq, q_mb, q_mb_len) <= 0) {
mbtowc(NULL, NULL, 0);
wq = (unsigned char)*q;
bad_q_mb = TRUE;
}
if (towlower(wr) != towlower(wq))
if (bad_r_mb != bad_q_mb ||
towlower(wr) != towlower(wq))
break;
r += r_mb_len;
@@ -653,7 +613,7 @@ const char *revstrstr(const char *haystack, const char *needle, const
return NULL;
}
#endif
#endif /* !NANO_SMALL || !DISABLE_TABCOMP */
#ifndef NANO_SMALL
/* This function is equivalent to strcasestr(), except in that it scans
@@ -683,7 +643,7 @@ const char *mbrevstrcasestr(const char *haystack, const char *needle,
const char *rev_start)
{
#ifdef NANO_WIDE
if (!ISSET(NO_UTF8)) {
if (ISSET(USE_UTF8)) {
char *r_mb = charalloc(MB_CUR_MAX);
char *q_mb = charalloc(MB_CUR_MAX);
wchar_t wr, wq;
@@ -696,11 +656,14 @@ const char *mbrevstrcasestr(const char *haystack, const char *needle,
int r_mb_len, q_mb_len;
while (*q != '\0') {
bool bad_r_mb = FALSE, bad_q_mb = FALSE;
r_mb_len = parse_mbchar(r, r_mb, NULL, NULL);
if (mbtowc(&wr, r_mb, r_mb_len) <= 0) {
mbtowc(NULL, NULL, 0);
wr = (unsigned char)*r;
bad_r_mb = TRUE;
}
q_mb_len = parse_mbchar(q, q_mb, NULL, NULL);
@@ -708,9 +671,11 @@ const char *mbrevstrcasestr(const char *haystack, const char *needle,
if (mbtowc(&wq, q_mb, q_mb_len) <= 0) {
mbtowc(NULL, NULL, 0);
wq = (unsigned char)*q;
bad_q_mb = TRUE;
}
if (towlower(wr) != towlower(wq))
if (bad_r_mb != bad_q_mb ||
towlower(wr) != towlower(wq))
break;
r += r_mb_len;
@@ -737,7 +702,7 @@ const char *mbrevstrcasestr(const char *haystack, const char *needle,
#endif
return revstrcasestr(haystack, needle, rev_start);
}
#endif
#endif /* !NANO_SMALL */
/* This function is equivalent to strlen() for multibyte strings. */
size_t mbstrlen(const char *s)
@@ -766,13 +731,12 @@ size_t mbstrnlen(const char *s, size_t maxlen)
assert(s != NULL);
#ifdef NANO_WIDE
if (!ISSET(NO_UTF8)) {
if (ISSET(USE_UTF8)) {
size_t n = 0;
char *s_mb = charalloc(MB_CUR_MAX);
int s_mb_len;
while (*s != '\0') {
s_mb_len = parse_mbchar(s, s_mb, NULL, NULL);
s_mb_len = parse_mbchar(s, NULL, NULL, NULL);
if (maxlen == 0)
break;
@@ -782,8 +746,6 @@ size_t mbstrnlen(const char *s, size_t maxlen)
n++;
}
free(s_mb);
return n;
} else
#endif
@@ -791,17 +753,65 @@ size_t mbstrnlen(const char *s, size_t maxlen)
}
#ifndef DISABLE_JUSTIFY
#ifdef ENABLE_NANORC
/* Return TRUE if the string s contains one or more blank characters,
* and FALSE otherwise. */
bool has_blank_chars(const char *s)
{
assert(s != NULL);
for (; *s != '\0'; s++) {
if (isblank(*s))
return TRUE;
}
return FALSE;
}
/* Return TRUE if the multibyte string s contains one or more blank
* multibyte characters, and FALSE otherwise. */
bool has_blank_mbchars(const char *s)
{
assert(s != NULL);
#ifdef NANO_WIDE
if (ISSET(USE_UTF8)) {
char *chr_mb = charalloc(MB_CUR_MAX);
bool retval = FALSE;
while (*s != '\0') {
int chr_mb_len;
chr_mb_len = parse_mbchar(s, chr_mb, NULL, NULL);
if (is_blank_mbchar(chr_mb)) {
retval = TRUE;
break;
}
s += chr_mb_len;
}
free(chr_mb);
return retval;
} else
#endif
return has_blank_chars(s);
}
#endif /* ENABLE_NANORC */
/* This function is equivalent to strchr() for multibyte strings. */
char *mbstrchr(const char *s, char *c)
{
assert(s != NULL && c != NULL);
#ifdef NANO_WIDE
if (!ISSET(NO_UTF8)) {
if (ISSET(USE_UTF8)) {
char *s_mb = charalloc(MB_CUR_MAX);
const char *q = s;
wchar_t ws, wc;
int s_mb_len, c_mb_len = mbtowc(&wc, c, MB_CUR_MAX);
int c_mb_len = mbtowc(&wc, c, MB_CUR_MAX);
if (c_mb_len <= 0) {
mbtowc(NULL, NULL, 0);
@@ -809,7 +819,7 @@ char *mbstrchr(const char *s, char *c)
}
while (*s != '\0') {
s_mb_len = parse_mbchar(s, s_mb, NULL, NULL);
int s_mb_len = parse_mbchar(s, s_mb, NULL, NULL);
if (mbtowc(&ws, s_mb, s_mb_len) <= 0) {
mbtowc(NULL, NULL, 0);
@@ -833,4 +843,21 @@ char *mbstrchr(const char *s, char *c)
#endif
return strchr(s, *c);
}
#endif /* !DISABLE_JUSTIFY */
#ifdef ENABLE_NANORC
/* Check if the string s is a valid multibyte string. Return TRUE if it
* is, and FALSE otherwise. */
bool is_valid_mbstring(const char *s)
{
assert(s != NULL);
return
#ifdef NANO_WIDE
ISSET(USE_UTF8) ?
(mbstowcs(NULL, s, 0) != (size_t)-1) :
#endif
TRUE;
}
#endif /* ENABLE_NANORC */

View File

@@ -8,14 +8,15 @@
* 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. *
* 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. *
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301, USA. *
* *
**************************************************************************/
@@ -29,7 +30,6 @@
#include <errno.h>
#include <fcntl.h>
#include "proto.h"
#include "nano.h"
#ifdef ENABLE_COLOR
@@ -122,7 +122,7 @@ void update_color(void)
if (colorstrings == NULL && syntaxstr != NULL) {
for (tmpsyntax = syntaxes; tmpsyntax != NULL;
tmpsyntax = tmpsyntax->next) {
if (strcasecmp(tmpsyntax->desc, syntaxstr) == 0)
if (mbstrcasecmp(tmpsyntax->desc, syntaxstr) == 0)
colorstrings = tmpsyntax->color;
}
}

View File

@@ -8,14 +8,15 @@
* 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. *
* 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. *
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301, USA. *
* *
**************************************************************************/
@@ -28,7 +29,6 @@
#include <stdio.h>
#include <assert.h>
#include "proto.h"
#include "nano.h"
static bool keep_cutbuffer = FALSE;
/* Should we keep the contents of the cutbuffer? */
@@ -41,12 +41,15 @@ void cutbuffer_reset(void)
}
/* If we're not on the magicline, move all the text of the current line,
* plus the newline at the end, to the cutbuffer. */
* plus the newline at the end, to the cutbuffer, and set the current
* place we want to where the line used to start. */
void cut_line(void)
{
if (current->next != NULL)
if (current->next != NULL) {
move_to_filestruct(&cutbuffer, &cutbottom, current, 0,
current->next, 0);
placewewant = xplustabs();
}
}
#ifndef NANO_SMALL

File diff suppressed because it is too large Load Diff

View File

@@ -8,14 +8,15 @@
* 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. *
* 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. *
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301, USA. *
* *
**************************************************************************/
@@ -26,7 +27,6 @@
#include <stdlib.h>
#include <assert.h>
#include "proto.h"
#include "nano.h"
/* Global variables */
@@ -38,7 +38,6 @@ ssize_t wrap_at = -CHARS_FROM_EOL; /* Right justified fill value,
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? */
unsigned long flags = 0; /* Our flag containing many options */
WINDOW *topwin; /* Top buffer */
@@ -55,7 +54,7 @@ int editwinrows = 0; /* How many rows long is the edit
filestruct *current; /* Current buffer pointer */
size_t current_x = 0; /* Current x-coordinate in the edit
window */
int current_y = 0; /* Current y-coordinate in the edit
ssize_t current_y = 0; /* Current y-coordinate in the edit
window */
filestruct *fileage = NULL; /* Our file buffer */
filestruct *edittop = NULL; /* Pointer to the top of the edit
@@ -103,7 +102,7 @@ char *backup_dir = NULL; /* Backup directory. */
#endif
char *answer = NULL; /* Answer str to many questions */
int totlines = 0; /* Total number of lines in the file */
size_t totlines = 0; /* Total number of lines in the file */
size_t totsize = 0; /* Total number of characters in the
file */
size_t placewewant = 0; /* The column we'd like the cursor
@@ -168,12 +167,15 @@ toggle *toggles = NULL;
#endif
#ifndef NANO_SMALL
historyheadtype search_history;
historyheadtype replace_history;
filestruct *search_history = NULL;
filestruct *searchage = NULL;
filestruct *searchbot = NULL;
filestruct *replace_history = NULL;
filestruct *replaceage = NULL;
filestruct *replacebot = NULL;
#endif
/* Regular expressions */
#ifdef HAVE_REGEX_H
regex_t search_regexp; /* Global to store compiled search regexp */
regmatch_t regmatches[10]; /* Match positions for parenthetical
@@ -239,6 +241,7 @@ void shortcut_init(bool unjustify)
const char *cancel_msg = N_("Cancel");
const char *first_line_msg = N_("First Line");
const char *last_line_msg = N_("Last Line");
const char *refresh_msg = N_("Refresh");
#ifndef NANO_SMALL
const char *cut_till_end_msg = N_("CutTillEnd");
#endif
@@ -249,42 +252,48 @@ void shortcut_init(bool unjustify)
#endif
#ifndef NANO_SMALL
const char *case_sens_msg = N_("Case Sens");
const char *direction_msg = N_("Direction");
const char *backwards_msg = N_("Backwards");
#endif
#ifdef HAVE_REGEX_H
const char *regexp_msg = N_("Regexp");
#endif
#ifndef NANO_SMALL
const char *history_msg = N_("History");
#ifdef ENABLE_MULTIBUFFER
const char *new_buffer_msg = N_("New Buffer");
#endif
#endif /* !NANO_SMALL */
#endif
#ifndef DISABLE_BROWSER
const char *to_files_msg = N_("To Files");
#endif
#ifndef DISABLE_HELP
const char *nano_help_msg = N_("Invoke the help menu");
const char *nano_exit_msg =
#ifdef ENABLE_MULTIBUFFER
N_("Close currently loaded file/Exit from nano")
N_("Close the current file buffer/Exit from nano")
#else
N_("Exit from nano")
#endif
;
const char *nano_writeout_msg = N_("Write the current file to disk");
const char *nano_writeout_msg =
N_("Write the current file to disk");
const char *nano_justify_msg = N_("Justify the current paragraph");
const char *nano_insert_msg =
N_("Insert another file into the current one");
const char *nano_whereis_msg = N_("Search for text within the editor");
const char *nano_whereis_msg =
N_("Search for text within the editor");
const char *nano_prevpage_msg = N_("Move to the previous screen");
const char *nano_nextpage_msg = N_("Move to the next screen");
const char *nano_cut_msg =
N_("Cut the current line and store it in the cutbuffer");
const char *nano_uncut_msg =
N_("Uncut from the cutbuffer into the current line");
const char *nano_cursorpos_msg = N_("Show the position of the cursor");
const char *nano_spell_msg = N_("Invoke the spell checker, if available");
const char *nano_gotoline_msg = N_("Go to a specific line number");
const char *nano_cursorpos_msg =
N_("Show the position of the cursor");
const char *nano_spell_msg =
N_("Invoke the spell checker, if available");
const char *nano_gotoline_msg =
N_("Go to a specific line number and column number");
const char *nano_replace_msg = N_("Replace text within the editor");
#ifndef NANO_SMALL
const char *nano_mark_msg = N_("Mark text at the cursor position");
@@ -294,10 +303,14 @@ void shortcut_init(bool unjustify)
const char *nano_nextline_msg = N_("Move to the next line");
const char *nano_forward_msg = N_("Move forward one character");
const char *nano_back_msg = N_("Move back one character");
const char *nano_home_msg = N_("Move to the beginning of the current line");
const char *nano_end_msg = N_("Move to the end of the current line");
const char *nano_refresh_msg = N_("Refresh (redraw) the current screen");
const char *nano_delete_msg = N_("Delete the character under the cursor");
const char *nano_home_msg =
N_("Move to the beginning of the current line");
const char *nano_end_msg =
N_("Move to the end of the current line");
const char *nano_refresh_msg =
N_("Refresh (redraw) the current screen");
const char *nano_delete_msg =
N_("Delete the character under the cursor");
const char *nano_backspace_msg =
N_("Delete the character to the left of the cursor");
const char *nano_tab_msg =
@@ -307,6 +320,8 @@ void shortcut_init(bool unjustify)
#ifndef NANO_SMALL
const char *nano_nextword_msg = N_("Move forward one word");
const char *nano_prevword_msg = N_("Move backward one word");
const char *nano_wordcount_msg =
N_("Count the number of words in the file");
#endif
#ifndef DISABLE_JUSTIFY
const char *nano_parabegin_msg =
@@ -315,8 +330,10 @@ void shortcut_init(bool unjustify)
N_("Go to the end of the current paragraph");
#endif
#ifdef ENABLE_MULTIBUFFER
const char *nano_openprev_msg = N_("Switch to the previous file buffer");
const char *nano_opennext_msg = N_("Switch to the next file buffer");
const char *nano_openprev_msg =
N_("Switch to the previous file buffer");
const char *nano_opennext_msg =
N_("Switch to the next file buffer");
#endif
const char *nano_verbatim_msg = N_("Insert character(s) verbatim");
#ifndef NANO_SMALL
@@ -330,20 +347,23 @@ void shortcut_init(bool unjustify)
const char *nano_bracket_msg = N_("Find other bracket");
#endif
const char *nano_cancel_msg = N_("Cancel the current function");
const char *nano_firstline_msg = N_("Go to the first line of the file");
const char *nano_lastline_msg = N_("Go to the last line of the file");
const char *nano_firstline_msg =
N_("Go to the first line of the file");
const char *nano_lastline_msg =
N_("Go to the last line of the file");
#ifndef NANO_SMALL
const char *nano_case_msg =
N_("Make the current search/replace case (in)sensitive");
const char *nano_reverse_msg =
N_("Make the current search/replace go backwards");
#endif
#ifdef HAVE_REGEX_H
const char *nano_regexp_msg = N_("Use regular expressions");
#endif
const char *nano_editstr_msg =
#ifndef NANO_SMALL
const char *nano_history_msg =
N_("Edit the previous search/replace strings");
#endif /* !NANO_SMALL */
#endif
#ifndef DISABLE_BROWSER
const char *nano_tofiles_msg = N_("Go to file browser");
#endif
@@ -354,7 +374,8 @@ void shortcut_init(bool unjustify)
const char *nano_append_msg = N_("Append to the current file");
const char *nano_prepend_msg = N_("Prepend to the current file");
#ifndef NANO_SMALL
const char *nano_backup_msg = N_("Back up original file when saving");
const char *nano_backup_msg =
N_("Back up original file when saving");
const char *nano_execute_msg = N_("Execute external command");
#endif
#if !defined(NANO_SMALL) && defined(ENABLE_MULTIBUFFER)
@@ -480,7 +501,8 @@ void shortcut_init(bool unjustify)
sc_init_one(&main_list, NANO_GOTOLINE_KEY, go_to_line_msg,
IFHELP(nano_gotoline_msg, NANO_GOTOLINE_ALTKEY),
NANO_GOTOLINE_FKEY, NANO_NO_KEY, VIEW, do_gotoline_void);
NANO_GOTOLINE_FKEY, NANO_NO_KEY, VIEW,
do_gotolinecolumn_void);
sc_init_one(&main_list, NANO_REPLACE_KEY, replace_msg,
IFHELP(nano_replace_msg, NANO_ALT_REPLACE_KEY),
@@ -489,7 +511,7 @@ void shortcut_init(bool unjustify)
#ifndef NANO_SMALL
sc_init_one(&main_list, NANO_MARK_KEY, N_("Mark Text"),
IFHELP(nano_mark_msg, NANO_MARK_ALTKEY), NANO_MARK_FKEY,
NANO_NO_KEY, NOVIEW, do_mark);
NANO_NO_KEY, VIEW, do_mark);
sc_init_one(&main_list, NANO_NO_KEY, N_("Where Is Next"),
IFHELP(nano_whereis_next_msg, NANO_WHEREIS_NEXT_KEY),
@@ -520,7 +542,7 @@ void shortcut_init(bool unjustify)
IFHELP(nano_end_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, do_end);
sc_init_one(&main_list, NANO_REFRESH_KEY, N_("Refresh"),
sc_init_one(&main_list, NANO_REFRESH_KEY, refresh_msg,
IFHELP(nano_refresh_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, total_refresh);
@@ -543,11 +565,15 @@ void shortcut_init(bool unjustify)
#ifndef NANO_SMALL
sc_init_one(&main_list, NANO_NEXTWORD_KEY, N_("Next Word"),
IFHELP(nano_nextword_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, do_next_word);
NANO_NO_KEY, VIEW, do_next_word_void);
sc_init_one(&main_list, NANO_NO_KEY, N_("Prev Word"),
IFHELP(nano_prevword_msg, NANO_PREVWORD_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, do_prev_word);
NANO_NO_KEY, VIEW, do_prev_word_void);
sc_init_one(&main_list, NANO_NO_KEY, N_("Word Count"),
IFHELP(nano_wordcount_msg, NANO_WORDCOUNT_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, do_word_count);
#endif
#ifndef DISABLE_JUSTIFY
@@ -652,27 +678,29 @@ void shortcut_init(bool unjustify)
NANO_NO_KEY, VIEW, NULL);
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&whereis_list, NANO_NO_KEY, direction_msg,
sc_init_one(&whereis_list, NANO_NO_KEY, backwards_msg,
IFHELP(nano_reverse_msg, TOGGLE_BACKWARDS_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL);
#endif
#ifdef HAVE_REGEX_H
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&whereis_list, NANO_NO_KEY, regexp_msg,
IFHELP(nano_regexp_msg, TOGGLE_REGEXP_KEY), NANO_NO_KEY,
IFHELP(nano_regexp_msg, NANO_REGEXP_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL);
#endif
#ifndef NANO_SMALL
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&whereis_list, NANO_HISTORY_KEY, history_msg,
IFHELP(nano_editstr_msg, NANO_NO_KEY), NANO_NO_KEY,
sc_init_one(&whereis_list, NANO_PREVLINE_KEY, history_msg,
IFHELP(nano_history_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL);
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&whereis_list, NANO_CUTTILLEND_KEY, cut_till_end_msg,
IFHELP(nano_cut_till_end_msg, NANO_CUTTILLEND_ALTKEY),
NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_cut_till_end);
#endif /* !NANO_SMALL */
#endif
#ifndef DISABLE_JUSTIFY
/* Translators: try to keep this string under 10 characters long */
@@ -719,20 +747,22 @@ void shortcut_init(bool unjustify)
IFHELP(nano_case_msg, TOGGLE_CASE_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL);
sc_init_one(&replace_list, NANO_NO_KEY, direction_msg,
sc_init_one(&replace_list, NANO_NO_KEY, backwards_msg,
IFHELP(nano_reverse_msg, TOGGLE_BACKWARDS_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL);
#ifdef HAVE_REGEX_H
sc_init_one(&replace_list, NANO_NO_KEY, regexp_msg,
IFHELP(nano_regexp_msg, TOGGLE_REGEXP_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL);
#endif
sc_init_one(&replace_list, NANO_HISTORY_KEY, history_msg,
IFHELP(nano_editstr_msg, NANO_NO_KEY), NANO_NO_KEY,
#ifdef HAVE_REGEX_H
sc_init_one(&replace_list, NANO_NO_KEY, regexp_msg,
IFHELP(nano_regexp_msg, NANO_REGEXP_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL);
#endif /* !NANO_SMALL */
#endif
#ifndef NANO_SMALL
sc_init_one(&replace_list, NANO_PREVLINE_KEY, history_msg,
IFHELP(nano_history_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL);
#endif
free_shortcutage(&replace_list_2);
@@ -759,8 +789,8 @@ void shortcut_init(bool unjustify)
NANO_NO_KEY, VIEW, do_last_line);
#ifndef NANO_SMALL
sc_init_one(&replace_list_2, NANO_HISTORY_KEY, history_msg,
IFHELP(nano_editstr_msg, NANO_NO_KEY), NANO_NO_KEY,
sc_init_one(&replace_list_2, NANO_PREVLINE_KEY, history_msg,
IFHELP(nano_history_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL);
#endif
@@ -795,6 +825,14 @@ void shortcut_init(bool unjustify)
#ifndef DISABLE_HELP
free_shortcutage(&help_list);
sc_init_one(&help_list, NANO_REFRESH_KEY, refresh_msg,
IFHELP(nano_refresh_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL);
sc_init_one(&help_list, NANO_EXIT_KEY, exit_msg,
IFHELP(nano_exit_msg, NANO_NO_KEY), NANO_EXIT_FKEY,
NANO_NO_KEY, VIEW, NULL);
sc_init_one(&help_list, NANO_PREVPAGE_KEY, prev_page_msg,
IFHELP(nano_prevpage_msg, NANO_NO_KEY), NANO_PREVPAGE_FKEY,
NANO_NO_KEY, VIEW, NULL);
@@ -810,14 +848,6 @@ void shortcut_init(bool unjustify)
sc_init_one(&help_list, NANO_NEXTLINE_KEY, N_("Next Line"),
IFHELP(nano_nextline_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL);
sc_init_one(&help_list, NANO_REFRESH_KEY, N_("Refresh"),
IFHELP(nano_refresh_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL);
sc_init_one(&help_list, NANO_EXIT_KEY, exit_msg,
IFHELP(nano_exit_msg, NANO_NO_KEY), NANO_EXIT_FKEY,
NANO_NO_KEY, VIEW, NULL);
#endif
free_shortcutage(&writefile_list);
@@ -1002,10 +1032,6 @@ void shortcut_init(bool unjustify)
IFHELP(nano_nextpage_msg, NANO_NO_KEY), NANO_NEXTPAGE_FKEY,
NANO_NO_KEY, VIEW, NULL);
sc_init_one(&browser_list, NANO_REFRESH_KEY, N_("Refresh"),
IFHELP(nano_refresh_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, NULL);
/* Translators: try to keep this string under 22 characters long */
sc_init_one(&browser_list, NANO_GOTOLINE_KEY, N_("Go To Dir"),
IFHELP(nano_gotodir_msg, NANO_GOTOLINE_ALTKEY),
@@ -1039,6 +1065,7 @@ void shortcut_init(bool unjustify)
void free_shortcutage(shortcut **shortcutage)
{
assert(shortcutage != NULL);
while (*shortcutage != NULL) {
shortcut *ps = *shortcutage;
*shortcutage = (*shortcutage)->next;
@@ -1077,28 +1104,33 @@ void toggle_init(void)
return;
toggle_init_one(TOGGLE_NOHELP_KEY, N_("Help mode"), NO_HELP);
toggle_init_one(TOGGLE_MORESPACE_KEY,
N_("Use of more space for editing"), MORE_SPACE);
#ifdef ENABLE_MULTIBUFFER
/* If we're using restricted mode, the multibuffer toggle is
* disabled. It's useless since inserting files is disabled. */
if (!ISSET(RESTRICTED))
toggle_init_one(TOGGLE_MULTIBUFFER_KEY,
N_("Multiple file buffers"), MULTIBUFFER);
#endif
toggle_init_one(TOGGLE_CONST_KEY, N_("Constant cursor position"),
CONSTUPDATE);
toggle_init_one(TOGGLE_AUTOINDENT_KEY, N_("Auto indent"),
AUTOINDENT);
#ifndef DISABLE_WRAPPING
toggle_init_one(TOGGLE_WRAP_KEY, N_("Auto line wrap"), NO_WRAP);
#endif
toggle_init_one(TOGGLE_CUTTOEND_KEY, N_("Cut to end"), CUT_TO_END);
#ifndef DISABLE_WRAPPING
toggle_init_one(TOGGLE_WRAP_KEY, N_("Long line wrapping"),
NO_WRAP);
#endif
#ifndef DISABLE_MOUSE
toggle_init_one(TOGGLE_MOUSE_KEY, N_("Mouse support"), USE_MOUSE);
#endif
/* If we're using restricted mode, the suspend toggle is disabled.
* It's useless since suspending is disabled. */
if (!ISSET(RESTRICTED))
toggle_init_one(TOGGLE_SUSPEND_KEY, N_("Suspend"), SUSPEND);
#ifndef DISABLE_MOUSE
toggle_init_one(TOGGLE_MOUSE_KEY, N_("Mouse support"), USE_MOUSE);
#endif
toggle_init_one(TOGGLE_CONST_KEY,
N_("Constant cursor position display"), CONST_UPDATE);
toggle_init_one(TOGGLE_AUTOINDENT_KEY, N_("Auto indent"),
AUTOINDENT);
toggle_init_one(TOGGLE_TABSTOSPACES_KEY,
N_("Conversion of typed tabs to spaces"), TABS_TO_SPACES);
/* If we're using restricted mode, the DOS/Mac conversion toggle is
* disabled. It's useless since inserting files is disabled. */
if (!ISSET(RESTRICTED))
@@ -1110,7 +1142,7 @@ void toggle_init(void)
toggle_init_one(TOGGLE_BACKUP_KEY, N_("Backup files"),
BACKUP_FILE);
toggle_init_one(TOGGLE_SMOOTH_KEY, N_("Smooth scrolling"),
SMOOTHSCROLL);
SMOOTH_SCROLL);
toggle_init_one(TOGGLE_SMARTHOME_KEY, N_("Smart home key"),
SMART_HOME);
#ifdef ENABLE_COLOR
@@ -1121,22 +1153,7 @@ void toggle_init(void)
toggle_init_one(TOGGLE_WHITESPACE_KEY, N_("Whitespace display"),
WHITESPACE_DISPLAY);
#endif
toggle_init_one(TOGGLE_MORESPACE_KEY, N_("Use of more space for editing"),
MORE_SPACE);
}
#ifdef DEBUG
/* Deallocate all of the toggles. */
void free_toggles(void)
{
while (toggles != NULL) {
toggle *pt = toggles; /* Think "previous toggle". */
toggles = toggles->next;
free(pt);
}
}
#endif
#endif /* !NANO_SMALL */
/* This function is called just before calling exit(). Practically, the
@@ -1156,7 +1173,8 @@ void thanks_for_all_the_fish(void)
free(quotestr);
#ifdef HAVE_REGEX_H
regfree(&quotereg);
free(quoteerr);
if (quoteerr != NULL)
free(quoteerr);
#endif
#endif
#ifndef NANO_SMALL
@@ -1213,24 +1231,31 @@ void thanks_for_all_the_fish(void)
free_shortcutage(&browser_list);
free_shortcutage(&gotodir_list);
#endif
#ifndef NANO_SMALL
free_toggles();
#endif
/* Free the memory associated with each toggle. */
while (toggles != NULL) {
toggle *t = toggles;
toggles = toggles->next;
free(t);
}
#endif
#ifdef ENABLE_MULTIBUFFER
/* Free the memory associated with each open file buffer. */
if (open_files != NULL) {
/* We free the memory associated with each open file. */
while (open_files->prev != NULL)
open_files = open_files->prev;
/* Make sure open_files->fileage is up to date, in case we've
* cut the top line of the file. */
open_files->fileage = fileage;
free_openfilestruct(open_files);
}
#else
free_filestruct(fileage);
if (fileage != NULL)
free_filestruct(fileage);
#endif
#ifdef ENABLE_COLOR
free(syntaxstr);
if (syntaxstr != NULL)
free(syntaxstr);
while (syntaxes != NULL) {
syntaxtype *bill = syntaxes;
@@ -1257,12 +1282,15 @@ void thanks_for_all_the_fish(void)
}
#endif /* ENABLE_COLOR */
#ifndef NANO_SMALL
/* free history lists */
free_history(&search_history);
free_history(&replace_history);
/* Free the search and replace history lists. */
if (searchage != NULL)
free_filestruct(searchage);
if (replaceage != NULL)
free_filestruct(replaceage);
#endif
#ifdef ENABLE_NANORC
free(homedir);
if (homedir != NULL)
free(homedir);
#endif
}
#endif /* DEBUG */

View File

@@ -8,14 +8,15 @@
* 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. *
* 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. *
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301, USA. *
* *
**************************************************************************/
@@ -28,7 +29,6 @@
#include <ctype.h>
#include <assert.h>
#include "proto.h"
#include "nano.h"
void do_first_line(void)
{
@@ -107,7 +107,7 @@ void do_page_up(void)
/* If we're in smooth scrolling mode and there's 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) {
if (ISSET(SMOOTH_SCROLL) && current->lineno > editwinrows - 2) {
int i;
for (i = 0; i < editwinrows - 2; i++)
current = current->prev;
@@ -153,7 +153,7 @@ void do_page_down(void)
/* If we're in smooth scrolling mode and there's 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 <=
if (ISSET(SMOOTH_SCROLL) && current->lineno + editwinrows - 2 <=
filebot->lineno) {
int i;
for (i = 0; i < editwinrows - 2; i++)
@@ -201,7 +201,7 @@ void do_up(void)
if (current_y == 0)
edit_scroll(UP,
#ifndef NANO_SMALL
ISSET(SMOOTHSCROLL) ? 1 :
ISSET(SMOOTH_SCROLL) ? 1 :
#endif
editwinrows / 2);
@@ -225,6 +225,7 @@ void do_down(void)
return;
assert(current_y == current->lineno - edittop->lineno);
current = current->next;
current_x = actual_x(current->data, placewewant);
@@ -234,7 +235,7 @@ void do_down(void)
if (current_y == editwinrows - 1)
edit_scroll(DOWN,
#ifndef NANO_SMALL
ISSET(SMOOTHSCROLL) ? 1 :
ISSET(SMOOTH_SCROLL) ? 1 :
#endif
editwinrows / 2);

File diff suppressed because it is too large Load Diff

View File

@@ -8,22 +8,27 @@
* 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. *
* 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. *
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301, USA. *
* *
**************************************************************************/
#ifndef NANO_H
#define NANO_H 1
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef __TANDEM
/* Tandem NonStop Kernel */
/* Tandem NonStop Kernel. */
#include <floss.h>
#define NANO_ROOT_UID 65535
#else
@@ -34,17 +39,17 @@
#include <limits.h>
#endif
/* Macros for the flags long. */
/* Macros for flags. */
#define SET(bit) flags |= bit
#define UNSET(bit) flags &= ~bit
#define ISSET(bit) ((flags & bit) != 0)
#define TOGGLE(bit) flags ^= bit
/* Macros for character allocation. */
/* Macros for character allocation, etc. */
#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))
#define charcpy(dest, src, n) memcpy(dest, src, (n) * sizeof(char))
#define charset(dest, src, n) memset(dest, src, (n) * sizeof(char))
/* Other macros. */
#ifdef BROKEN_REGEXEC
@@ -52,8 +57,7 @@
#define regexec(preg, string, nmatch, pmatch, eflags) safe_regexec(preg, string, nmatch, pmatch, eflags)
#endif
/* Set a default value for PATH_MAX, so we can use it in lines like
* "path = getcwd(NULL, PATH_MAX + 1);". */
/* Set a default value for PATH_MAX if there isn't one. */
#ifndef PATH_MAX
#define PATH_MAX 4096
#endif
@@ -88,9 +92,8 @@
#include <stddef.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "config.h"
/* If no snprintf() or vsnprintf(), use the versions from glib. */
/* If no snprintf() or vsnprintf(), use the versions from glib 2.x. */
#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
#include <glib.h>
#ifndef HAVE_SNPRINTF
@@ -101,8 +104,15 @@
#endif
#endif
/* If no strcasecmp(), strncasecmp(), strcasestr(), strnlen(),
* getdelim(), or getline(), use the versions we have. */
/* If no isblank(), iswblank(), strcasecmp(), strncasecmp(),
* strcasestr(), strnlen(), getdelim(), or getline(), use the versions
* we have. */
#ifndef HAVE_ISBLANK
#define isblank nisblank
#endif
#ifndef HAVE_ISWBLANK
#define iswblank niswblank
#endif
#ifndef HAVE_STRCASECMP
#define strcasecmp nstrcasecmp
#endif
@@ -152,7 +162,7 @@ typedef struct filestruct {
char *data;
struct filestruct *next; /* Next node. */
struct filestruct *prev; /* Previous node. */
int lineno; /* The line number. */
ssize_t lineno; /* The line number. */
} filestruct;
#ifdef ENABLE_MULTIBUFFER
@@ -179,7 +189,7 @@ typedef struct openfilestruct {
size_t current_x; /* Current file's x-coordinate
* position. */
size_t placewewant; /* Current file's place we want. */
int totlines; /* Current file's total number of
size_t totlines; /* Current file's total number of
* lines. */
size_t totsize; /* Current file's total size. */
unsigned long flags; /* Current file's flags: modification
@@ -237,7 +247,7 @@ typedef struct rcoption {
typedef struct colortype {
int fg; /* Foreground color. */
int bg; /* Background color. */
int bright; /* Is this color A_BOLD? */
bool bright; /* Is this color A_BOLD? */
int pairnum; /* Color pair number used for this
* foreground/background. */
regex_t start; /* Start (or all) of the regex
@@ -261,31 +271,12 @@ typedef struct syntaxtype {
} syntaxtype;
#endif
#ifndef NANO_SMALL
typedef struct historytype {
struct historytype *next;
struct historytype *prev;
char *data;
} historytype;
typedef struct historyheadtype {
struct historytype *next; /* Keep *next and *prev members
* together. */
struct historytype *prev; /* And in the same order as in
* historytype. */
struct historytype *tail;
struct historytype *current;
int count;
int len;
} historyheadtype;
#endif
/* Bitwise flags so we can save space (or more correctly, not waste
* it). */
/* Bitwise flags so that we can save space (or, more correctly, not
* waste it). */
#define MODIFIED (1<<0)
#define CASE_SENSITIVE (1<<1)
#define MARK_ISSET (1<<2)
#define CONSTUPDATE (1<<3)
#define CONST_UPDATE (1<<3)
#define NO_HELP (1<<4)
#define NOFOLLOW_SYMLINKS (1<<5)
#define SUSPEND (1<<6)
@@ -296,25 +287,25 @@ typedef struct historyheadtype {
#define USE_REGEXP (1<<11)
#define TEMP_FILE (1<<12)
#define CUT_TO_END (1<<13)
#define REVERSE_SEARCH (1<<14)
#define BACKWARDS_SEARCH (1<<14)
#define MULTIBUFFER (1<<15)
#define SMOOTHSCROLL (1<<16)
#define DISABLE_CURPOS (1<<17) /* Damn, we still need it. */
#define REBIND_DELETE (1<<18)
#define NO_CONVERT (1<<19)
#define BACKUP_FILE (1<<20)
#define NO_RCFILE (1<<21)
#define NO_COLOR_SYNTAX (1<<22)
#define PRESERVE (1<<23)
#define HISTORY_CHANGED (1<<24)
#define HISTORYLOG (1<<25)
#define RESTRICTED (1<<26)
#define SMART_HOME (1<<27)
#define WHITESPACE_DISPLAY (1<<28)
#define MORE_SPACE (1<<29)
#define NO_UTF8 (1<<30)
#define SMOOTH_SCROLL (1<<16)
#define REBIND_DELETE (1<<17)
#define NO_CONVERT (1<<18)
#define BACKUP_FILE (1<<19)
#define NO_RCFILE (1<<20)
#define NO_COLOR_SYNTAX (1<<21)
#define PRESERVE (1<<22)
#define HISTORYLOG (1<<23)
#define RESTRICTED (1<<24)
#define SMART_HOME (1<<25)
#define WHITESPACE_DISPLAY (1<<26)
#define MORE_SPACE (1<<27)
#define TABS_TO_SPACES (1<<28)
#define QUICK_BLANK (1<<29)
#define USE_UTF8 (1<<30)
/* Control key sequences, changing these would be very very bad. */
/* Control key sequences. Changing these would be very, very bad. */
#define NANO_CONTROL_SPACE 0
#define NANO_CONTROL_A 1
#define NANO_CONTROL_B 2
@@ -392,9 +383,6 @@ typedef struct historyheadtype {
/* No key at all. */
#define NANO_NO_KEY -2
/* Special sentinel key used for search/replace history. */
#define NANO_HISTORY_KEY -3
/* Normal keys. */
#define NANO_XON_KEY NANO_CONTROL_Q
#define NANO_XOFF_KEY NANO_CONTROL_S
@@ -417,6 +405,7 @@ typedef struct historyheadtype {
#define NANO_WHEREIS_NEXT_KEY NANO_ALT_W
#define NANO_WHEREIS_NEXT_FKEY KEY_F(16)
#define NANO_TOOTHERWHEREIS_KEY NANO_CONTROL_T
#define NANO_REGEXP_KEY NANO_ALT_R
#define NANO_REPLACE_KEY NANO_CONTROL_4
#define NANO_REPLACE_FKEY KEY_F(14)
#define NANO_ALT_REPLACE_KEY NANO_ALT_R
@@ -466,6 +455,7 @@ typedef struct historyheadtype {
#define NANO_BRACKET_KEY NANO_ALT_RBRACKET
#define NANO_NEXTWORD_KEY NANO_CONTROL_SPACE
#define NANO_PREVWORD_KEY NANO_ALT_SPACE
#define NANO_WORDCOUNT_KEY NANO_ALT_D
#define NANO_CUTTILLEND_KEY NANO_CONTROL_X
#define NANO_CUTTILLEND_ALTKEY NANO_ALT_T
#define NANO_PARABEGIN_KEY NANO_CONTROL_W
@@ -486,7 +476,6 @@ typedef struct historyheadtype {
#define TOGGLE_NOHELP_KEY NANO_ALT_X
#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_L
#define TOGGLE_BACKWARDS_KEY NANO_ALT_B
#define TOGGLE_CASE_KEY NANO_ALT_C
@@ -500,6 +489,7 @@ typedef struct historyheadtype {
#define TOGGLE_SMARTHOME_KEY NANO_ALT_H
#define TOGGLE_WHITESPACE_KEY NANO_ALT_P
#define TOGGLE_MORESPACE_KEY NANO_ALT_O
#define TOGGLE_TABSTOSPACES_KEY NANO_ALT_Q
#endif /* !NANO_SMALL */
#define MAIN_VISIBLE 12
@@ -517,7 +507,11 @@ typedef struct historyheadtype {
/* Default width of a tab. */
#define WIDTH_OF_TAB 8
/* Maximum number of search/replace history strings saved. */
/* Maximum number of search/replace history strings saved, not counting
* the blank lines at their ends. */
#define MAX_SEARCH_HISTORY 100
/* Maximum number of bytes we read from a file at one time. */
#define MAX_BUF_SIZE 128
#endif /* !NANO_H */

View File

@@ -8,17 +8,21 @@
* 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. *
* 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. *
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301, USA. *
* *
**************************************************************************/
#ifndef PROTO_H
#define PROTO_H 1
/* Externs. */
#include <sys/types.h>
@@ -34,8 +38,8 @@ extern ssize_t wrap_at;
#endif
extern int editwinrows;
extern size_t current_x;
extern int current_y;
extern int totlines;
extern ssize_t current_y;
extern size_t totlines;
extern size_t placewewant;
#ifndef NANO_SMALL
extern size_t mark_beginx;
@@ -140,44 +144,45 @@ extern toggle *toggles;
#endif
#ifndef NANO_SMALL
extern historyheadtype search_history;
extern historyheadtype replace_history;
extern filestruct *search_history;
extern filestruct *searchage;
extern filestruct *searchbot;
extern filestruct *replace_history;
extern filestruct *replaceage;
extern filestruct *replacebot;
#endif
extern bool curses_ended;
extern char *homedir;
/* Functions we want available. */
/* The functions we want available. */
/* Public functions in chars.c. */
#ifndef HAVE_ISBLANK
bool nisblank(int c);
#endif
#if !defined(HAVE_ISWBLANK) && defined(NANO_WIDE)
bool niswblank(wchar_t wc);
#endif
bool is_byte(int c);
bool is_alnum_char(int c);
bool is_alnum_mbchar(const char *c);
#ifdef NANO_WIDE
bool is_alnum_wchar(wchar_t wc);
#endif
bool is_blank_char(int c);
bool is_blank_mbchar(const char *c);
#ifdef NANO_WIDE
bool is_blank_wchar(wchar_t wc);
#endif
bool is_cntrl_char(int c);
bool is_cntrl_mbchar(const char *c);
#ifdef NANO_WIDE
bool is_cntrl_wchar(wchar_t wc);
#endif
unsigned char control_rep(unsigned char c);
char *control_mbrep(const char *c, char *crep, int *crep_len);
bool is_cntrl_mbchar(const char *c);
bool is_punct_mbchar(const char *c);
bool is_word_mbchar(const char *c, bool allow_punct);
char control_rep(char c);
#ifdef NANO_WIDE
wchar_t control_wrep(wchar_t c);
#endif
char *control_mbrep(const char *c, char *crep, int *crep_len);
int mbwidth(const char *c);
int mb_cur_max(void);
char *make_mbchar(int chr, int *chr_mb_len);
#if defined(ENABLE_NANORC) || defined(ENABLE_EXTRA)
char *make_mbstring(const char *str);
#endif
int parse_mbchar(const char *buf, char *chr, bool *bad_chr, size_t
*col);
size_t move_mbleft(const char *buf, size_t pos);
@@ -194,9 +199,11 @@ int mbstrncasecmp(const char *s1, const char *s2, size_t n);
const char *nstrcasestr(const char *haystack, const char *needle);
#endif
const char *mbstrcasestr(const char *haystack, const char *needle);
#ifndef NANO_SMALL
#if !defined(NANO_SMALL) || !defined(DISABLE_TABCOMP)
const char *revstrstr(const char *haystack, const char *needle, const
char *rev_start);
#endif
#ifndef NANO_SMALL
const char *revstrcasestr(const char *haystack, const char *needle,
const char *rev_start);
const char *mbrevstrcasestr(const char *haystack, const char *needle,
@@ -208,8 +215,15 @@ size_t nstrnlen(const char *s, size_t maxlen);
#endif
size_t mbstrnlen(const char *s, size_t maxlen);
#ifndef DISABLE_JUSTIFY
#ifdef ENABLE_NANORC
bool has_blank_chars(const char *s);
bool has_blank_mbchars(const char *s);
#endif
char *mbstrchr(const char *s, char *c);
#endif
#ifdef ENABLE_NANORC
bool is_valid_mbstring(const char *s);
#endif
/* Public functions in color.c. */
#ifdef ENABLE_COLOR
@@ -233,12 +247,12 @@ void do_uncut_text(void);
/* Public functions in files.c. */
void new_file(void);
filestruct *read_line(char *buf, filestruct *prev, bool *first_line_ins,
size_t len);
filestruct *read_line(char *buf, filestruct *prevnode, bool
*first_line_ins, size_t buf_len);
void load_file(void);
void read_file(FILE *f, const char *filename);
int open_file(const char *filename, bool newfie, FILE **f);
char *get_next_filename(const char *name);
char *get_next_filename(const char *name, const char *suffix);
#ifndef NANO_SMALL
void execute_command(const char *command);
#endif
@@ -262,18 +276,14 @@ void free_openfilestruct(openfilestruct *src);
#endif
void add_open_file(bool update);
void load_open_file(void);
void open_prevnext_file(bool next);
void open_prevnext_file(bool next_file);
void open_prevfile_void(void);
void open_nextfile_void(void);
bool close_open_file(void);
#endif
#if !defined(DISABLE_SPELLER) || !defined(DISABLE_OPERATINGDIR)
char *get_full_path(const char *origpath);
#endif
#ifndef DISABLE_SPELLER
char *check_writable_directory(const char *path);
char *safe_tempnam(void);
#endif
char *safe_tempfile(FILE **f);
#ifndef DISABLE_OPERATINGDIR
void init_operating_dir(void);
bool check_operating_dir(const char *currpath, bool allow_tabcomp);
@@ -282,16 +292,17 @@ bool check_operating_dir(const char *currpath, bool allow_tabcomp);
void init_backup_dir(void);
#endif
int copy_file(FILE *inn, FILE *out);
int write_file(const char *name, bool tmp, int append, bool
nonamechange);
int write_file(const char *name, FILE *f_open, bool tmp, int append,
bool nonamechange);
#ifndef NANO_SMALL
int write_marked(const char *name, bool tmp, int append);
int write_marked(const char *name, FILE *f_open, bool tmp, int append);
#endif
int do_writeout(bool exiting);
void do_writeout_void(void);
char *real_dir_from_tilde(const char *buf);
#if !defined(DISABLE_TABCOMP) || !defined(DISABLE_BROWSER)
int diralphasort(const void *va, const void *vb);
void free_chararray(char **array, size_t len);
#endif
#ifndef DISABLE_TABCOMP
char **username_tab_completion(const char *buf, size_t *num_matches,
@@ -302,7 +313,6 @@ char *input_tab(char *buf, size_t *place, bool *lastwastab, bool *list);
#endif
const char *tail(const char *foo);
#ifndef DISABLE_BROWSER
void free_charptrarray(char **array, size_t len);
void striponedir(char *path);
char **browser_init(const char *path, int *longest, size_t *numents, DIR
*dir);
@@ -312,7 +322,7 @@ char *do_browse_from(const char *inpath);
#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
char *histfilename(void);
void load_history(void);
bool writehist(FILE *hist, historyheadtype *histhead);
bool writehist(FILE *hist, filestruct *histhead);
void save_history(void);
#endif
@@ -321,9 +331,6 @@ size_t length_of_list(const shortcut *s);
#ifndef NANO_SMALL
void toggle_init_one(int val, const char *desc, long flag);
void toggle_init(void);
#ifdef DEBUG
void free_toggles(void);
#endif
#endif
void sc_init_one(shortcut **shortcutage, int key, const char *desc,
#ifndef DISABLE_HELP
@@ -402,8 +409,11 @@ void do_delete(void);
void do_tab(void);
void do_enter(void);
#ifndef NANO_SMALL
void do_next_word(void);
void do_prev_word(void);
bool do_next_word(bool allow_punct, bool allow_update);
void do_next_word_void(void);
bool do_prev_word(bool allow_punct, bool allow_update);
void do_prev_word_void(void);
void do_word_count(void);
void do_mark(void);
#endif
#ifndef DISABLE_WRAPPING
@@ -454,7 +464,7 @@ void allow_pending_sigwinch(bool allow);
#ifndef NANO_SMALL
void do_toggle(const toggle *which);
#endif
void disable_extended_input(void);
void disable_extended_io(void);
void disable_signals(void);
#ifndef NANO_SMALL
void enable_signals(void);
@@ -479,7 +489,7 @@ int color_to_int(const char *colorname, bool *bright);
char *parse_next_regex(char *ptr);
bool nregcomp(regex_t *preg, const char *regex, int eflags);
void parse_syntax(char *ptr);
void parse_colors(char *ptr);
void parse_colors(char *ptr, bool icase);
#endif /* ENABLE_COLOR */
void parse_rcfile(FILE *rcstream);
void do_rcfile(void);
@@ -505,32 +515,37 @@ void do_research(void);
#endif
void replace_abort(void);
#ifdef HAVE_REGEX_H
int replace_regexp(char *string, bool create_flag);
int replace_regexp(char *string, bool create);
#endif
char *replace_line(const char *needle);
ssize_t do_replace_loop(const char *needle, const filestruct
*real_current, size_t *real_current_x, bool wholewords, bool
*canceled);
void do_replace(void);
void do_gotoline(int line, bool save_pos);
void do_gotoline_void(void);
void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
bool interactive, bool save_pos);
void do_gotolinecolumn_void(void);
#if defined(ENABLE_MULTIBUFFER) || !defined(DISABLE_SPELLER)
void do_gotopos(int line, size_t pos_x, int pos_y, size_t pos_pww);
void do_gotopos(ssize_t line, size_t pos_x, ssize_t pos_y, size_t
pos_pww);
#endif
void do_find_bracket(void);
#ifndef NANO_SMALL
#ifdef HAVE_REGEX_H
void do_find_bracket(void);
#endif
#ifdef ENABLE_NANORC
bool history_has_changed(void);
#endif
void history_init(void);
historytype *find_node(historytype *h, const char *s);
void remove_node(historytype *r);
void insert_node(historytype *h, const char *s);
void update_history(historyheadtype *h, const char *s);
char *get_history_older(historyheadtype *h);
char *get_history_newer(historyheadtype *h);
char *get_history_completion(historyheadtype *h, char *s);
#ifdef DEBUG
void free_history(historyheadtype *h);
#endif
filestruct *find_history(filestruct *h_start, filestruct *h_end, const
char *s, size_t len);
void update_history(filestruct **h, const char *s);
char *get_history_older(filestruct **h);
char *get_history_newer(filestruct **h);
#ifndef DISABLE_TABCOMP
char *get_history_completion(filestruct **h, char *s, size_t len);
#endif
#endif /* !NANO_SMALL */
/* Public functions in utils.c. */
#ifdef HAVE_REGEX_H
@@ -540,10 +555,11 @@ int safe_regexec(const regex_t *preg, const char *string, size_t nmatch,
#endif
int regexp_bol_or_eol(const regex_t *preg, const char *string);
#endif
int num_of_digits(int n);
int digits(size_t n);
void get_homedir(void);
bool parse_num(const char *str, ssize_t *val);
void align(char **strp);
bool parse_line_column(const char *str, ssize_t *line, ssize_t *column);
void align(char **str);
void null_at(char **data, size_t index);
void unsunder(char *str, size_t true_len);
void sunder(char *str);
@@ -569,7 +585,7 @@ void remove_magicline(void);
void mark_order(const filestruct **top, size_t *top_x, const filestruct
**bot, size_t *bot_x, bool *right_side_up);
#endif
void get_totals(const filestruct *begin, const filestruct *end, int
void get_totals(const filestruct *begin, const filestruct *end, size_t
*lines, size_t *size);
/* Public functions in winio.c. */
@@ -625,8 +641,8 @@ void do_statusbar_backspace(void);
void do_statusbar_delete(void);
void do_statusbar_cut_text(void);
#ifndef NANO_SMALL
void do_statusbar_next_word(void);
void do_statusbar_prev_word(void);
bool do_statusbar_next_word(bool allow_punct);
bool do_statusbar_prev_word(bool allow_punct);
#endif
void do_statusbar_verbatim_input(bool *got_enter);
void do_statusbar_output(char *output, size_t output_len, bool
@@ -644,29 +660,26 @@ void check_statusblank(void);
char *display_string(const char *buf, size_t start_col, size_t len, bool
dollars);
void nanoget_repaint(const char *buf, const char *inputbuf, size_t x);
int nanogetstr(bool allow_tabs, const char *buf, const char *def,
int nanogetstr(bool allow_tabs, const char *buf, const char *curranswer,
#ifndef NANO_SMALL
historyheadtype *history_list,
filestruct **history_list,
#endif
const shortcut *s
const shortcut *s
#ifndef DISABLE_TABCOMP
, bool *list
, bool *list
#endif
);
int statusq(bool allow_tabs, const shortcut *s, const char *def,
);
int statusq(bool allow_tabs, const shortcut *s, const char *curranswer,
#ifndef NANO_SMALL
historyheadtype *history_list,
filestruct **history_list,
#endif
const char *msg, ...);
const char *msg, ...);
void statusq_abort(void);
void titlebar(const char *path);
void set_modified(void);
void statusbar(const char *msg, ...);
void bottombars(const shortcut *s);
void onekey(const char *keystroke, const char *desc, size_t len);
#ifndef NDEBUG
int check_linenumbers(const filestruct *fileptr);
#endif
size_t get_page_start(size_t column);
void reset_cursor(void);
void edit_add(const filestruct *fileptr, const char *converted, int
@@ -679,7 +692,7 @@ void edit_redraw(const filestruct *old_current, size_t old_pww);
void edit_refresh(void);
void edit_update(topmidnone location);
int do_yesno(bool all, const char *msg);
void total_update(void);
void total_redraw(void);
void total_refresh(void);
void display_main_list(void);
void do_cursorpos(bool constant);
@@ -688,7 +701,10 @@ void do_cursorpos_void(void);
size_t help_line_len(const char *ptr);
void do_help(void);
#endif
void do_replace_highlight(bool highlight_flag, const char *word);
void do_replace_highlight(bool highlight, const char *word);
#ifndef NDEBUG
int check_linenumbers(const filestruct *fileptr);
#endif
#ifdef DEBUG
void dump_buffer(const filestruct *inptr);
void dump_buffer_reverse(void);
@@ -696,3 +712,5 @@ void dump_buffer_reverse(void);
#ifdef NANO_EXTRA
void do_credits(void);
#endif
#endif /* !PROTO_H */

View File

@@ -8,14 +8,15 @@
* 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. *
* 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. *
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301, USA. *
* *
**************************************************************************/
@@ -32,29 +33,17 @@
#include <ctype.h>
#include <assert.h>
#include "proto.h"
#include "nano.h"
#ifdef ENABLE_NANORC
const static rcoption rcopts[] = {
#ifndef NANO_SMALL
{"autoindent", AUTOINDENT},
{"backup", BACKUP_FILE},
{"backupdir", 0},
#endif
#ifndef DISABLE_JUSTIFY
{"brackets", 0},
#endif
{"const", CONSTUPDATE},
#ifndef NANO_SMALL
{"cut", CUT_TO_END},
#endif
{"const", CONST_UPDATE},
#ifndef DISABLE_WRAPJUSTIFY
{"fill", 0},
#endif
#ifndef NANO_SMALL
{"historylog", HISTORYLOG},
#endif
#ifndef DISABLE_MOUSE
{"mouse", USE_MOUSE},
#endif
@@ -62,9 +51,6 @@ const static rcoption rcopts[] = {
{"multibuffer", MULTIBUFFER},
#endif
{"morespace", MORE_SPACE},
#ifndef NANO_SMALL
{"noconvert", NO_CONVERT},
#endif
{"nofollow", NOFOLLOW_SYMLINKS},
{"nohelp", NO_HELP},
#ifndef DISABLE_WRAPPING
@@ -82,10 +68,6 @@ const static rcoption rcopts[] = {
#ifdef HAVE_REGEX_H
{"regexp", USE_REGEXP},
#endif
#ifndef NANO_SMALL
{"smarthome", SMART_HOME},
{"smooth", SMOOTHSCROLL},
#endif
#ifndef DISABLE_SPELLER
{"speller", 0},
#endif
@@ -94,13 +76,25 @@ const static rcoption rcopts[] = {
{"tempfile", TEMP_FILE},
{"view", VIEW_MODE},
#ifndef NANO_SMALL
{"autoindent", AUTOINDENT},
{"backup", BACKUP_FILE},
{"backupdir", 0},
{"backwards", BACKWARDS_SEARCH},
{"casesensitive", CASE_SENSITIVE},
{"cut", CUT_TO_END},
{"historylog", HISTORYLOG},
{"noconvert", NO_CONVERT},
{"quickblank", QUICK_BLANK},
{"smarthome", SMART_HOME},
{"smooth", SMOOTH_SCROLL},
{"tabstospaces", TABS_TO_SPACES},
{"whitespace", 0},
#endif
{NULL, 0}
};
static bool errors = FALSE;
static int lineno = 0;
static size_t lineno = 0;
static char *nanorc = NULL;
#ifdef ENABLE_COLOR
static syntaxtype *endsyntax = NULL;
@@ -110,7 +104,7 @@ static colortype *endcolor = NULL;
#endif
/* We have an error in some part of the rcfile. Put it on stderr and
* make the user hit return to continue starting up nano. */
* make the user hit Return to continue starting up nano. */
void rcfile_error(const char *msg, ...)
{
va_list ap;
@@ -118,7 +112,8 @@ void rcfile_error(const char *msg, ...)
fprintf(stderr, "\n");
if (lineno > 0) {
errors = TRUE;
fprintf(stderr, _("Error in %s on line %d: "), nanorc, lineno);
fprintf(stderr, _("Error in %s on line %lu: "), nanorc,
(unsigned long)lineno);
}
va_start(ap, msg);
@@ -132,7 +127,7 @@ void rcfile_error(const char *msg, ...)
* the end of the line. */
char *parse_next_word(char *ptr)
{
while (!is_blank_char(*ptr) && *ptr != '\0')
while (!isblank(*ptr) && *ptr != '\0')
ptr++;
if (*ptr == '\0')
@@ -141,7 +136,7 @@ char *parse_next_word(char *ptr)
/* Null-terminate and advance ptr. */
*ptr++ = '\0';
while (is_blank_char(*ptr))
while (isblank(*ptr))
ptr++;
return ptr;
@@ -181,7 +176,7 @@ char *parse_argument(char *ptr)
ptr = last_quote + 1;
}
if (ptr != NULL)
while (is_blank_char(*ptr))
while (isblank(*ptr))
ptr++;
return ptr;
}
@@ -191,12 +186,7 @@ int color_to_int(const char *colorname, bool *bright)
{
int mcolor = -1;
if (colorname == NULL) {
rcfile_error(N_("Missing color name"));
return -1;
}
assert(bright != NULL);
assert(colorname != NULL && bright != NULL);
if (strncasecmp(colorname, "bright", 6) == 0) {
*bright = TRUE;
@@ -235,7 +225,7 @@ char *parse_next_regex(char *ptr)
/* Continue until the end of the line, or a " followed by a space, a
* blank character, or \0. */
while ((*ptr != '"' || (!is_blank_char(*(ptr + 1)) &&
while ((*ptr != '"' || (!isblank(*(ptr + 1)) &&
*(ptr + 1) != '\0')) && *ptr != '\0')
ptr++;
@@ -250,7 +240,7 @@ char *parse_next_regex(char *ptr)
/* Null terminate and advance ptr. */
*ptr++ = '\0';
while (is_blank_char(*ptr))
while (isblank(*ptr))
ptr++;
return ptr;
@@ -352,11 +342,12 @@ void parse_syntax(char *ptr)
}
}
/* Parse the color stuff into the colorstrings array. */
void parse_colors(char *ptr)
/* Parse the color stuff into the colorstrings array. If icase is TRUE,
* treat the color stuff as case insensitive. */
void parse_colors(char *ptr, bool icase)
{
int fg, bg;
bool bright = FALSE;
bool bright = FALSE, no_fgcolor = FALSE;
char *fgstr;
assert(ptr != NULL);
@@ -371,8 +362,15 @@ void parse_colors(char *ptr)
if (strchr(fgstr, ',') != NULL) {
char *bgcolorname;
strtok(fgstr, ",");
bgcolorname = strtok(NULL, ",");
if (bgcolorname == NULL) {
/* If we have a background color without a foreground color,
* parse it properly. */
bgcolorname = fgstr + 1;
no_fgcolor = TRUE;
}
if (strncasecmp(bgcolorname, "bright", 6) == 0) {
rcfile_error(
N_("Background color %s cannot be bright"),
@@ -383,11 +381,14 @@ void parse_colors(char *ptr)
} else
bg = -1;
fg = color_to_int(fgstr, &bright);
if (!no_fgcolor) {
fg = color_to_int(fgstr, &bright);
/* Don't try to parse screwed-up foreground colors. */
if (fg == -1)
return;
/* Don't try to parse screwed-up foreground colors. */
if (fg == -1)
return;
} else
fg = -1;
if (syntaxes == NULL) {
rcfile_error(
@@ -395,9 +396,13 @@ void parse_colors(char *ptr)
return;
}
/* Now for the fun part. Start adding regexps to individual strings
* in the colorstrings array, woo! */
if (*ptr == '\0') {
rcfile_error(N_("Missing regex string"));
return;
}
/* Now for the fun part. Start adding regexes to individual strings
* in the colorstrings array, woo! */
while (ptr != NULL && *ptr != '\0') {
colortype *newcolor;
/* The new color structure. */
@@ -426,7 +431,7 @@ void parse_colors(char *ptr)
if (ptr == NULL)
break;
if (nregcomp(&newcolor->start, fgstr, 0)) {
if (nregcomp(&newcolor->start, fgstr, icase ? REG_ICASE : 0)) {
free(newcolor);
cancelled = TRUE;
} else {
@@ -476,7 +481,7 @@ void parse_colors(char *ptr)
continue;
newcolor->end = (regex_t *)nmalloc(sizeof(regex_t));
if (nregcomp(newcolor->end, fgstr, 0)) {
if (nregcomp(newcolor->end, fgstr, icase ? REG_ICASE : 0)) {
free(newcolor->end);
newcolor->end = NULL;
}
@@ -501,7 +506,7 @@ void parse_rcfile(FILE *rcstream)
lineno++;
ptr = buf;
while (is_blank_char(*ptr))
while (isblank(*ptr))
ptr++;
/* If we have a blank line or a comment, skip to the next
@@ -522,7 +527,9 @@ void parse_rcfile(FILE *rcstream)
else if (strcasecmp(keyword, "syntax") == 0)
parse_syntax(ptr);
else if (strcasecmp(keyword, "color") == 0)
parse_colors(ptr);
parse_colors(ptr, FALSE);
else if (strcasecmp(keyword, "icolor") == 0)
parse_colors(ptr, TRUE);
#endif /* ENABLE_COLOR */
else
rcfile_error(N_("Command %s not understood"), keyword);
@@ -561,10 +568,20 @@ void parse_rcfile(FILE *rcstream)
if (*option == '"')
option++;
ptr = parse_argument(ptr);
option = make_mbstring(option);
option = mallocstrcpy(NULL, option);
#ifdef DEBUG
fprintf(stderr, "option = \"%s\"\n", option);
#endif
/* Make sure option is a valid multibyte
* string. */
if (!is_valid_mbstring(option)) {
rcfile_error(
N_("Option is not a valid multibyte string"));
break;
}
#ifndef DISABLE_OPERATINGDIR
if (strcasecmp(rcopts[i].name, "operatingdir") == 0)
operating_dir = option;
@@ -584,7 +601,8 @@ void parse_rcfile(FILE *rcstream)
#ifndef NANO_SMALL
if (strcasecmp(rcopts[i].name, "whitespace") == 0) {
whitespace = option;
if (mbstrlen(whitespace) != 2 || strlenpt(whitespace) != 2) {
if (mbstrlen(whitespace) != 2 ||
strlenpt(whitespace) != 2) {
rcfile_error(
N_("Two single-column characters required"));
free(whitespace);
@@ -603,20 +621,18 @@ void parse_rcfile(FILE *rcstream)
#ifndef DISABLE_JUSTIFY
if (strcasecmp(rcopts[i].name, "punct") == 0) {
punct = option;
if (strchr(punct, '\t') != NULL ||
strchr(punct, ' ') != NULL) {
if (has_blank_mbchars(punct)) {
rcfile_error(
N_("Non-tab and non-space characters required"));
N_("Non-blank characters required"));
free(punct);
punct = NULL;
}
} else if (strcasecmp(rcopts[i].name,
"brackets") == 0) {
brackets = option;
if (strchr(brackets, '\t') != NULL ||
strchr(brackets, ' ') != NULL) {
if (has_blank_mbchars(brackets)) {
rcfile_error(
N_("Non-tab and non-space characters required"));
N_("Non-blank characters required"));
free(brackets);
brackets = NULL;
}

View File

@@ -8,14 +8,15 @@
* 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. *
* 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. *
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301, USA. *
* *
**************************************************************************/
@@ -31,10 +32,13 @@
#include <errno.h>
#include <assert.h>
#include "proto.h"
#include "nano.h"
static bool search_last_line = FALSE;
/* Have we gone past the last line while searching? */
#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
static bool history_changed = FALSE;
/* Have any of the history lists changed? */
#endif
#ifdef HAVE_REGEX_H
static bool regexp_compiled = FALSE;
/* Have we compiled any regular expressions? */
@@ -145,10 +149,6 @@ int search_init(bool replacing, bool use_answer)
search_init_globals();
#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, FALSE);
@@ -186,7 +186,7 @@ int search_init(bool replacing, bool use_answer)
#ifndef NANO_SMALL
/* This string is just a modifier for the search prompt; no
* grammar is implied. */
ISSET(REVERSE_SEARCH) ? _(" [Backwards]") :
ISSET(BACKWARDS_SEARCH) ? _(" [Backwards]") :
#endif
"",
@@ -212,9 +212,6 @@ int search_init(bool replacing, bool use_answer)
if (i == -1 || (i < 0 && last_search[0] == '\0') ||
(!replacing && i == 0 && answer[0] == '\0')) {
statusbar(_("Cancelled"));
#ifndef NANO_SMALL
search_history.current = search_history.next;
#endif
return -1;
} else {
switch (i) {
@@ -238,30 +235,29 @@ int search_init(bool replacing, bool use_answer)
backupstring = mallocstrcpy(backupstring, answer);
return 1;
case TOGGLE_BACKWARDS_KEY:
TOGGLE(REVERSE_SEARCH);
TOGGLE(BACKWARDS_SEARCH);
backupstring = mallocstrcpy(backupstring, answer);
return 1;
#endif
#ifdef HAVE_REGEX_H
case TOGGLE_REGEXP_KEY:
case NANO_REGEXP_KEY:
TOGGLE(USE_REGEXP);
backupstring = mallocstrcpy(backupstring, answer);
return 1;
#endif
#endif /* !NANO_SMALL */
case NANO_TOOTHERSEARCH_KEY:
backupstring = mallocstrcpy(backupstring, answer);
return -2; /* Call the opposite search function. */
case NANO_TOGOTOLINE_KEY:
#ifndef NANO_SMALL
search_history.current = search_history.next;
#endif
do_gotoline(-1, FALSE); /* Put answer up on the
* statusbar and fall
* through. */
do_gotolinecolumn(current->lineno, placewewant + 1,
TRUE, TRUE, FALSE);
/* Put answer up on the statusbar and
* fall through. */
default:
return -1;
}
}
return 0;
}
@@ -277,11 +273,11 @@ bool is_whole_word(size_t pos, const char *buf, const char *word)
parse_mbchar(buf + word_end, r, NULL, NULL);
/* If we're at the beginning of the line or the character before the
* word isn't an alphanumeric character, and if we're at the end of
* the line or the character after the word isn't an alphanumeric
* character, we have a whole word. */
retval = (pos == 0 || !is_alnum_mbchar(p)) &&
(word_end == strlen(buf) || !is_alnum_mbchar(r));
* word isn't a non-punctuation "word" character, and if we're at
* the end of the line or the character after the word isn't a
* non-punctuation "word" character, we have a whole word. */
retval = (pos == 0 || !is_word_mbchar(p, FALSE)) &&
(word_end == strlen(buf) || !is_word_mbchar(r, FALSE));
free(p);
free(r);
@@ -306,7 +302,7 @@ bool findnextstr(bool can_display_wrap, bool wholeword, bool
/* The length of the match we found. */
size_t current_x_find = 0;
/* The location of the match we found. */
int current_y_find = current_y;
ssize_t current_y_find = current_y;
/* rev_start might end up 1 character before the start or after the
* end of the line. This won't be a problem because strstrwrapper()
@@ -315,7 +311,7 @@ bool findnextstr(bool can_display_wrap, bool wholeword, bool
* previous or next line. */
rev_start =
#ifndef NANO_SMALL
ISSET(REVERSE_SEARCH) ? fileptr->data + (current_x - 1) :
ISSET(BACKWARDS_SEARCH) ? fileptr->data + (current_x - 1) :
#endif
fileptr->data + (current_x + 1);
@@ -364,7 +360,7 @@ bool findnextstr(bool can_display_wrap, bool wholeword, bool
}
#ifndef NANO_SMALL
if (ISSET(REVERSE_SEARCH)) {
if (ISSET(BACKWARDS_SEARCH)) {
fileptr = fileptr->prev;
current_y_find--;
} else {
@@ -381,7 +377,7 @@ bool findnextstr(bool can_display_wrap, bool wholeword, bool
return FALSE;
#ifndef NANO_SMALL
if (ISSET(REVERSE_SEARCH)) {
if (ISSET(BACKWARDS_SEARCH)) {
fileptr = filebot;
current_y_find = editwinrows - 1;
} else {
@@ -402,7 +398,7 @@ bool findnextstr(bool can_display_wrap, bool wholeword, bool
rev_start = fileptr->data;
#ifndef NANO_SMALL
if (ISSET(REVERSE_SEARCH))
if (ISSET(BACKWARDS_SEARCH))
rev_start += strlen(fileptr->data);
#endif
}
@@ -413,13 +409,12 @@ bool findnextstr(bool can_display_wrap, bool wholeword, bool
/* Ensure we haven't wrapped around again! */
if (search_last_line &&
#ifndef NANO_SMALL
((!ISSET(REVERSE_SEARCH) && current_x_find > beginx) ||
(ISSET(REVERSE_SEARCH) && current_x_find < beginx))
((!ISSET(BACKWARDS_SEARCH) && current_x_find > beginx) ||
(ISSET(BACKWARDS_SEARCH) && current_x_find < beginx))
#else
current_x_find > beginx
#endif
) {
if (can_display_wrap)
not_found_msg(needle);
return FALSE;
@@ -461,7 +456,7 @@ void do_search(void)
search_abort();
else if (i == -2) /* Replace. */
do_replace();
#ifndef NANO_SMALL
#if !defined(NANO_SMALL) || defined(HAVE_REGEX_H)
else if (i == 1) /* Case Sensitive, Backwards, or Regexp search
* toggle. */
do_search();
@@ -554,7 +549,8 @@ void do_research(void)
last_search)) {
didfind = findnextstr(TRUE, FALSE, TRUE, current,
current_x, answer, NULL);
if (fileptr == current && fileptr_x == current_x && !didfind)
if (fileptr == current && fileptr_x == current_x &&
!didfind)
statusbar(_("This is the only occurrence"));
} else {
#endif
@@ -582,15 +578,17 @@ void replace_abort(void)
}
#ifdef HAVE_REGEX_H
int replace_regexp(char *string, bool create_flag)
int replace_regexp(char *string, bool create)
{
/* Split personality here - if create_flag is FALSE, just calculate
* the size of the replacement line (necessary because of
/* We have a split personality here. If create is FALSE, just
* calculate the size of the replacement line (necessary because of
* subexpressions \1 to \9 in the replaced text). */
const char *c = last_replace;
int search_match_count = regmatches[0].rm_eo - regmatches[0].rm_so;
int new_size = strlen(current->data) + 1 - search_match_count;
size_t search_match_count =
regmatches[0].rm_eo - regmatches[0].rm_so;
size_t new_line_size =
strlen(current->data) + 1 - search_match_count;
/* Iterate through the replacement text to handle subexpression
* replacement using \1, \2, \3, etc. */
@@ -599,22 +597,22 @@ int replace_regexp(char *string, bool create_flag)
if (*c != '\\' || num < 1 || num > 9 ||
num > search_regexp.re_nsub) {
if (create_flag)
if (create)
*string++ = *c;
c++;
new_size++;
new_line_size++;
} else {
int i = regmatches[num].rm_eo - regmatches[num].rm_so;
size_t i = regmatches[num].rm_eo - regmatches[num].rm_so;
/* Skip over the replacement expression. */
c += 2;
/* But add the length of the subexpression to new_size. */
new_size += i;
new_line_size += i;
/* And if create_flag is TRUE, append the result of the
/* And if create is TRUE, append the result of the
* subexpression match to the new line. */
if (create_flag) {
if (create) {
strncpy(string, current->data + current_x +
regmatches[num].rm_so, i);
string += i;
@@ -622,24 +620,23 @@ int replace_regexp(char *string, bool create_flag)
}
}
if (create_flag)
if (create)
*string = '\0';
return new_size;
return new_line_size;
}
#endif
char *replace_line(const char *needle)
{
char *copy;
int new_line_size;
int search_match_count;
size_t new_line_size, search_match_count;
/* Calculate the size of the new line. */
#ifdef HAVE_REGEX_H
if (ISSET(USE_REGEXP)) {
search_match_count = regmatches[0].rm_eo - regmatches[0].rm_so;
new_line_size = replace_regexp(NULL, 0);
new_line_size = replace_regexp(NULL, FALSE);
} else {
#endif
search_match_count = strlen(needle);
@@ -665,6 +662,7 @@ char *replace_line(const char *needle)
/* The tail of the original line. */
assert(current_x + search_match_count <= strlen(current->data));
strcat(copy, current->data + current_x + search_match_count);
return copy;
@@ -684,7 +682,6 @@ ssize_t do_replace_loop(const char *needle, const filestruct
{
ssize_t numreplaced = -1;
size_t match_len;
size_t pww_save = placewewant;
bool replaceall = FALSE;
#ifdef HAVE_REGEX_H
/* The starting-line match and bol/eol regex flags. */
@@ -726,7 +723,6 @@ ssize_t do_replace_loop(const char *needle, const filestruct
FALSE
#endif
, real_current, *real_current_x, needle, &match_len)) {
int i = 0;
#ifdef HAVE_REGEX_H
@@ -746,31 +742,29 @@ ssize_t do_replace_loop(const char *needle, const filestruct
}
#endif
if (!replaceall) {
edit_redraw(real_current, pww_save);
pww_save = placewewant;
}
if (!replaceall)
edit_refresh();
/* Record for the return value that we found the search
* string. */
/* Indicate that we found the search string. */
if (numreplaced == -1)
numreplaced = 0;
if (!replaceall) {
char *exp_word;
size_t xpt = xplustabs();
exp_word = display_string(current->data, xpt,
strnlenpt(current->data, match_len + current_x) - xpt,
char *exp_word = display_string(current->data, xpt,
strnlenpt(current->data, current_x + match_len) - xpt,
FALSE);
curs_set(0);
do_replace_highlight(TRUE, exp_word);
i = do_yesno(TRUE, _("Replace this instance?"));
do_replace_highlight(FALSE, exp_word);
free(exp_word);
curs_set(1);
if (i == -1) { /* We canceled the replace. */
@@ -833,7 +827,7 @@ ssize_t do_replace_loop(const char *needle, const filestruct
* text. Note that current_x might be set to (size_t)-1
* here. */
#ifndef NANO_SMALL
if (!ISSET(REVERSE_SEARCH))
if (!ISSET(BACKWARDS_SEARCH))
#endif
current_x += match_len + length_change - 1;
@@ -913,11 +907,6 @@ void do_replace(void)
last_search = mallocstrcpy(last_search, answer);
}
#ifndef NANO_SMALL
replace_history.current = (historytype *)&replace_history.next;
last_replace = mallocstrcpy(last_replace, "");
#endif
i = statusq(FALSE, replace_list_2, last_replace,
#ifndef NANO_SMALL
&replace_history,
@@ -962,21 +951,26 @@ void do_replace(void)
edit_refresh();
if (numreplaced >= 0)
statusbar(P_("Replaced %ld occurrence", "Replaced %ld occurrences",
(long)numreplaced), (long)numreplaced);
statusbar(P_("Replaced %lu occurrence",
"Replaced %lu occurrences", (unsigned long)numreplaced),
(unsigned long)numreplaced);
replace_abort();
}
void do_gotoline(int line, bool save_pos)
/* Go to the specified line and column, or ask for them if interactive
* is TRUE. Save the x-coordinate and y-coordinate if save_pos is TRUE.
* Note that both the line and column numbers should be one-based. */
void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
bool interactive, bool save_pos)
{
if (line <= 0) { /* Ask for it. */
if (interactive) { /* Ask for it. */
char *ans = mallocstrcpy(NULL, answer);
int i = statusq(FALSE, gotoline_list, line < 0 ? ans : "",
int i = statusq(FALSE, gotoline_list, use_answer ? ans : "",
#ifndef NANO_SMALL
NULL,
#endif
_("Enter line number"));
_("Enter line number, column number"));
free(ans);
@@ -996,52 +990,50 @@ void do_gotoline(int line, bool save_pos)
}
/* Do a bounds check. Display a warning on an out-of-bounds
* line number only if we hit Enter at the statusbar prompt. */
if (!parse_num(answer, &line) || line < 0) {
* line or column number only if we hit Enter at the statusbar
* prompt. */
if (!parse_line_column(answer, &line, &column) || line < 1 ||
column < 1) {
if (i == 0)
statusbar(_("Come on, be reasonable"));
display_main_list();
return;
}
}
if (current->lineno > line) {
for (; current->prev != NULL && current->lineno > line;
current = current->prev)
;
} else {
for (; current->next != NULL && current->lineno < line;
current = current->next)
;
if (line < 1)
line = current->lineno;
if (column < 1)
column = placewewant + 1;
}
current_x = 0;
for (current = fileage; current->next != NULL && line > 1; line--)
current = current->next;
current_x = actual_x(current->data, column - 1);
placewewant = column - 1;
/* If save_pos is TRUE, don't change the cursor position when
* updating the edit window. */
edit_update(save_pos ? NONE : CENTER);
placewewant = 0;
display_main_list();
}
void do_gotoline_void(void)
void do_gotolinecolumn_void(void)
{
do_gotoline(0, FALSE);
do_gotolinecolumn(current->lineno, placewewant + 1, FALSE, TRUE,
FALSE);
}
#if defined(ENABLE_MULTIBUFFER) || !defined(DISABLE_SPELLER)
void do_gotopos(int line, size_t pos_x, int pos_y, size_t pos_pww)
void do_gotopos(ssize_t line, size_t pos_x, ssize_t pos_y, size_t
pos_pww)
{
/* Since do_gotoline() resets the x-coordinate but not the
/* Since do_gotolinecolumn() resets the x-coordinate but not the
* y-coordinate, set the coordinates up this way. */
current_y = pos_y;
do_gotoline(line, TRUE);
/* Make sure that the x-coordinate is sane here. */
current_x = strlen(current->data);
if (pos_x < current_x)
current_x = pos_x;
do_gotolinecolumn(line, pos_x + 1, FALSE, FALSE, TRUE);
/* Set the rest of the coordinates up. */
placewewant = pos_pww;
@@ -1049,52 +1041,53 @@ void do_gotopos(int line, size_t pos_x, int pos_y, size_t pos_pww)
}
#endif
#if !defined(NANO_SMALL) && defined(HAVE_REGEX_H)
#ifndef NANO_SMALL
#ifdef HAVE_REGEX_H
void do_find_bracket(void)
{
char ch_under_cursor, wanted_ch;
const char *pos, *brackets = "([{<>}])";
char regexp_pat[] = "[ ]";
const char *pos, *bracket_pat = "([{<>}])";
char cursor_ch, wanted_ch, regexp_pat[] = "[ ]";
size_t current_x_save, pww_save;
int count = 1;
unsigned long flags_save;
bool regexp_set = ISSET(USE_REGEXP);
bool backwards_search_set = ISSET(BACKWARDS_SEARCH);
filestruct *current_save;
ch_under_cursor = current->data[current_x];
cursor_ch = current->data[current_x];
pos = strchr(bracket_pat, cursor_ch);
pos = strchr(brackets, ch_under_cursor);
if (ch_under_cursor == '\0' || pos == NULL) {
if (cursor_ch == '\0' || pos == NULL) {
statusbar(_("Not a bracket"));
return;
}
assert(strlen(brackets) % 2 == 0);
assert(strlen(bracket_pat) % 2 == 0);
wanted_ch = brackets[(strlen(brackets) - 1) - (pos - brackets)];
wanted_ch =
bracket_pat[(strlen(bracket_pat) - 1) - (pos - bracket_pat)];
current_save = current;
current_x_save = current_x;
pww_save = placewewant;
flags_save = flags;
SET(USE_REGEXP);
/* Apparent near redundancy with regexp_pat[] here is needed.
* "[][]" works, "[[]]" doesn't. */
if (pos < brackets + (strlen(brackets) / 2)) {
if (pos < bracket_pat + (strlen(bracket_pat) / 2)) {
/* On a left bracket. */
regexp_pat[1] = wanted_ch;
regexp_pat[2] = ch_under_cursor;
UNSET(REVERSE_SEARCH);
regexp_pat[2] = cursor_ch;
UNSET(BACKWARDS_SEARCH);
} else {
/* On a right bracket. */
regexp_pat[1] = ch_under_cursor;
regexp_pat[1] = cursor_ch;
regexp_pat[2] = wanted_ch;
SET(REVERSE_SEARCH);
SET(BACKWARDS_SEARCH);
}
regexp_init(regexp_pat);
/* We constructed regexp_pat to be a valid expression. */
/* We constructed regexp_pat to be a valid regular expression. */
assert(regexp_compiled);
findnextstr_wrap_reset();
@@ -1102,7 +1095,7 @@ void do_find_bracket(void)
if (findnextstr(FALSE, FALSE, FALSE, current, current_x,
regexp_pat, NULL)) {
/* Found identical bracket. */
if (current->data[current_x] == ch_under_cursor)
if (current->data[current_x] == cursor_ch)
count++;
/* Found complementary bracket. */
else if (--count == 0) {
@@ -1121,133 +1114,201 @@ void do_find_bracket(void)
}
regexp_cleanup();
flags = flags_save;
/* Restore search direction. */
if (backwards_search_set)
SET(BACKWARDS_SEARCH);
else
UNSET(BACKWARDS_SEARCH);
/* Restore regular expression usage setting. */
if (!regexp_set)
UNSET(USE_REGEXP);
}
#endif /* HAVE_REGEX_H */
#ifdef ENABLE_NANORC
/* Indicate whether any of the history lists have changed. */
bool history_has_changed(void)
{
return history_changed;
}
#endif
#ifndef NANO_SMALL
/*
* search and replace history list support functions
*/
/* initialize search and replace history lists */
/* Initialize the search and replace history lists. */
void history_init(void)
{
search_history.next = (historytype *)&search_history.prev;
search_history.prev = NULL;
search_history.tail = (historytype *)&search_history.next;
search_history.current = search_history.next;
search_history.count = 0;
search_history.len = 0;
search_history = make_new_node(NULL);
search_history->data = mallocstrcpy(NULL, "");
searchage = search_history;
searchbot = search_history;
replace_history.next = (historytype *)&replace_history.prev;
replace_history.prev = NULL;
replace_history.tail = (historytype *)&replace_history.next;
replace_history.current = replace_history.next;
replace_history.count = 0;
replace_history.len = 0;
replace_history = make_new_node(NULL);
replace_history->data = mallocstrcpy(NULL, "");
replaceage = replace_history;
replacebot = replace_history;
}
/* find first node containing string *s in history list *h */
historytype *find_node(historytype *h, const char *s)
/* Return the first node containing the first len characters of the
* string s in the history list, starting at h_start and ending at
* h_end, or NULL if there isn't one. */
filestruct *find_history(filestruct *h_start, filestruct *h_end, const
char *s, size_t len)
{
for (; h->next != NULL; h = h->next)
if (strcmp(s, h->data) == 0)
return h;
filestruct *p;
for (p = h_start; p != h_end->next && p != NULL; p = p->next) {
if (strncmp(s, p->data, len) == 0)
return p;
}
return NULL;
}
/* remove node *r */
void remove_node(historytype *r)
/* Update a history list. h should be the current position in the
* list. */
void update_history(filestruct **h, const char *s)
{
r->prev->next = r->next;
r->next->prev = r->prev;
free(r->data);
free(r);
}
filestruct **hage = NULL, **hbot = NULL, *p;
/* add a node after node *h */
void insert_node(historytype *h, const char *s)
{
historytype *a;
assert(h != NULL && s != NULL);
a = (historytype *)nmalloc(sizeof(historytype));
a->next = h->next;
a->prev = h;
h->next->prev = a;
h->next = a;
a->data = mallocstrcpy(NULL, s);
}
/* update history list */
void update_history(historyheadtype *h, const char *s)
{
historytype *p;
if ((p = find_node(h->next, s)) != NULL) {
if (p == h->next) /* catch delete and re-insert of
same string in 1st node */
goto up_hs;
remove_node(p); /* delete identical older string */
h->count--;
if (*h == search_history) {
hage = &searchage;
hbot = &searchbot;
} else if (*h == replace_history) {
hage = &replaceage;
hbot = &replacebot;
}
if (h->count == MAX_SEARCH_HISTORY) { /* list 'full', delete oldest */
remove_node(h->tail);
h->count--;
assert(hage != NULL && hbot != NULL);
/* If this string is already in the history, delete it. */
p = find_history(*hage, *hbot, s, (size_t)-1);
if (p != NULL) {
filestruct *foo, *bar;
/* If the string is at the beginning, move the beginning down to
* the next string. */
if (p == *hage)
*hage = (*hage)->next;
/* Delete the string. */
foo = p;
bar = p->next;
unlink_node(foo);
delete_node(foo);
renumber(bar);
}
insert_node((historytype *)h, s);
h->count++;
SET(HISTORY_CHANGED);
up_hs:
h->current = h->next;
}
/* return a pointer to either the next older history or NULL if no more */
char *get_history_older(historyheadtype *h)
{
if (h->current->next != NULL) { /* any older entries? */
h->current = h->current->next; /* yes */
return h->current->data; /* return it */
/* If the history is full, delete the beginning entry to make room
* for the new entry at the end. */
if ((*hbot)->lineno == MAX_SEARCH_HISTORY + 1) {
filestruct *foo = *hage;
*hage = (*hage)->next;
unlink_node(foo);
delete_node(foo);
renumber(*hage);
}
return NULL; /* end of list */
}
char *get_history_newer(historyheadtype *h)
{
if (h->current->prev != NULL) {
h->current = h->current->prev;
if (h->current->prev != NULL)
return h->current->data;
}
return NULL;
}
/* Add the new entry to the end. */
(*hbot)->data = mallocstrcpy(NULL, s);
splice_node(*hbot, make_new_node(*hbot), (*hbot)->next);
*hbot = (*hbot)->next;
(*hbot)->data = mallocstrcpy(NULL, "");
/* get a completion */
char *get_history_completion(historyheadtype *h, char *s)
{
historytype *p;
for (p = h->current->next; p->next != NULL; p = p->next) {
if (strncmp(s, p->data, h->len) == 0 && strlen(p->data) != h->len) {
h->current = p;
return p->data;
}
}
h->current = (historytype*)h;
null_at(&s, h->len);
return s;
}
#ifdef DEBUG
/* free a history list */
void free_history(historyheadtype *h)
{
historytype *p;
for (p = h->next; p->next != NULL; p = p->next)
remove_node(p);
}
#ifdef ENABLE_NANORC
/* Indicate that the history's been changed. */
history_changed = TRUE;
#endif
/* end of history support functions */
/* Set the current position in the list to the bottom. */
*h = *hbot;
}
/* Move h to the string in the history list just before it, and return
* that string. If there isn't one, don't move h and return NULL. */
char *get_history_older(filestruct **h)
{
assert(h != NULL);
if ((*h)->prev == NULL)
return NULL;
*h = (*h)->prev;
return (*h)->data;
}
/* Move h to the string in the history list just after it, and return
* that string. If there isn't one, don't move h and return NULL. */
char *get_history_newer(filestruct **h)
{
assert(h != NULL);
if ((*h)->next == NULL)
return NULL;
*h = (*h)->next;
return (*h)->data;
}
#ifndef DISABLE_TABCOMP
/* Move h to the next string that's a tab completion of the string s,
* looking at only the first len characters of s, and return that
* string. If there isn't one, or if len is 0, don't move h and return
* s. */
char *get_history_completion(filestruct **h, char *s, size_t len)
{
assert(s != NULL);
if (len > 0) {
filestruct *hage = NULL, *hbot = NULL, *p;
assert(h != NULL);
if (*h == search_history) {
hage = searchage;
hbot = searchbot;
} else if (*h == replace_history) {
hage = replaceage;
hbot = replacebot;
}
assert(hage != NULL && hbot != NULL);
/* Search the history list from the current position to the
* bottom for a match of len characters. Skip over an exact
* match. */
p = find_history((*h)->next, hbot, s, len);
while (p != NULL && strcmp(p->data, s) == 0)
p = find_history(p->next, hbot, s, len);
if (p != NULL) {
*h = p;
return (*h)->data;
}
/* Search the history list from the top to the current position
* for a match of len characters. Skip over an exact match. */
p = find_history(hage, *h, s, len);
while (p != NULL && strcmp(p->data, s) == 0)
p = find_history(p->next, *h, s, len);
if (p != NULL) {
*h = p;
return (*h)->data;
}
}
/* If we're here, we didn't find a match, we didn't find an inexact
* match, or len is 0. Return s. */
return s;
}
#endif
#endif /* !NANO_SMALL */

View File

@@ -8,14 +8,15 @@
* 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. *
* 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. *
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301, USA. *
* *
**************************************************************************/
@@ -32,7 +33,6 @@
#include <errno.h>
#include <assert.h>
#include "proto.h"
#include "nano.h"
#ifdef HAVE_REGEX_H
#ifdef BROKEN_REGEXEC
@@ -55,13 +55,10 @@ int regexp_bol_or_eol(const regex_t *preg, const char *string)
}
#endif /* HAVE_REGEX_H */
int num_of_digits(int n)
int digits(size_t n)
{
int i = 1;
if (n < 0)
n = -n;
while (n > 10) {
n /= 10;
i++;
@@ -108,13 +105,46 @@ bool parse_num(const char *str, ssize_t *val)
return TRUE;
}
/* Fix the memory allocation for a string. */
void align(char **strp)
/* Read an int and a ssize_t, separated by a comma, from str, and store
* them in *line and *column (if they're not both NULL). On error, we
* return FALSE. Otherwise, we return TRUE. */
bool parse_line_column(const char *str, ssize_t *line, ssize_t *column)
{
assert(strp != NULL);
bool retval = TRUE;
const char *comma;
if (*strp != NULL)
*strp = charealloc(*strp, strlen(*strp) + 1);
assert(str != NULL);
comma = strchr(str, ',');
if (comma != NULL && column != NULL) {
if (!parse_num(str + (comma - str + 1), column))
retval = FALSE;
}
if (line != NULL) {
if (comma != NULL) {
char *str_line = mallocstrncpy(NULL, str, comma - str + 1);
str_line[comma - str] = '\0';
if (str_line[0] != '\0' && !parse_num(str_line, line))
retval = FALSE;
free(str_line);
} else if (!parse_num(str, line))
retval = FALSE;
}
return retval;
}
/* Fix the memory allocation for a string. */
void align(char **str)
{
assert(str != NULL);
if (*str != NULL)
*str = charealloc(*str, strlen(*str) + 1);
}
/* Null a string at a certain index and align it. */
@@ -174,15 +204,15 @@ ssize_t ngetdelim(char **lineptr, size_t *n, int delim, FILE *stream)
/* Allocate the line the first time. */
if (*lineptr == NULL) {
*lineptr = charalloc(128);
*n = 128;
*lineptr = charalloc(MAX_BUF_SIZE);
*n = MAX_BUF_SIZE;
}
while ((c = getc(stream)) != EOF) {
/* Check if more memory is needed. */
if (indx >= *n) {
*lineptr = charealloc(*lineptr, *n + 128);
*n += 128;
*lineptr = charealloc(*lineptr, *n + MAX_BUF_SIZE);
*n += MAX_BUF_SIZE;
}
/* Push the result in the line. */
@@ -195,8 +225,8 @@ ssize_t ngetdelim(char **lineptr, size_t *n, int delim, FILE *stream)
/* Make room for the null character. */
if (indx >= *n) {
*lineptr = charealloc(*lineptr, *n + 128);
*n += 128;
*lineptr = charealloc(*lineptr, *n + MAX_BUF_SIZE);
*n += MAX_BUF_SIZE;
}
/* Null terminate the buffer. */
@@ -229,16 +259,16 @@ const char *strstrwrapper(const char *haystack, const char *needle,
#ifdef HAVE_REGEX_H
if (ISSET(USE_REGEXP)) {
#ifndef NANO_SMALL
if (ISSET(REVERSE_SEARCH)) {
if (regexec(&search_regexp, haystack, 1, regmatches, 0) == 0
&& haystack + regmatches[0].rm_so <= start) {
if (ISSET(BACKWARDS_SEARCH)) {
if (regexec(&search_regexp, haystack, 1, regmatches,
0) == 0 && haystack + regmatches[0].rm_so <= start) {
const char *retval = haystack + regmatches[0].rm_so;
/* Search forward until there are no more matches. */
while (regexec(&search_regexp, retval + 1, 1, regmatches,
REG_NOTBOL) == 0 && retval + 1 +
regmatches[0].rm_so <= start)
retval += 1 + regmatches[0].rm_so;
while (regexec(&search_regexp, retval + 1, 1,
regmatches, REG_NOTBOL) == 0 &&
retval + regmatches[0].rm_so + 1 <= start)
retval += regmatches[0].rm_so + 1;
/* Finally, put the subexpression matches in global
* variable regmatches. The REG_NOTBOL flag doesn't
* matter now. */
@@ -260,7 +290,7 @@ const char *strstrwrapper(const char *haystack, const char *needle,
#if !defined(NANO_SMALL) || !defined(DISABLE_SPELLER)
if (ISSET(CASE_SENSITIVE)) {
#ifndef NANO_SMALL
if (ISSET(REVERSE_SEARCH))
if (ISSET(BACKWARDS_SEARCH))
return revstrstr(haystack, needle, start);
else
#endif
@@ -268,7 +298,7 @@ const char *strstrwrapper(const char *haystack, const char *needle,
}
#endif /* !DISABLE_SPELLER || !NANO_SMALL */
#ifndef NANO_SMALL
else if (ISSET(REVERSE_SEARCH))
else if (ISSET(BACKWARDS_SEARCH))
return mbrevstrcasestr(haystack, needle, start);
#endif
return mbstrcasestr(start, needle);
@@ -329,7 +359,8 @@ char *mallocstrncpy(char *dest, const char *src, size_t n)
* "dest = mallocstrcpy(dest, src);". */
char *mallocstrcpy(char *dest, const char *src)
{
return mallocstrncpy(dest, src, src == NULL ? 1 : strlen(src) + 1);
return mallocstrncpy(dest, src, (src == NULL) ? 1 :
strlen(src) + 1);
}
/* Free the malloc()ed string at dest and return the malloc()ed string
@@ -399,7 +430,7 @@ void mark_order(const filestruct **top, size_t *top_x, const filestruct
/* Calculate the number of lines and the number of characters between
* begin and end, and return them in lines and size, respectively. */
void get_totals(const filestruct *begin, const filestruct *end, int
void get_totals(const filestruct *begin, const filestruct *end, size_t
*lines, size_t *size)
{
const filestruct *f;

File diff suppressed because it is too large Load Diff