Commit Graph

67 Commits (e15abc9c1e72fedc91347a3f14aaa658acc457d6)

Author SHA1 Message Date
Benno Schulenberg 5bd359dbb9 Normalizing whitespace around '==' comparison.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4776 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-15 15:02:43 +00:00
Benno Schulenberg 8f6151198a Whitespace adjustments, plus a few comment tweaks.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4769 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-14 09:57:06 +00:00
Benno Schulenberg 598c654294 Adjusting some comments, and removing an unneeded 'if'.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4752 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-08 13:58:04 +00:00
Benno Schulenberg 00389928d4 Converting #ifdef ENABLE_COLOR to #ifndef DISABLE_COLOR.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4719 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-04 11:59:03 +00:00
Benno Schulenberg 61bba1de8e Tweaking some comments.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4718 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-04-04 09:01:21 +00:00
Benno Schulenberg e4c34c3386 Adding, fixing, and removing some #endif comments.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4649 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-03-17 14:15:57 +00:00
Benno Schulenberg bc5c7c3b74 Not writing to stderr on magic errors, patch mostly by Mike Frysinger.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4629 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-03-01 10:20:57 +00:00
Chris Allegretta fda622c0cd 2011-03-04 Chris Allegretta <chrisa@asty.org>
* color.c (color_update): Add check for whether the file even exists
	  before we try to run the magic check on it.  Fixes error messages to stderr
	  when reading in files that don't exist, reported by Mike Frysinger.




git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4540 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2011-03-05 05:01:13 +00:00
Chris Allegretta bccf2fa1c9 2011-03-03 Chris Allegretta <chrisa@asty.org>
* color.c (color_update): Remove unneeded debugging message from
          libmagic commit.  Fixed extra messages going to stderr reported by Mike Frysinger.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4539 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2011-03-03 16:23:27 +00:00
Chris Allegretta 154136a7cb 2011-02-22 Chris Allegretta <chrisa@asty.org>
* color.c (nfreeregex): Fix that we were trying to set the pointer passed by value
          to NULL.  Fixes crashes on file save reported by Ken Tyler and Matthieu Lejeune.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4532 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2011-02-23 03:09:23 +00:00
Chris Allegretta b00d0b9c8c 2011-02-12 Chris Allegretta <chrisa@asty.org>
* Initial libmagic implementation, adapted from Eitan Adler <eitanadlerlist@gmail.com>.
          New nanorc entry "magic" to enable this functionality, nanorc file and man page updates.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4528 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2011-02-13 04:23:10 +00:00
Chris Allegretta 8a07a96eef 2009-12-01 David Lawrence Ramsey <pooka109@gmail.com>
* Update documentation for 2.2 features including sample nanorc file, texinfo
          file, man pages, UPGRADE file, and update copyright noticed for the current year.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4453 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-12-02 03:36:22 +00:00
