Commit Graph

242 Commits (fc693210d5044b0735bfed92433a7cfb979f5521)

Author SHA1 Message Date
David Lawrence Ramsey 1539837fe0 cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2061 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-05 15:03:12 +00:00
David Lawrence Ramsey f643fc2149 remove a bit of redundant code, and add a few more comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2059 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-04 17:42:41 +00:00
David Lawrence Ramsey f978f040bd when (un)partitioning, don't save or restore fileage or filebot if
they're the same as top or bot; also add a few comment fixes


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2058 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-04 16:45:48 +00:00
David Lawrence Ramsey 8cbd4cb67f avoid potential segfaults while unpartitioning a filestruct
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2057 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-04 15:31:43 +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 2e83a50e95 properly handle the case of a function key with no preceding control key
in the help browser


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2040 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-11-01 22:35:26 +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 59f5e04fa8 cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2033 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-29 15:48:40 +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 d4ca9f2acb cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2029 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-26 21:14:56 +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 410efe9a47 add Rocco Corsi's patch to fix a problem in do_int_spell_fix() where if
the cursor is in the middle of a file, the spell checker will sometimes
only correct the misspelled word instances that appear before the cursor
position and then stop


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2027 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-26 16:54:19 +00:00
David Lawrence Ramsey cfa4a9c4fe remove the global DOS/Mac format toggles, for consistency with other
file operations like Append/Prepend that are specific to the "Write
File" prompt, and change the Mac format toggle to Meta-M, since that no
longer conflicts with the mouse support toggle; update the documentation
accordingly


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2023 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-24 17:20:31 +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 bf1346f342 in main(), tweak the command line parsing routine so that multiple +LINE
flags are properly interpreted in multibuffer mode


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2014 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-22 20:25:56 +00:00
David Lawrence Ramsey d9fb3e6bde remove more unneeded casts, and add an indentation fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2010 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-21 22:49:51 +00:00
David Lawrence Ramsey 2eb745939e when saving or changing file positions, be sure not to ignore
placewewant; also move a misplaced changelog entry


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2006 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-21 16:25:44 +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 2cc2a57dea rearrange the mark-handling code in do_replace_loop() a bit, and add one
more miscellaneous fix


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1997 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-18 02:06:53 +00:00
David Lawrence Ramsey 381d483986 help text updates, and a few more miscellaneous fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1996 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-18 01:51:43 +00:00
David Lawrence Ramsey 439fbe3e93 in do_alt_speller(), call terminal_init() unconditionally after running
the alternate spell checker, so that the terminal state is properly
restored in all cases


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1994 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-16 04:56:34 +00:00
David Lawrence Ramsey 9cf7b28248 another minor cleanup
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1993 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-15 16:35:34 +00:00
David Lawrence Ramsey 4b7e3c3efa minor cleanups
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1992 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-15 16:25:56 +00:00
David Lawrence Ramsey 49d5c1bf1c minor fixes involving case insensitive searches and NANO_SMALL
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1984 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-11 13:55:33 +00:00
David Lawrence Ramsey b112fe627d fix backwards #ifdefs
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1980 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-09 17:15:46 +00:00
David Lawrence Ramsey d93ee682c0 in do_int_spell_fix(), move the REVERSE_SEARCH flag toggling into the
NANO_SMALL #ifdef, since the tiny version of nano doesn't support
reverse searching; also, turn the USE_REGEXP flag off during spell
checking in order to avoid a potential segfault


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1979 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-09 16:59:43 +00:00
David Lawrence Ramsey 28caf14863 remove the -D/--dos and -M/--mac command line options, as they aren't
much use with the new file format autodetection


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1973 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-10-07 20:54:52 +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 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 45f971d69b add missing func_key reference
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1944 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-09-27 01:10:48 +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 f3ca80e11d remove redundant include of limits.h from nano.c
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1940 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-09-23 21:52:58 +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 e6ef8b9bb9 revert the blocking of meta sequences in main(), as it doesn't solve the
problem of meta sequences' sometimes being interpreted as printable
characters when they shouldn't be


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1937 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-09-12 22:01:38 +00:00
David Lawrence Ramsey 807657b0fe document keeping meta sequences from getting through to do_char() in the
changelog, and update a related comment


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1936 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-09-12 21:40:04 +00:00
David Lawrence Ramsey f887298c6e don't let meta sequences get through to do_char()
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1935 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-09-12 21:30:36 +00:00
David Lawrence Ramsey db6015c7d7 make the help menu shortcut display more flexible, add more intuitive
aliases for moving to the beginning and end of a paragraph and
justifying the entire file, and make those aliases available in the main
shortcut list too, since Pico's practice of putting them in the search
menu is rather odd


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1934 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-09-11 21:41:13 +00:00
David Lawrence Ramsey fd73c462f4 for more compatibility with Pico, remove extra space after a character
in punct if that character is the same as the one before it


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1933 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-09-11 21:28:36 +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 50c7f2de2f have edit_refresh() call edit_update() with NONE when smooth scrolling
is on so that smooth scrolling applies everywhere instead of just to the
movement functions, fix a potential infinite loop when edit_update() is
called with NONE and current_y is greater than (editwinrows - 1), and
have do_para_begin() and do_para_end() maintain current_y as
do_justify() does (and as they did before)


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1917 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-27 17:02:05 +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 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 7e8dd19a72 more #ifdef tweaks
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1898 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-12 20:06:20 +00:00
David Lawrence Ramsey df13e3beef tweak some #ifdefs to avoid warnings when compiling with
--disable-wrapping, --disable-justify, or a combination of the two


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1897 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-12 19:48:21 +00:00
David Lawrence Ramsey 69a28122c1 make sure that the shortcut list properly displays "Close" when reading
in multiple files on the command line


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1895 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-12 04:34:00 +00:00
David Lawrence Ramsey 95e39e5f46 add missing error message simplifications from before
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1892 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-12 02:52:14 +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 049e4a5db3 per DB's patch, simplify the saving of emergency files in die(),
die_save_file(), and get_next_filename()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1889 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-10 23:05:59 +00:00
David Lawrence Ramsey 6b24856c2f add titlebar() calls before all open_file() calls and remove the
titlebar() call after them, so that the titlebar is displayed properly
for all file(s) loaded; also add missing int -> bool conversion


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1888 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-07 22:33:14 +00:00
David Lawrence Ramsey c7b6ac5afe cosmetic fixes for the getopt_(long)?() calls and the switch block
dealing with the command line options


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1887 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-07 22:00:02 +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 76f63ff58d per DB's patch, convert more of nano to use N_() when possible; also add
a few more minor cosmetic fixes of mine


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1883 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-05 15:45:09 +00:00
David Lawrence Ramsey 22fac783f5 per DB's patch, don't translate the option strings for -Z/--restricted;
also add a few more minor cosmetic fixes of mine


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1882 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-08-05 15:16:19 +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 b8c479a9e9 add DB's fix for a problem where quoted justify wouldn't work if
HAVE_REGEX_H wasn't set, and don't treat the return values of the string
comparison functions as boolean anymore


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1877 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-31 14:10:23 +00:00
David Lawrence Ramsey a6d26d04fd rcfile tweaks: prompt only once for all rcfile errors instead of once
for each separate error, make sure all the messages end in newlines,
etc.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1876 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-30 22:52:44 +00:00
David Lawrence Ramsey 9ef3adbc1d add a consistency fix for do_enter() and a few minor cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1874 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-30 17:30:17 +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 360093a652 add a few missing placewewant size_t conversions
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1871 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-28 20:53:55 +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 331e659e98 minor cosmetic fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1867 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-27 19:40:39 +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 ad1fd0d968 per Junichi Uekawa's patch in Debian's version of nano, call setlocale()
outside the ENABLE_NLS #ifdef, since UTF-8 support (specifically, the
wide character handling functions it needs) won't work properly if the
locale isn't set, whether NLS is enabled or not


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1865 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-27 15:46:58 +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 04419b9702 and reset tabsize and wrap_at to their default values if invalid rcfile
entries are specified for them


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1860 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-18 18:13:54 +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 aea4dabf59 per DB's patch, remove some unneeded reset_cursor() calls, move the one
in the main input loop to the top, and remove the apparently unneeded
wrefresh() call in the main input loop


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1855 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-13 17:09:24 +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 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 f7b5d930a9 if we're in restricted mode and the filename isn't blank, disable tab
completion at the "Write File" prompt, since we can't change the
filename in that case; also remove an unneeded trailing space


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1842 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-05 14:27:29 +00:00
David Lawrence Ramsey 309fbcbddf fix inaccurate comment
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1841 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-03 14:34:03 +00:00
David Lawrence Ramsey 4693864a78 fix bug in do_justify() in a better way: add on_next_line flag, used to
indicate when we've moved to the next line after justifying the current
line, and only run the respacing routine when it's true; this keeps the
respacing routine from erroneously being run more than once on the same
line


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1840 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-03 14:15:58 +00:00
David Lawrence Ramsey 01a6bf4f9a fix bug in do_justify(): if all the text from the next line has been
moved to the current line and the next line has been deleted, continue
the justification loop from there and skip the respacing routine in
order to avoid running it more than once on the same line (since it
assumes that we've moved to the next line, which isn't true in that
case)


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1839 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-03 05:23:19 +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 74912c6090 add missing cosmetic fix from before
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1835 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-07-01 19:41:09 +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 dbde9d7577 refactor the code to search for the beginning of a paragraph a bit to
fix some inaccuracies and eliminate the need for recursion; it now uses
almost the same logic as the code to search for the end of a paragraph,
which makes it somewhat easier to understand


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1823 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-06-27 00:54:08 +00:00
David Lawrence Ramsey 91bc83a97a call justify_format() just after backup_lines() instead of inside it, so
that full justification doesn't erroneously justify non-paragraph lines
in the file


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1815 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-06-25 01:52:10 +00:00
David Lawrence Ramsey 537a880856 minor cosmetic fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1814 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-06-24 22:39:24 +00:00
David Lawrence Ramsey 85529b37c6 make the former flag same_line_wrap use TRUE and FALSE, add missing part
of DB's do_wrap() tweaks (the initialization of new_line_wrap to 0), and
wrap a few overly long comments


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1813 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-06-22 15:38:47 +00:00
David Lawrence Ramsey 74af3a7419 clean up main() a bit
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1808 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-06-12 21:03:14 +00:00
David Lawrence Ramsey 2b6c3018b0 remove unneeded justify_format() call from do_justify() which caused
problems if the original paragraph was one line long and ended with a
tab or tabs; unjustification would restore the justify_format()ted line
instead of the original line


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1806 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-06-10 01:35:02 +00:00
David Lawrence Ramsey 452513750b per CHAO Wei-Lun's patch, add missing "[dir]" and missing _()'s to the
"-E [dir]/--backupdir=[dir]" strings in usage()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1805 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-06-09 08:36:46 +00:00
David Lawrence Ramsey a9a6ce09d6 justification fix: if the last line of a justified paragraph has a space
on the end of it, the space should be removed


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1804 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-06-05 22:09:56 +00:00
David Lawrence Ramsey 9a527f5a17 add DB's tweaks to do_wrap(), plus a few minor bits of mine (convert
some ints to size_t's and convert the int wrapping to use TRUE and FALSE
since it's used as a boolean)


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1793 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2004-05-31 14:58:59 +00:00