Commit Graph

5347 Commits

Author SHA1 Message Date
Benno Schulenberg 3df1a3f0f4 Not bothering to discard a duplicate syntax -- selecting simply the
last-defined one.  This addresses Savannah bug #47303.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5704 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-01 11:06:00 +00:00
Benno Schulenberg 83975027e5 Not dereferencing symlinks, so that the syntax will be derived from the
name given on the command line, not from the name of the target file.
This fixes Savannah bug #47307.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5703 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-29 16:56:54 +00:00
Benno Schulenberg e39423b49d Fixing breakage of r5695 -- I confused nregcomp() with regcomp(). :(
Hhrr...  Names that don't seem to differ...


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5702 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-29 15:40:13 +00:00
Benno Schulenberg 04669b5635 Renaming a variable and reshuffling a few lines.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5701 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-29 12:17:53 +00:00
Benno Schulenberg 85e166b0f2 "Closing" an extended syntax again, to prevent sneakily extending
the last-defined syntax.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5700 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-29 12:04:22 +00:00
Benno Schulenberg 773fc447df Arranging some things more orderly.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5699 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-29 10:54:48 +00:00
Benno Schulenberg 717e697e0b Not allocating a struct for the "none" syntax -- it doesn't need any.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5698 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-29 10:29:52 +00:00
Benno Schulenberg a24aee417d Renaming a struct member.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5697 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-29 09:17:03 +00:00
Benno Schulenberg 275e9f0092 Disallowing the addition of further things to a syntax when
an rcfile ends or when an invalid syntax command is found.
This fixes Savannah bug #47207


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5696 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-28 20:38:14 +00:00
Benno Schulenberg 68d94a0c74 Rearranging a few things in my style.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5695 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-28 17:16:39 +00:00
Benno Schulenberg 07f71e6c1a Not dropping regexes that were gathered earlier.
This fixes Savannah bug #47285.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5694 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-28 16:36:23 +00:00
Benno Schulenberg c2148cc902 Renaming a variable and fusing an increment.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5693 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-28 15:47:37 +00:00
Benno Schulenberg 1fba31e7b5 Using the now correct parsing of header regexes also for parsing magic regexes.
This fixes Savannah bug #47292.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5692 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-28 15:16:27 +00:00
Benno Schulenberg 3e7591f534 Not continuing when something is wrong, but instead skipping the rest of
the line.  This fixes Savannah bug #47289.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5691 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-28 11:04:36 +00:00
Benno Schulenberg 07441adb14 Renaming another struct element, because it refers not just
to file extensions, but also to header lines and magic strings.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5690 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-26 20:19:13 +00:00
Benno Schulenberg 3522751c6b Renaming a struct element for aptness and contrast.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5689 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-26 20:09:29 +00:00
Benno Schulenberg 2134212fa9 Eliding the function nfreeregex(), now used just once.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5688 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-26 17:25:48 +00:00
Benno Schulenberg e74a4c26c0 Renaming a variable for conciseness.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5687 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-26 17:11:35 +00:00
Benno Schulenberg 4d53694a27 Factoring out a triple repetition into found_in_list().
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5686 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-26 16:37:23 +00:00
Benno Schulenberg c3b9d29502 Stripping things bare to see the sameness.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5685 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-26 16:18:18 +00:00
Benno Schulenberg 812f986f2e Looking for the default syntax only when all else failed --
foregoing a small, complicating optimization.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5684 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-26 16:08:21 +00:00
Benno Schulenberg a69460001e Back to SVN, and tweaking whitespace in NEWS and Changelog.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5683 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-26 09:20:59 +00:00
Benno Schulenberg 2146942248 Correcting the description of 'justifytrim', adding it to the Info document,
sorting it, and tweaking a wording.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5682 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-26 09:04:54 +00:00
Chris Allegretta 162d534ff6 GNU nano 2.5.3 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5680 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-25 21:46:09 +00:00
Chris Allegretta 9f98333dce Call kill_spaces_on_justify justifytrim, to match the rest of rcfile naming conventions.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5679 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-25 21:04:45 +00:00
Benno Schulenberg 486e828443 Eliding splice_opennode() by handling the two cases (the creation of
the first element, and the insertion of a new element) directly.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5678 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-25 18:58:17 +00:00
Benno Schulenberg 3b8989b0a9 Now putting things in the proper order: setting 'prev_dir' only when
we've actually succeeded in changing directory.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5677 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-25 14:08:47 +00:00
Benno Schulenberg 761fa7cd3a Plugging a memory leak by not copying a string twice.
This fixes Savannah bug #47206.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5676 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-25 13:52:54 +00:00
Chris Allegretta 16c037fdb0 Tweak KILL_TRAILING_SPACES. Still deciding on name...
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5675 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-24 04:46:44 +00:00
Benno Schulenberg 6fef9208da Tweaking the Changelog.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5674 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-23 12:49:08 +00:00
Benno Schulenberg f5eb316603 Rewrapping and reshuffling some lines.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5673 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-23 12:37:10 +00:00
Benno Schulenberg a9a32d6d89 Centering the cursor when the thing being undone or redone is currently
off the screen.

See https://lists.gnu.org/archive/html/nano-devel/2016-02/msg00104.html.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5672 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-23 12:18:10 +00:00
Benno Schulenberg 287f78a26b Not moving the cursor when copying a backwardly marked region.
This fixes Savannah bug #46980.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5671 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-23 12:07:58 +00:00
Benno Schulenberg 8a2dd978f8 Renaming a variable, for contrast and correctness.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5670 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-23 08:31:57 +00:00
Benno Schulenberg 6a002f5196 Using the correct column number also when messages are skipped.
And not minding when the column number is zero or negative.
This partially fixes Savannah bug #47131.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5669 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-22 19:49:45 +00:00
Benno Schulenberg 7dd1030b15 Showing the cursor in the edit window when linting.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5668 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-22 18:34:04 +00:00
Benno Schulenberg e085ebb872 Making the cursor visible again after a justification and after an
unrecognized escape sequence.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5667 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-22 17:15:28 +00:00
Benno Schulenberg 27e1e83e8c As the charmove() already copies the terminating null byte,
there is no need to put one in.  Just trim the allocation.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5666 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-22 16:51:39 +00:00
Chris Allegretta 0dec394303 Make that kill_spaces_on_justify, add hilighting.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5665 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-22 15:23:57 +00:00
Chris Allegretta 6a0ae5aaa2 2016-02-22 Chris Allegretta <chrisa@asty.org>
* Add ability to kill the trailing spaces when justifying
        code.  New nanorc option kill_spaces_on_wrap, we'll see
        whether this warrants a command line flahg or not.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5664 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-22 15:10:32 +00:00
Benno Schulenberg 3ed08c568f Eliding a variable -- there is no need to optimize for calls of strlen(),
as this is typing speed, no need to hurry.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5663 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-22 14:26:05 +00:00
Benno Schulenberg 7c0e433305 Not moving too many bytes -- that is: not moving them beyond the
allocated buffer.  This fixes Savannah bug #47219.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5662 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-22 13:17:53 +00:00
Benno Schulenberg c115166f5b Sorting the prev_word() and next_word() functions in the standard way:
the backward one first.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5661 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-22 12:49:08 +00:00
Benno Schulenberg 9d8c72951f The amount to scroll is never zero, so there is no need to check.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5660 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-22 09:55:59 +00:00
Benno Schulenberg 818a39cfb9 Condensing some code by factoring out a repetition.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5659 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-22 09:34:33 +00:00
Benno Schulenberg f4f9954556 Eliding the function free_openfilestruct() as it is used only once.
(Note that openfile cannot be NULL here.  And in case it is,
nano should crash because DEBUG is enabled.)


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5658 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-22 09:02:58 +00:00
Benno Schulenberg 814a4220a2 Removing four unneeded checks for NULL.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5657 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-21 20:54:04 +00:00
Benno Schulenberg 801b3ce675 Not requiring a third Tab to show the list of possible completions
when the first Tab added the part that all matches have in common.

So now two Tabs in a row will always show the list of possible
completions -- if there /are/ any completions.  Which means that
a second Tab will either: 1) do nothing, when the name is complete
and exists; 2) beep, when nothing in the current directory starts
with the current string; 3) show the list of matches.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5656 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-21 13:33:52 +00:00
Benno Schulenberg acf19bde22 Reducing an allocation to what is actually needed.
This undoes the papering-over of the just-fixed bug.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5655 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-20 16:35:09 +00:00
Benno Schulenberg 0f64fe0af2 Parsing a character in the correct buffer: in the first match
instead of in the given string.  This fixes Savannah bug #47199.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5654 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-20 12:30:07 +00:00