Commit Graph

404 Commits (13dde2bda42728bde1d12be340305abe681199ef)

Author SHA1 Message Date
David Lawrence Ramsey 5b44f373fd really fix color breakage by decoupling edit_update() and
edit_refresh(); edit_update() is only called without edit_refresh() in
do_gotolinecolumn() if allow_update is FALSE, and in edit_refresh()
itself if edittop is out of range of current


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2875 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-16 22:47:12 +00:00
David Lawrence Ramsey 8f4762a842 cosmetic and #ifdef fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2874 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-16 22:35:11 +00:00
David Lawrence Ramsey 8f1afee813 fix color breakage; also, in main(), when opening files with
"+LINE,COLUMN" arguments on the command line, don't update the screen
when moving to their specified lines and columns


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2873 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-16 07:06:36 +00:00
David Lawrence Ramsey 43cf7a1be3 prototype fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2857 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-14 18:31:45 +00:00
David Lawrence Ramsey db95802a18 add breakage fixes, type fixes, and as-needed color regex compilation
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2854 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-13 20:18:46 +00:00
David Lawrence Ramsey e5c7e928c9 still more breakage fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2852 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-12 23:06:22 +00:00
David Lawrence Ramsey 222b201afe miscellaneous minor fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2851 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-12 20:09:24 +00:00
David Lawrence Ramsey 5128de8308 fix marking breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2850 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-12 17:40:16 +00:00
David Lawrence Ramsey b386a905e6 use blank_line() instead of hblank/mvwhline(), and fix more breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2844 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-10 02:37:38 +00:00
David Lawrence Ramsey 1d696c0047 work around slang brokenness
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2841 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-09 05:24:33 +00:00
David Lawrence Ramsey 56001845cd yet more breakage fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2839 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-09 04:42:47 +00:00
David Lawrence Ramsey dbcaa3b1fb fix some breakage caused by the restructuring
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2836 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-08 20:59:24 +00:00
David Lawrence Ramsey 6ad59cd29b restructure things so that every file has its own openfilestruct, and so
that the values in it are used directly instead of being periodically
synced up with the globals; accordingly, remove the globals; this
changes pretty much every function


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2835 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-08 20:09:16 +00:00
David Lawrence Ramsey 64661ac140 rename filebuffer to openfile. as it's shorter
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2834 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-08 19:57:25 +00:00
David Lawrence Ramsey 503f278547 rename variable open_files filebuffer, for consistency
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2831 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-08 02:51:58 +00:00
David Lawrence Ramsey 90573296ea reorder some functions for consistency
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2830 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-08 02:47:05 +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 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 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 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 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 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 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 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 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 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 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 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 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
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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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
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 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 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 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 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 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 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 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 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 b80d49f071 make sure that all references to cut-to-end are left out when NANO_SMALL
is defined


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2435 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-03-26 22:49:46 +00:00
David Lawrence Ramsey 39e8ce6f8e in printopt(), add DB's tweaks to make sure longflag isn't passed in
when HAVE_GETOPT_LONG isn't defined, and rework the special case of
options that are ignored for Pico compatibility so that they display
more neatly when HAVE_GETOPT_LONG isn't defined; in usage(), fix an
erroneous #ifdef that resulted in the -d/--rebinddelete and -k/--cut
options' not being printed when NANO_SMALL was defined


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2410 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-03-21 07:24:47 +00:00
David Lawrence Ramsey afbcf68c1a more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2409 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-03-21 06:33:41 +00:00
David Lawrence Ramsey 40e211bcec add full multibyte character support to do_wrap()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2394 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-03-19 21:15:30 +00:00
David Lawrence Ramsey 9bd56204ee add multibyte character support to help_line_len(), so that UTF-8 help
text is wrapped properly


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2393 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-03-18 21:29:33 +00:00
David Lawrence Ramsey 85616c499b add missing blank line, and rename total_blank() to total_update(), as
the latter is more accurate


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2387 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-03-17 18:11:08 +00:00
David Lawrence Ramsey b9ddb80123 allow refreshing of the help browser window, as Pico does, and remove a
few stray spaces from the main help text


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2386 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-03-17 17:56:48 +00:00
David Lawrence Ramsey efec641a82 control characters can only be properly filtered out in both non-UTF-8
and UTF-8 mode inside the output routines, so do it there instead of
inside the input routines


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2382 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-03-17 03:52:08 +00:00
David Lawrence Ramsey 77abec7ecf fix misplaced #endif
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2381 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-03-16 17:00:27 +00:00
David Lawrence Ramsey 496488c5d2 when getting printable input from the edit window or statusbar prompt,
don't swallow non-ASCII control characters, since they're parts of UTF-8
sequences


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2378 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-03-16 15:34:22 +00:00
David Lawrence Ramsey 631242dd96 a few last minor fixes to do_credits()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2374 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-03-15 07:06:54 +00:00
David Lawrence Ramsey 0099a8f45c fix potential memory corruption problem in make_mbstring(), and also fix
compilation with -pedantic


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2372 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-03-15 06:34:09 +00:00
David Lawrence Ramsey 38156d4491 make the rest of the justify code support multibyte characters
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2371 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-03-15 05:44:03 +00:00
David Lawrence Ramsey 7d7e7d58ad fix erroneous #ifdef
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2367 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-03-14 18:54:33 +00:00
David Lawrence Ramsey f0195a8839 make sure all rcfile arguments are valid multibyte strings
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2366 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-03-14 18:47:21 +00:00
David Lawrence Ramsey ff4a487efa overhaul the paragraph-searching code to make it simpler too
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2360 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-03-13 21:12:25 +00:00
David Lawrence Ramsey e9ac1d7930 overhaul the justify code to make it leave the right number of spaces at
the ends of the lines of a paragraph, and also to make it simpler


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2354 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-03-13 03:28:37 +00:00
David Lawrence Ramsey e0fb4d5641 improve the handling of whitespace display mode in multibyte locales:
use new function make_mbstring() instead of display_string() to make
sure the multibyte string is valid and interpreted properly


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2348 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-03-11 04:03:32 +00:00
David Lawrence Ramsey 6e60db6989 make whitespace display mode work with multibyte characters
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2346 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-03-10 22:52:21 +00:00
David Lawrence Ramsey 202d3c2f97 add DB's overhaul of the rcfile parsing code and related miscellaneous
bits


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2345 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-03-10 20:55:11 +00:00
David Lawrence Ramsey ad96aff50d rework things so that strrchrn() is no longer needed, and remove it
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2325 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-02-22 23:22:37 +00:00
David Lawrence Ramsey 7d367710ae add DB's overhaul of the file browser code to increase efficiency and
add multibyte character support, plus a few tweaks of mine


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2320 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-02-14 05:00:15 +00:00
David Lawrence Ramsey e1c16b3744 add multibyte character support to is_whole_word(), plus a comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2318 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-02-12 23:09:27 +00:00
David Lawrence Ramsey 1b9d3f9898 port over DB's overhaul of safe_tempnam() and his changes to
check_operating_dir() to make it use boolean values (plus a few more
boolean-related tweaks of mine); also stop wrapping the bad_chr
parameter of parse_mbchar() in #ifdefs for cleanliness, as the
allow_tabcomp parameter of check_operating_dir() isn't wrapped in
#ifdefs, and don't set bad_chr to TRUE when we get a null byte in a
multibyte string, as it's not an invalid multibyte character


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2316 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-02-11 20:09:11 +00:00
David Lawrence Ramsey 0b80f936bf add missing #ifdef
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2310 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-02-08 20:39:28 +00:00
David Lawrence Ramsey 65e6ecb1d4 add DB's pverhaul the tab completion code and a few related functions to
increase efficiency and support multibyte characters; also add a few
miscellaneous tweaks of mine


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2309 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-02-08 20:37:53 +00:00
David Lawrence Ramsey 23c44504ad miscellaneous bits: change flags to an unsigned long and totsize to a
size_t, store the number of multibyte characters instead of the number
of single-byte characters in totsize, and add a few formatting fixes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2302 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-27 20:49:07 +00:00
David Lawrence Ramsey 3f9c63589e turn string functions that don't take length arguments into wrappers for
the versions that take length arguments, add multibyte equivalent of
strlen(), and fix potential segfault in mbstrnlen()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2300 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-25 19:21:11 +00:00
David Lawrence Ramsey 345260c624 add multibyte version of revstrcasestr()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2296 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-24 01:14:17 +00:00
David Lawrence Ramsey 3ee4cf3027 cosmetic and formatting fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2295 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-22 20:49:14 +00:00
David Lawrence Ramsey 42abfe057e add multibyte equivalent of strcasestr(), plus some miscellaneous
cleanups


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2293 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-22 18:24:16 +00:00
David Lawrence Ramsey 5040666fbb add DB's (slightly tweaked) changes to make resizing more flexible, and
also add his replacement of RETSIGTYPE with void, which avoids some
potential problems


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2289 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-19 19:52:42 +00:00
David Lawrence Ramsey b80077dae3 add support for moving to the next or previous word at the statusbar
prompt


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2288 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-18 21:25:38 +00:00
David Lawrence Ramsey 21954765ca reorganization: move revstrstr() back to chars.c, and move is_byte()
there too, since they both deal with strings and hence characters


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2286 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-18 17:00:00 +00:00
David Lawrence Ramsey 637b8bb36c add -O/--morespace command line option, plus a corresponding Meta-O
toggle and a "morespace" rcfile option; when these are used, the
normally-unused blank line below the titlebar will be treated as part of
the edit window


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2281 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-17 05:06:55 +00:00
David Lawrence Ramsey 3a1fc8f0ab start making multibyte equivalents of the string functions in utils.c
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2277 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-16 18:49:19 +00:00
David Lawrence Ramsey 63d8f2b42f remove duplicate prototype
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2275 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-16 17:01:51 +00:00
David Lawrence Ramsey d24fbb760d rename move_left() and move_right() to move_mbleft() and move_mbright(),
and move them to chars.c


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2270 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-14 21:50:32 +00:00
David Lawrence Ramsey 1fe2eebf74 add multibyte and wide equivalents of isalnum(), make do_next_word()
work with multibyte strings, and tweak the "smart home" routines to use
move_right() for consistency


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2269 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-14 21:33:47 +00:00
David Lawrence Ramsey 9b95ca8c29 minor fixes involving is_byte()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2262 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-14 06:02:10 +00:00
David Lawrence Ramsey 5508cc5b0a move nstrnlen() to chars.c, and add a multibyte equivalent of strnlen()
to it


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2259 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-14 04:22:14 +00:00
David Lawrence Ramsey 610929c6ed the is_xxx_char() functions should take unsigned ints for consistency
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2254 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-12 18:46:08 +00:00
David Lawrence Ramsey b54155c4a4 massive updates to multibyte/wide character support; deal with multibyte
characters and strings instead of wide characters and strings as much as
possible, and move multibyte/wide character-specific functions into
their own source file, chars.c


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2248 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-12 03:25:57 +00:00
David Lawrence Ramsey cac0293bce miscellaneous high-level input routine fixes: in do_statusbar_input(),
indicate when we run a normal shortcut's associated function with the
ran_func parameter, reset the statusbar cursor position when we do, and
don't call print_view_warning() when we try to run a function not
allowed in view mode; also apply the first of these changes to
do_input() so that both the edit window and statusbar routines are in
sync again


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2246 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-11 23:05:05 +00:00
David Lawrence Ramsey 577298a3f9 remove display_string_len() again for the time being, since it's still
prone to off-by-one errors that lead to memory corruption and I can't
find anything obviously wrong with it; always allocate enough space for
len columns of text now; any extra space that isn't used will be removed
by the null_at() call at the end of display_string() anyway


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2245 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-08 07:21:41 +00:00
David Lawrence Ramsey 35e9713543 remove erroneous #ifdef around a currshortcut reference, do another int
-> bool conversion, and change a value of 0 for func to NULL in all
sc_init_one() calls


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2243 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-08 06:04:19 +00:00
David Lawrence Ramsey d96851f534 miscellaneous cleanups for the multibyte parsing functions
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2242 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-07 22:39:43 +00:00
David Lawrence Ramsey f0a53f02a1 readd get_byte_kbinput(), modify get_word_kbinput() to handle
hexadecimal instead of decimal values, make normal input use
get_byte_kbinput(), make verbatim input use get_word_kbinput(), and
update faq.html to mention these changes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2221 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-03 19:56:56 +00:00
David Lawrence Ramsey 423326fc71 another int -> bool conversion
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2220 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-03 19:14:39 +00:00
David Lawrence Ramsey d9ad76ba3c properly handle newlines read in via verbatim input at the statusbar
prompt


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2216 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-02 22:35:31 +00:00
David Lawrence Ramsey 11c83d3ed3 implement verbatim input for the statusbar prompt
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2215 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-02 21:26:53 +00:00
David Lawrence Ramsey 295d172f2d implement cutting from the current position to the end of the file,
using Ctrl-X from the search prompt and Meta-T from the edit window;
also update the copyright years of more modified files


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2211 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-01 07:43:32 +00:00
David Lawrence Ramsey c13b7f0699 overhaul the high-level input routines for the statusbar to make them
more flexible, among other things, and add UTF-8 support to them in the
process; also update the copyright years of the modified files


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2210 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-01 07:28:15 +00:00
David Lawrence Ramsey 3e81914b82 miscellaneous bits: fix the full justify segfault in a way that doesn't
break some normal full justifies, do a few more int -> bool conversions,
and fix a comment


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2209 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-12-31 04:10:28 +00:00
David Lawrence Ramsey fc693210d5 more steps toward UTF-8 support: port all the parts of DB's UTF-8 patch
that I currently understand to current CVS, with modifications of mine
to autodetect UTF-8 support and to display multibyte strings instead of
wide strings


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2193 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-12-23 17:43:27 +00:00
David Lawrence Ramsey 7483571f7f massive overhaul to support buffered input and output, the first steps
toward proper wide character input and output, etc.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2157 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-12-04 17:41:52 +00:00
David Lawrence Ramsey 1483ee3db1 remove malfunctioning wide character support, and add a few
miscellaneous fixes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2152 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-29 00:30:07 +00:00
David Lawrence Ramsey c82997d460 in get_verbatim_kbinput(), don't pass v_kbinput in as a parameter, since
we're dynamically allocating it and then returning it


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2141 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-27 15:00:18 +00:00
David Lawrence Ramsey 698263ca5c in the low-level input routines, make the ascii_digits variables ints
instead of size_t's, since they will only hold very small values


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2136 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-25 05:05:41 +00:00
David Lawrence Ramsey 5b3dd0f423 add DB's overhaul of the multibuffer code for efficiency, plus a few
tweaks and additions of mine


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2134 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-25 04:39:07 +00:00
David Lawrence Ramsey d994ad5284 in get_edit_input(), readd parameter allow_funcs, as it's now needed as
a workaround for when unjustified text is stored in the justify buffer
and either the justify or the full justify shortcut is hit


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2128 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-23 21:40:26 +00:00
David Lawrence Ramsey 93c8405bfa overhaul the cutting and uncutting routines and the justify-related
routines to back up and restore unjustified text to use the partitioning
code, as it greatly simplifies how they work; also back up and restore
unjustified text in its own buffer instead of the cutbuffer, and add a
few minor bug fixes to the overhauled routines


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2124 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-23 04:08:28 +00:00
David Lawrence Ramsey 74d87073f0 unpartition_filestruct() should take a partition** instead of a
partition*, so that the partition it refers to is properly set to NULL


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2117 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-22 00:16:23 +00:00
David Lawrence Ramsey 8001e27e67 yet more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2093 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-12 00:48:18 +00:00
David Lawrence Ramsey 1f1ebb85b7 in handle_sigwinch(), call shortcut_init(FALSE) defore redisplaying the
main list, so that "UnJustify" isn't erroneously displayed when we
justify, suspend, and then continue; also add a few last cosmetic fixes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2090 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-11 21:50:01 +00:00
David Lawrence Ramsey 50af6ea21e in proto.h, add missing NANO_SMALL #ifdef around the
cut_marked_segment() prototype


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2079 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-07 15:29:40 +00:00
David Lawrence Ramsey 8c16bacbbf more int -> bool conversions
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2074 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-06 15:10:57 +00:00
David Lawrence Ramsey 90e59c1a18 when doing marked spell-check, properly handle the case where the mark
ends in the middle of a word and that word is spell-checked; also move
the logic to detect an upside-down mark to mark_order() instead of using
the same logic in three different places, and rename a few variables for
consistency


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2070 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-05 23:03:03 +00:00
David Lawrence Ramsey b73c0c0b09 if we're not inserting a file into a new buffer, partition the current
buffer so that it's effectively a new buffer just before inserting the
file, and only restore placewewant afterwards; this is the same behavior
we would get if we opened the file, added all of it to the cutbuffer,
uncut at the current cursor position, and closed the file


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2062 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-05 15:25:53 +00:00
David Lawrence Ramsey 84d0d59cbb remove most redundant includes of sys/stat.h; it's included in nano.h,
so it doesn't need to be included in files that include nano.h


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2053 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-04 03:53:11 +00:00
David Lawrence Ramsey 40bdb686aa add code to partition a filestruct between a set of arbitrary
coordinates; given the coordinates of the beginning and end of the mark,
this allows proper and easier handling of saving marked selections,
replacing text only in marked selections, and spell-checking marked
selections using either the internal or alternate spell checker; do all
these using a global partition structure


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2050 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-03 22:03:41 +00:00
David Lawrence Ramsey 182b2c936f in do_replace_loop(), make real_current_x a const filestruct* again
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2048 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-03 16:02:41 +00:00
David Lawrence Ramsey 4a1fc558cf add new function mallocstrncpy()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2045 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-02 15:18:30 +00:00
David Lawrence Ramsey e5e88fd9f2 fix problem found by Rocco: make search_last_line static to search.c
instead of local to findnextstr() so that search wrapping detection
works properly again


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2037 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-31 13:20:30 +00:00
David Lawrence Ramsey 687776b1a8 make mark_beginx a size_t instead of an int
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2035 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-30 01:16:08 +00:00
David Lawrence Ramsey 7a97e18667 make current_x a size_t instead of an int
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2034 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-30 01:03:15 +00:00
David Lawrence Ramsey 77b284af68 revert the marked replace code; it's hackish, and there appears to be no
easy way to make it work with the internal spell checker as is; it
should eventually be reimplemented to work at the findnextstr() level


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2031 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-27 02:21:01 +00:00
David Lawrence Ramsey 9bf486fe5d in do_replace_loop(), add new parameter canceled, set to TRUE if we
canceled at the prompt and FALSE otherwise; use it to make sure that
canceling works properly in all cases when using the internal spell
checker


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2028 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-26 20:58:30 +00:00
David Lawrence Ramsey c59979f067 add UTF-8 support to unget_kbinput(), and fix a minor memory leak in the
UTF-8 support code in get_kbinput()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2015 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-23 02:47:39 +00:00
David Lawrence Ramsey 9819ed031b fix infinite loop when we're doing a replace of marked text and the only
matches found are outside the marked text


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2004 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-21 15:32:11 +00:00
David Lawrence Ramsey 27fbc69ec4 yet more search code cleanups
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2003 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-19 21:09:37 +00:00
David Lawrence Ramsey 53752e8f9a fix findnextstr() so wholewords works properly with regular expressions
and in conjunction with no_sameline, and add a few other minor cosmetic
fixes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2002 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-18 22:19:22 +00:00
David Lawrence Ramsey 4e8e495301 add support for reading in UTF-8 sequences to some of the low-level
input functions


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1989 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-14 21:59:45 +00:00
David Lawrence Ramsey 5780b24759 make get_escape_seq_kbinput()'s escape_seq parameter a const int*, since
it's never modified


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1987 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-14 20:48:38 +00:00
David Lawrence Ramsey e53181d423 remove resetstatuspos prototype left over from when it was global
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1986 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-14 20:36:47 +00:00
David Lawrence Ramsey 3497666a21 in do_replace_loop(), if the mark is on when we start, skip over all
matches not found inside the marked text; this makes marked spell
checking when using the internal spell checker work as expected, and
also allows replacing only marked text when the mark is on


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1978 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-09 16:26:32 +00:00
David Lawrence Ramsey 045883aa34 really fix the resetstatus problems this time, and add a few other
miscellaneous fixes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1969 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-05 20:11:31 +00:00
David Lawrence Ramsey 4dd723a095 make resetstatuspos static to just statusq()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1966 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-05 02:29:52 +00:00
David Lawrence Ramsey d532f197b0 add parameter use_answer to search_init(); when it's TRUE, only set
backupstring to answer, so that we can preserve the text of the
statusbar when switching to the search prompt from the "Go To Line"
prompt; also, set backupstring before doing anything else, add one minor
efficiency tweak, and preserve the text of the statusbar no matter what
when switching from the search prompt to the "Go To Line" prompt, since
the toggling works both ways now and non-numeric text shouldn't be lost
when going only one of those ways


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1965 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-04 22:37:56 +00:00
David Lawrence Ramsey 951d7148d1 add minor cosmetic fixes, and do another int -> bool conversion
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1961 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-04 15:23:47 +00:00
David Lawrence Ramsey 3e189a8b9c in open_(prev|next)_file(), translate the "New Buffer" string when
displaying "Switched to" messages on the statusbar; also do a few more
int -> bool conversions


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1959 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-03 19:18:48 +00:00
David Lawrence Ramsey be908f6992 for consistency, make do_insertfile() take a parameter to indicate
whether it's in "Execute Command" mode; also add continue and goto to
the "c-file" regexes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1955 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-01 18:34:30 +00:00
David Lawrence Ramsey e5d8f32834 add a bunch of key-related fixes: put Meta-( (Meta-9), Meta-) (Meta-0),
and Meta-J back in the shortcut list since Meta-G is used in the file
browser and not as a toggle, tweak nanogetstr() and statusq() so that
resetstatuspos can be reduced to a static bool, change the names of some
keys to be more consistent, and add the ^R^X^X and ^W^T^T shortcuts
(note that the latter doesn't preserve the contents of the statusbar yet
when ^T is pressed at the "Go To Line" prompt), and add a few other
miscellaneous tweaks


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1954 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-09-30 22:07:21 +00:00
David Lawrence Ramsey 9b6e476a46 resetstatuspos should be a bool, not an int
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1947 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-09-28 15:58:56 +00:00
David Lawrence Ramsey eb16f43cf9 add a func_key flag to the low-level input functions and the currently
existing high-level input functions, to indicate extended keypad values


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1943 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-09-27 01:04:50 +00:00
David Lawrence Ramsey 013344c4c5 turn off extended input processing (the IEXTEN termios flag) as nano
1.2.x does


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1939 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-09-22 22:45:08 +00:00
David Lawrence Ramsey d08348b99c make some ints that use the value of fill and can be greater than COLS
ssize_t's for consistency, and add a few minor cosmetic fixes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1938 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-09-18 22:02:21 +00:00
David Lawrence Ramsey 02517e0a0f add DB's overhaul of the file loading code to increase efficiency,
remove ugly workarounds for most cases of edittop's or current's being
NULL (as those cases no longer occur due to the overhaul), and remove
detection of binary files (since it wasn't always accurate and will only
cause problems when UTF-8 support is added); also add a few minor fixes
of mine


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1928 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-09-05 21:40:31 +00:00
David Lawrence Ramsey 6da969e44b work around the need to put back the first non-escape character when
reading an escape sequence


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1920 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-28 15:51:07 +00:00
David Lawrence Ramsey c510042bcd do more int ->bool conversions, change the order of the parameters in
findnextstr(), and make findnextstr() maintain the value of current_y
too


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1918 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-27 20:28:34 +00:00
David Lawrence Ramsey 20b83508f4 simplify edit_update() so as not to require the fileptr parameter
anymore, since it's set to current in all calls


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1915 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-26 18:07:58 +00:00
David Lawrence Ramsey d1322107a5 do another int -> bool conversion, and simplify the search/replace
"Cancelled" messages


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1914 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-26 04:22:54 +00:00
David Lawrence Ramsey dfca1c4ea6 add unget_kbinput(), a wrapper for ungetch()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1911 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-25 16:37:06 +00:00
David Lawrence Ramsey a0b5ba2f7f convert ints to bools in the low-level input routines, and consolidate
the high-level input routines for the edit window


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1910 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-25 15:39:10 +00:00
David Lawrence Ramsey a88347069c add missing #ifdefs
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1905 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-17 20:34:57 +00:00
David Lawrence Ramsey a27bd65057 per DB's patch, overhaul the rcfile and history file reading and writing
routines to fix a few fundamental problems and limitations; also add
getline() and getdelim() equivalents adapted from GNU mailutils 0.5 (and
tweaked to better integrate with nano), since the patch uses getline()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1900 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-17 05:23:38 +00:00
David Lawrence Ramsey bb50b305d5 a few more #ifdef tweaks, plus a few cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1899 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-12 21:43:00 +00:00
David Lawrence Ramsey 76356bd05b and do int -> bool conversions for the prototypes too
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1894 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-12 04:30:22 +00:00
David Lawrence Ramsey 6420d445c2 add a bunch of DB's miscellaneous fixes, plus a few of mine
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1890 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-11 05:13:08 +00:00
David Lawrence Ramsey 00d7798756 per DB's patch, convert a few parts of files.c to use bool so that
open_pipe()'s failure is handled properly again, and add various
#ifdefs to fix a few warnings and compilation problems that occur when
everything is enabled manually including NANO_SMALL


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1886 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-07 21:27:37 +00:00
David Lawrence Ramsey ce62e82a93 per DB's patch, convert nano.c to use bools wherever needed, add a few
efficiency tweaks, and fix a few minor bugs in help_init() where "Up"
and "Space" might not be displayed properly and the help browser
wouldn't work if fewer than 24 columns were available


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1885 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-05 22:10:22 +00:00
David Lawrence Ramsey c53ab2a854 tweak parse_num() to return a bool, and fix backwards test of its value
so that numeric values will be preserved when switching to the "Go To
Line" prompt again


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1881 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-04 18:24:53 +00:00
David Lawrence Ramsey 4d44d2de0e make lastwastab and list use TRUE and FALSE instead of 1 and 0, make
them bools in the process, and make a few other minor cosmetic cleanups


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1880 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-01 22:35:31 +00:00
David Lawrence Ramsey 906257932f add my display tweak to do_replace(), my efficiency tweaks to
do_gotoline(), and DB's efficiency tweaks to do_gotopos()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1875 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-30 20:21:34 +00:00
David Lawrence Ramsey 819c7f0327 add DB's overhaul of the paragraph searching code and some of the
justify code, as it makes some code much more understandable and fixes a
bug where searching for the previous paragraph would move the cursor too
high in one case


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1873 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-30 03:54:34 +00:00
David Lawrence Ramsey 86e851b4e7 per DB's patch, convert placewewant to a size_t; also add a few
miscellaneous fixes of mine


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1870 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-28 20:46:25 +00:00
David Lawrence Ramsey 8aaf03000b move the main terminal initialization functions, aside from initscr(),
into a new terminal_init() function, and convert nano to use it; also,
when reloading the newly spell-checked temporary file in
do_alt_speller(), call terminal_init() to make sure that all the
original terminal settings are restored, as a curses-based alternative
spell checker (e.g. aspell) can change them


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1866 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-27 16:46:35 +00:00
David Lawrence Ramsey 8037fe076b a few miscellaneous Pico compatibility tweaks and bugfixes (most
importantly, a fix for a segfault when trying to full-justify a file
with no paragraphs)


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1862 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-23 12:30:40 +00:00
David Lawrence Ramsey fd3039a8e7 cut down on redundant inclusions of <sys/types.h>, include it in proto.h
per DB's patch, and make a few more minor cosmetic cleanups


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1857 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-17 19:49:12 +00:00
David Lawrence Ramsey 49c3f2406d port over DB's number parsing code and related bits, with a few minor
changes of mine, and add a few related variable type changes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1853 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-12 16:07:14 +00:00
David Lawrence Ramsey 576bf331ef various changes to cut down on binary size: per DB's patch, add new N_()
macro to mark strings that aren't translated immediately and convert
nano to use it where needed, overhaul the shortcut list and toggle list
initialization code for efficiency, and replace rcfile_msg() with
rcfile_error(); also add a few minor miscellaneous cleanups by DB and
myself


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1852 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-12 03:10:30 +00:00
David Lawrence Ramsey d717d4bac6 add another missing part of DB's patch (read_file() should be returning
void instead of int), and rearrange one NANO_SMALL #ifdef for better
readability


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1851 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-10 16:53:17 +00:00
David Lawrence Ramsey f708037715 add another prototype fix and a few spacing fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1849 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-08 17:15:10 +00:00
David Lawrence Ramsey a5dda84a07 per DB's patch, remove unused global variable search_offscreen
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1848 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-08 15:27:04 +00:00
David Lawrence Ramsey 2ad320926f add another missing part of DB's patch to convert flags and related
variables into longs: toggle_init_one() should take a long instead of an
int for its flag parameter


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1845 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-07 14:36:44 +00:00
David Lawrence Ramsey edab0cc0a5 a few cleanups and consistency fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1837 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-03 03:09:12 +00:00
David Lawrence Ramsey 72e51ab037 per DB's patch (with a few updates of mine), convert the shortcut list
functions and most related functions to return void instead of int, as
the return values of all those functions are essentially unused; also
add a few related miscellaneous cleanups


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1836 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-02 14:31:03 +00:00
David Lawrence Ramsey ebd0d7c859 more minor cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1834 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-01 18:59:52 +00:00
David Lawrence Ramsey e65e639465 properly handle it when get_escape_seq_kbinput() returns ERR for an
escape sequence that is recognized but which should be ignored


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1801 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-06-04 18:18:17 +00:00
David Lawrence Ramsey c21790d6d9 edit_redraw() fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1788 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-05-30 03:19:52 +00:00
David Lawrence Ramsey 89bb93733a a few last cosmetic reorderings and fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1784 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-05-29 16:47:52 +00:00