Commit Graph

173 Commits (38156d4491cd2134874e6cdc8eed10e4bb584a35)

Author SHA1 Message Date
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