Chris Allegretta b71cf301da 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.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4379 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-02-16 23:06:09 +00:00
Chris Allegretta 9555e1d118 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.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4378 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-02-16 21:04:00 +00:00
Chris Allegretta 35686daf9d * 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.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4373 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-02-08 18:00:44 +00:00
Chris Allegretta 56a295bc90 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.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4367 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-02-07 14:48:30 +00:00
Chris Allegretta fd265af15a 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().



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4364 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-02-06 03:41:02 +00:00
Chris Allegretta 364763f4d1 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.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4362 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-02-03 05:05:58 +00:00
Chris Allegretta 25d459aa64 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. 



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4356 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-01-30 08:34:27 +00:00
Chris Allegretta d47d8cd450 * First pass at some caching of caching color info. Right now it's only for
multi-line regexes but this may not be enough to increase performance.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4351 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2009-01-25 07:25:17 +00:00
Chris Allegretta f30c1390c7 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>



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4328 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-09-21 23:02:30 +00:00
Chris Allegretta 6b83e5290c 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.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4315 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2008-08-30 05:16:20 +00:00
David Lawrence Ramsey d8a1d37161 update copyright notices, as Chris Allegretta's copyrights have now been
assigned to the Free Software Foundation; also, make copyright notices
consistent in style


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4173 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-10-11 05:01:32 +00:00
David Lawrence Ramsey c9694b7636 update copyright notices, as my copyrights have now been assigned to the
Free Software Foundation


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4172 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-10-05 16:44:45 +00:00
David Lawrence Ramsey d0035b4ab2 convert to GPLv3 or later
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4147 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-08-11 05:17:36 +00:00
David Lawrence Ramsey 6335fb54d5 miscellaneous comment fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4012 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2007-01-01 05:15:32 +00:00
David Lawrence Ramsey 8269ae3cea more cosmetic copyright notice fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3953 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-11-10 03:40:41 +00:00
David Lawrence Ramsey f9f8cc36e4 fix inaccurate comment
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3824 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-07-29 21:40:32 +00:00
David Lawrence Ramsey 5cadadd4c2 in color_update(), fix incorrect setting of defcolor, which prevented
the reserved "default" syntax from being handled correctly


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3592 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-05-28 18:51:48 +00:00
David Lawrence Ramsey cb475886b1 clarify another comment
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3255 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2006-01-02 17:09:35 +00:00
David Lawrence Ramsey 034b994eb5 since proto.h includes nano.h, and nano.h includes config.h first,
include proto.h first and remove redundant includes of config.h in all
non-header source files


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3236 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-12-08 02:47:10 +00:00
David Lawrence Ramsey 315eb3280a adjust copyright notices in all source files to account for Chris'
reassigning the 2005-2006 copyright on nano to me


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3215 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-28 19:35:29 +00:00
David Lawrence Ramsey 45d344b72c comment fix
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3193 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-16 08:14:16 +00:00
David Lawrence Ramsey 3f7c8c5158 fix copyright years on source files; all functions in browser.c were
originally added in 2001; the oldest function in color.c is
do_colorinit() (now color_init()), which was originally added in 2001;
the oldest function in chars.c is revstrstr(), which was originally
added in 2001; the oldest function in help.c is do_help(), which was
originally added in 2000; the oldest function in prompt.c is statusq()
(now do_prompt()), which was originally added before 0.6.6, which was
apparently in 1999; all functions in rcfile.c were originally added in
2001; one of the oldest functions in search.c is do_search(), which was
originally added in 0.2.7, which was apparently in 1999; and one of the
oldest functions in text.c is do_wrap(), which was originally added in
0.3.1, which was apparently in 1999; also, for functions originally
adapted from other sources, add notices from the original files, as we
do with the tab completion functions adapted from busybox


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3172 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-11-14 22:20:35 +00:00
David Lawrence Ramsey e796a7b5b9 formatting fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2964 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-08-01 05:54:11 +00:00
David Lawrence Ramsey d152ad378b port over Brand Huntsman's reserved "none" syntax to counteract his
"default" syntax when necessary (the latter *is* actually ported mostly
from his patch with a few tweaks; the "default-syntax" option is
apparently something else entirely)


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2961 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-08-01 04:59:34 +00:00
David Lawrence Ramsey 5a584ccda3 treat color syntax names case sensitively, for consistency with how
their filename regexes are treated


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2960 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-08-01 04:34:27 +00:00
David Lawrence Ramsey 179b1bad87 more color updates: add a "default" syntax that takes no extensions for
those files that don't match any other syntax's extensions (ported from
Brand Huntsman's old patch, but modified to work with a syntax named
"default" instead of requiring a "default-syntax" keyword, and to fit
into the existing color architecture)


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2959 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-08-01 04:23:29 +00:00
David Lawrence Ramsey 6135bf3f6b port over more of Brand Huntsman's old patch: a color syntax specified
on the command line will now override the syntax associated with the
current file extension


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2951 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-30 21:24:56 +00:00
David Lawrence Ramsey ab73dd4816 fix extension decompilation breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2950 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-29 22:08:56 +00:00
David Lawrence Ramsey 5295cfe72c add missing bit from last patch
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2949 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-29 21:59:44 +00:00
David Lawrence Ramsey 2385c1aa9b port over more of Brand Huntsman's old patch (with a few tweaks):
compile the file extension regexes on an as-needed basis too


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2948 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-29 21:42:08 +00:00
David Lawrence Ramsey d4e3c59f27 remove unnecessary can_change_colors() call
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2945 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-27 03:12:22 +00:00
David Lawrence Ramsey 691698a954 move advanced text operations (command execution in a buffer, wrapping,
spell checking, justifying, and word counting) to their own source file,
text.c


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2919 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-24 19:57:51 +00:00
David Lawrence Ramsey e99494f21a add miscellaneous color and openfilestruct cleanups, and move the
openfilestruct functions to nano.c, since they're no longer specific to
file operations


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2903 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-20 21:08:38 +00:00
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 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 cb8d845ad7 still more miscellaneous color fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2869 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-15 01:08:52 +00:00
David Lawrence Ramsey 538dc352c5 a few more miscellaneous color fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2868 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-15 00:36:49 +00:00
David Lawrence Ramsey 8f948fa1eb handle unspecified foreground colors
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2866 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2005-07-15 00:17:13 +00:00