Commit Graph

264 Commits (ce0451348c775d5afb07e4b6e48d93c1693a9865)

Author SHA1 Message Date
David Lawrence Ramsey ce0451348c make do_prev_word() work with multibyte strings, and update various
comments in do_next_word() and do_prev_word()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2273 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-15 00:34:57 +00:00
David Lawrence Ramsey 31055b3ba8 add missing free()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2272 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-14 22:08:18 +00:00
David Lawrence Ramsey 7801d7bed9 revert previously added extra calls to move_mbright(); it's more
efficient to just add the return value of parse_char() directly instead
of having move_mbright() return it (except in the cursor movement
functions, which should be kept simple)


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2271 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-14 21:59:01 +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 52e5f23184 more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2268 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-14 21:26:38 +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 775d46daf9 comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2247 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-11 23:08:36 +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 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 12054fe11b add a cosmetic fix and a fix for a potential compilation problem exposed
by -pedantic


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2241 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-07 22:37:01 +00:00
David Lawrence Ramsey 28e19f8bbc fix potential memory corruption in do_output() when adding UTF-8
characters, found by valgrind


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2233 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-05 15:42:45 +00:00
David Lawrence Ramsey b6fbdd00cf tweak the charealloc() in do_output() to more closely match the old
charealloc() in do_char(), to avoid another memory corruption problem


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2229 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-04 04:02:45 +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 b8a2a6d7e5 in do_input() and do_statusbar_input(), func_key is an int* and not an
int; fix bad code due to the latter assumption


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2214 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-01-02 21:13:36 +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 4d97a588e6 cosmetic totsize-related cleanups
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2206 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-12-29 16:42:48 +00:00
David Lawrence Ramsey c8ade44741 set totsize properly when deleting a character or backspacing over it
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2205 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-12-28 22:36:13 +00:00
David Lawrence Ramsey a35bdd1f03 add a few missing NANO_WIDE #ifdefs, and remove display_string_len()
until I can fix it to no longer cause memory corruption


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2201 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-12-27 18:53:38 +00:00
David Lawrence Ramsey 4fd76bab73 configure.ac and related cleanups
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2200 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-12-24 18:11:53 +00:00
David Lawrence Ramsey 9ec76e5573 remove command line and rcfile option for --noutf8, as UTF-8 support is
now autodetected, and add #ifdefs around two variables that are unused
when NANO_WIDE isn't defined


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2194 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-12-23 19:55:57 +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 415b5d91cf fix misplaced #ifdef
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2191 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-12-21 16:39:45 +00:00
David Lawrence Ramsey f3bea022d6 revert erroneous change
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2189 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-12-20 01:18:49 +00:00
David Lawrence Ramsey 6a2f068c7f still more cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2188 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-12-20 01:13:55 +00:00
David Lawrence Ramsey e750fe68cf another cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2187 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-12-18 22:43:23 +00:00
David Lawrence Ramsey 4564170c61 cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2186 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-12-18 20:29:42 +00:00
David Lawrence Ramsey 78ea5e4a8a improvements to wide/multibyte character input and output, using wide
curses functions where applicable


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2182 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-12-12 19:04:56 +00:00
David Lawrence Ramsey c2ac02ff46 add missing casts
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2180 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-12-09 03:05:45 +00:00
David Lawrence Ramsey abc9423709 check for nulls and newlines earlier in do_output(), and add a few more
cosmetic fixes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2179 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-12-08 23:24:31 +00:00
David Lawrence Ramsey 60448895f6 reset the mbtowc() and wctomb() state machines at the right places
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2178 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-12-08 16:52:52 +00:00
David Lawrence Ramsey eae97caa83 go back to storing multibyte characters in non-dynamically allocated
arrays of MB_LEN_MAX length, as it's less complex


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2175 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-12-07 22:24:03 +00:00
David Lawrence Ramsey 43953bba6f store multibyte characters in dynamically allocated arrays of MB_CUR_MAX
length, and add a few comment fixes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2174 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-12-07 21:23:39 +00:00
David Lawrence Ramsey bed32a370b comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2172 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-12-07 18:05:38 +00:00
David Lawrence Ramsey 10820de467 fix bad cast
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2168 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-12-07 05:02:21 +00:00
David Lawrence Ramsey 95a0224820 miscellaneous fixes for the buffered inout and output routines and their
associated UTF-8 handling: have unget_input() filter out invalid wide
characters, put back the result of a word sequence instead of returning
it directly, don't erroneously filter out keystrokes if they're neither
extended keypad values nor ASCII characters, and add a few comment
tweaks


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2166 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-12-06 04:14:42 +00:00
David Lawrence Ramsey 846658eb6b when we get the whitespace display toggle, update the titlebar as well
as the edit window, in case the filename displayed on the titlebar
contains spaces or tabs; also add a few miscellaneous cosmetic fixes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2160 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-12-05 04:18:26 +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 68ebb61fb1 fix potential segfault when doing a full justify
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2156 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-12-04 17:36:14 +00:00
David Lawrence Ramsey fc54d6e431 per Jeremy Huddleston's patch, fix compilation problem caused by
break_line()'s returning int when it should return ssize_t according to
its prototype


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2155 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-12-02 17:37:09 +00:00
David Lawrence Ramsey 3ece0b9aeb change references to "open files" to "open file buffers" for
consistency, and add DB's changes to die() so that it works properly
with the overhauled multibuffer routines


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2153 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-12-01 15:11:27 +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 63e73cbd14 comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2151 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-28 04:52:57 +00:00
David Lawrence Ramsey 53d3db4ba6 comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2150 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-28 03:53:01 +00:00
David Lawrence Ramsey 40a6c8cb64 more formatting fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2147 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-27 21:10:11 +00:00
David Lawrence Ramsey 62a217d35d formatting and cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2144 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-27 16:54:00 +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 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 329d6a3259 formatting fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2133 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-24 23:46:04 +00:00