2009-09-02 Chris Allegretta <chrisa@asty.org>
* Attempt to check file writability and emit a warning on the status bar
if nano doesn't think the file can be written to. Feature originally
requested by Damien Jolders <madamien@skullsquad.com> et al.
Chris Allegretta [Sun, 30 Aug 2009 03:50:16 +0000 (03:50 +0000)]
2009-08-29 Chris Allegretta <chrisa@asty.org>
* Fix more soft wrapping issues, particularly with soft scrolling,
discovered by Hannes <mr_creosote@mutantwatch.de>.
Chris Allegretta [Wed, 19 Aug 2009 05:38:07 +0000 (05:38 +0000)]
2009-08-19 Chris Allegretta <chrisa@asty.org>
* Fix issue with soft wrapping not displaying the last character of each line,
fixed bug discovered by Hannes <mr_creosote@mutantwatch.de>.
Chris Allegretta [Mon, 17 Aug 2009 07:52:10 +0000 (07:52 +0000)]
2009-08-17 Chris Allegretta <chrisa@asty.org>
* Initial soft line wrapping implementation. Command line flags
-$ or --softwrap.
* nano.c, text.c: Clean up some fprintf warnings in debug mode due to printing
a size_t without using the zd specifier.
Chris Allegretta [Fri, 14 Aug 2009 03:18:29 +0000 (03:18 +0000)]
2009-08-13 Chris Allegretta <chrisa@asty.org>
* New global flag implementation courtesy of Adam Wysocki <gophi@arcabit.pl>, allows
previous undo flag to be implemented consistent with other flags.
Chris Allegretta [Mon, 27 Jul 2009 04:16:44 +0000 (04:16 +0000)]
2009-07-27 Chris Allegretta <chrisa@asty.org>
* text.c (undo_cut, redo_cut): Don't actually try and undo/redo an empty cut, i.e. the magicline.
Fixes crash on cutting last line discovered by Eitan Adler <eitanadlerlist@gmail.com>.
Chris Allegretta [Sun, 12 Jul 2009 03:36:58 +0000 (03:36 +0000)]
2009-07-11 Chris Allegretta <chrisa@asty.org>
* nano-regress: Small tweaks
* Change undo code to off unless unabled via a command line option (-u/--undo). Until this code
stabilizes this is the only responsible way to treat it.
Chris Allegretta [Thu, 26 Mar 2009 01:01:48 +0000 (01:01 +0000)]
First pass at fixing the line splitting undo since it's currently broken beyond belief.
I believe more is broken but committing will motivate me to get closer to a real fix :)
2009-03-08 Chris Allegretta <chrisa@asty.org>
* TODO - Break out some targets for various features into 2.2
and 2.4 series for things which are feasible.
2009-02-28 Chris Allegretta <chrisa@asty.org>
* configure.ac: Add check for whether _XOPEN_SOURCE_EXTENDED is needed for
curses to work w/color. Fixes compilation on HP-UX with older GCC,
reported by jay.krell@cornell.edu.
Chris Allegretta [Wed, 25 Feb 2009 04:32:15 +0000 (04:32 +0000)]
2009-02-23 Chris Allegretta <chrisa@asty.org>
* rcfile.c (parse_keybinding) - Define a var before tryung to use it. Whoops!
* fix some redefinitions causing compiler warnings, from Eitan Adler. Other
(hopefully) fixes for uncasted malloc()s, reported by the same.
Chris Allegretta [Mon, 16 Feb 2009 23:06:09 +0000 (23:06 +0000)]
Okay that will not work. Revert forcing reset_multis on !viewok as it's too expensive
for things like deleting text. Will have to go back and force inside functions.
Add check in reset_multis for CNONE type since that's slowing us down and is dumb
to leave out.
Chris Allegretta [Mon, 16 Feb 2009 21:04:00 +0000 (21:04 +0000)]
2009-02-16 Chris Allegretta <chrisa@asty.org>
* Add new argument to reset_multis for force redraws without attempting to
guess whether we need to, force updates when running a non-viewok function.
New utility function color.c:reset_multis_for_id(). Fixes e.g. incorrect
highlighting when cutting text.
Chris Allegretta [Sun, 15 Feb 2009 19:16:18 +0000 (19:16 +0000)]
2009-02-15 Chris Allegretta <chrisa@asty.org>
* configure.ac, doc/man/Makefile.am - Add check for HTML output support in GNU
groff. Fixes Savannah bug #24461: build traps on groff. Also, add installation
of html-ized man pages to $datadir/nano/man-html, since we should probably
install files we went to all the trouble of generating.
Chris Allegretta [Sun, 15 Feb 2009 02:40:16 +0000 (02:40 +0000)]
2009-02-14 Chris Allegretta <chrisa@asty.org>
* nano.c (precalc_multicolorinfo) - Add debugging so we have a better clue if further
issues arise. Also start at the beginning of later lines when trying to match the
end of a multi-line regex. Fixes more overly aggressive highlighting found by
Mike Frysinger. Finally, advance to the match end for performance.
Chris Allegretta [Wed, 11 Feb 2009 05:45:57 +0000 (05:45 +0000)]
2009-02-11 Chris Allegretta <chrisa@asty.org>
* nanorc.c (parse_include): Do call real_dir_from_tilde() on included
files in .nanorc, but still avoiding bug #25297. Fixes ~ and ~user
specifications for nanorc include files, as reported by Eitan Adler.
2009-02-09 Chris Allegretta <chrisa@asty.org>
* New option -q, --quiet, rcfile option "quiet" implemented. Skips printing
errors about the rcfile and asking user to press enter. Also, nano should
now only ask for one enter press when there is an error when not using -q.
Based on discussion between Eitan Adler and Mike Frysinger.
* rcfile.c (parse_keybinding) - Significant cleanups and fixes for
detecting and reporting errors in key bindings code.
* Make reset_multidata reset more lines, since contrary to previous problems the
syntax highlting is now too *un*ambitious, causing display glitches when
deleting a regex boundary.
2009-02-08 Chris Allegretta <chrisa@asty.org>
* Add more multidata initliazers for new buffers and 'magic lines'. Fixes segfaults
with syntax highlighting in new buffers, initially reported by Mike Frysinger.
Renumber multidataflags to not start at 0 in case it confuses alloc_multidata_if_needed().
Add alloc_multidata_if_needed() call in edit_draw as the last defense against a crash.
2009-02-06 Chris Allegretta <chrisa@asty.org>
* rcfile.c (parse_include): Abort on being unable to open an included rcfile. Fixes
Savannah bug 25490, nanorc: "include"ing a file which doesn't exist causes nano to segfault.
2009-02-05 Chris Allegretta <chrisa@asty.org>
* More color syntax speedups: Determine in reset_multis() whether we really need to call
edit_refresh(). Additional global var edit_refresh_needed() to hopefully reduce
repeated calls to the function. New helper funcs reset_multis_before() and
reset_multis_after().
2009-02-02 Chris Allegretta <chrisa@asty.org>
* New color precalculation code for mult-line regexes. New function precalc_multicolorinfo(),
new structure multidata for keeping track of where regexes start/stop. More
performance improvements forthcoming.
Chris Allegretta [Sat, 31 Jan 2009 23:36:00 +0000 (23:36 +0000)]
2009-01-29 Chris Allegretta <chrisa@asty.org>
* nano.c (move_to_filestruct) - properky initialize new fileage for multiswatching, sigh.
Fix cut sefaults discovered by Mike Frysinger.
Chris Allegretta [Fri, 30 Jan 2009 08:34:27 +0000 (08:34 +0000)]
2009-01-29 Chris Allegretta <chrisa@asty.org>
* nano.c (main): Add support for nano acting like a pager when invoked with - as first
file argument. Not yet perfect (garbles screen state on exit) but it's something.
Chris Allegretta [Mon, 26 Jan 2009 08:48:22 +0000 (08:48 +0000)]
2009-01-25 Chris Allegretta <chrisa@asty.org>
* files.c (open_file), nanorc.c (parse_include): Don't get_full_path on
included rc files, due to it potentially impacting the ability
to read files in nano's cwd(). Fixes Savnanah bug #25297 reported by Mike
Frysinger)
Chris Allegretta [Sat, 24 Jan 2009 22:40:41 +0000 (22:40 +0000)]
2009-01-24 Chris Allegretta <chrisa@asty.org>
* Add interruptability to search functions. New functions enable_nodelay and
disable_nodelay and changes to the routines to handle checking for pending
searches. Fixes Savnnah bug 24946: Need interrrupt for search.
Chris Allegretta [Mon, 19 Jan 2009 19:10:39 +0000 (19:10 +0000)]
2009-01-19 Chris Allegretta <chrisa@asty.org>
* Change funcion definitions to shorts instead of (void *)s. New mapping function
iso_me_harder_funcmap(). Fixes compilation complaints with -pedantic,
reported by Eitan Adler <eitanadlerlist@gmail.com>.
Chris Allegretta [Tue, 21 Oct 2008 10:20:07 +0000 (10:20 +0000)]
2008-10-20 Chris Allegretta <chrisa@asty.org>
* files.c (do_writeout): Add check for file modification when saving
the file so the user can at least know they may be blowing away changes.
Chris Allegretta [Tue, 14 Oct 2008 16:46:58 +0000 (16:46 +0000)]
2008-10-14 Chris Allegretta <chrisa@asty.org>
* nanorc.5: Fix redo man page entry and update explanation, reported by
Eitan Adler <eitanadlerlist@gmail.com>
Chris Allegretta [Tue, 14 Oct 2008 04:34:56 +0000 (04:34 +0000)]
Eliminate linescut variable from undo structure as its an unneeded pain in the ass.
Also initialize to_end, because for some reason it seems to be not getting set even when
type == CUT in add_undo (?!)
Chris Allegretta [Tue, 14 Oct 2008 01:14:12 +0000 (01:14 +0000)]
2008-10-13 Chris Allegretta <chrisa@asty.org>
* Remove CUTTOEND as an undo type as it's unneeded, fix u->to_end logic in undo struct.
* undo.c (update_undo): Don't free cutbuffer if NULL, fix for Savannah bug #24499
2008-10-04 Chris Allegretta <chrisa@asty.org>
* cut.c (Add_undo): Save last cut undo information so it can be used for next uncut, fixes
Savannah bug 24183.
Chris Allegretta [Sun, 21 Sep 2008 23:02:30 +0000 (23:02 +0000)]
2008-09-21 Chris Allegretta <chrisa@asty.org>
* rcfile.c, color.c, nano.h: Add new capability for matching a syntax type by the "header" (1st line)
of a file being edited. Based on Savannah bug 24197 and inital proof of concept by Dave Geering
<dgeering@toshiba-tap.com>
Chris Allegretta [Tue, 16 Sep 2008 21:35:19 +0000 (21:35 +0000)]
2008-09-16 Chris Allegretta <chrisa@asty.org>
* text.c: Add support for undoing a text uncut. Split out the undo and redo of a text cut
in order to avoid code duplication.
Chris Allegretta [Sat, 30 Aug 2008 21:00:00 +0000 (21:00 +0000)]
* global.c, help.c, browser.c, files.c, proto.h: Fix several compipation and programmatic
issues with --disable-help, especially that do-writeout was treating ^G the same as ^M.
Chris Allegretta [Sat, 30 Aug 2008 05:16:20 +0000 (05:16 +0000)]
2008-08-29 Chris Allegretta <chrisa@asty.org>
* configure.ac, color.c, rcfile.c, utils.c: 1st attempt at supporting systems which don't support
GNU-style word boundaries. New function fixbounds() to translate from GNU-style to
BSD-style, autoconf option GNU_WORDBOUNDS.
Chris Allegretta [Thu, 28 Aug 2008 06:13:05 +0000 (06:13 +0000)]
2008-08-28 Chris Allegretta <chrisa@asty.org>
* configure.ac, rcfile.c: Add support for an alternate rcfilename at configure time. Maybe this
should become a command line option some day, but I don't see the need currently. Start of
fix for Savannah bug #24128: Add nanorc support to win32 platform.
Chris Allegretta [Thu, 21 Aug 2008 04:21:06 +0000 (04:21 +0000)]
2008-08-21 Chris Allegretta <chrisa@asty.org>
* text.c: Change error messages where we may possibly get into a bad state and urge
the user to save when this happens. Originally by Benno Schulenberg <bensberg@justemail.net>
Chris Allegretta [Sun, 17 Aug 2008 16:25:40 +0000 (16:25 +0000)]
2008-08-08 Magnus Granberg <zorry@ume.nu> / Adam Conrad <?>
* files.c: (write_file): Add needed flags to open() calls when writing out files. Fixes Savannah bug
#23827: Compilation fails with -D_FORTIFY_SOURCE=2
Chris Allegretta [Sat, 16 Aug 2008 23:54:15 +0000 (23:54 +0000)]
* files.c (write_file): Check exit code of fclose(), since in certain out of space conditions the OS will
happily report successful fwrite()s until you try and close the file. Fix for Savannah bug
#24000: no free space on partition - nano claims successful write - file empty
* text.c: Reset openfile-> to OTHER after an undo or redo so we don't mistakenly
mistakenly think this is an update when it's really an add. Also
Fix an extra ; after an if statement which makes nano try to free a struct which
may be NULL
- Change add_undo and current_undo to only take action arg, as openfilestruct arg is always openfile
- Add ability to undo a file/cmd insert, needed to add undoable flag to read_file and open_buffer as a result