Commit Graph

5660 Commits (03586c60da68e0184e24bada3e71441135fe1733)

Author SHA1 Message Date
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
Benno Schulenberg e86dc0381c Avoiding a memory leak when tabbing on a string that doesn't occur in the
history.  This fixes Savannah bug #47124 reported by Mike Frysinger.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5653 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-20 12:16:43 +00:00
Benno Schulenberg 5fa5ccff43 Deleting a debugging leftover.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5652 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-18 20:10:02 +00:00
Benno Schulenberg 9703934479 Allowing the parameter of free_filestruct() to be NULL,
so we can delete four annoying pre-checks.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5651 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-18 19:58:18 +00:00
Benno Schulenberg 56cfab3df6 Fixing Savannah bug #47127 the proper way,
eliding two silly calls of edit_redraw().


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5650 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-18 16:31:02 +00:00
Benno Schulenberg 2163d961a1 Deleting two dead prototypes, adjusting two comments for correctness,
and two other minute tweaks.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5649 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-16 10:09:26 +00:00
Benno Schulenberg 16ba6df68c Deleting a redundant assignment. The multidata pointer is already
set to NULL in make_new_node(), a few lines earlier.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5648 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-16 09:06:21 +00:00
Benno Schulenberg 706f01422d Avoiding the loss a buffer when getcwd() fails.
This fixes Savannah bug #47129 reported by Mike Frysinger.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5647 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-15 16:24:39 +00:00
Benno Schulenberg 6c0e5e3f2c Freeing not just the struct but also the data it contains,
and also when it is the first and only line.
This fixes Savannah bug #47153 reported by Mike Frysinger.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5646 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-15 12:56:18 +00:00
Benno Schulenberg 8d005c8743 Saying that the 2.5 branch is a "rolling" release, that lock files are done,
and preparing for 2.5.3.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5645 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-14 12:17:17 +00:00
Benno Schulenberg e540053eb3 Renaming and condensing some stuff, and correcting the main comment,
because 'allow_cntrls == FALSE' meant that controls were being filtered.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5644 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-14 12:03:47 +00:00
Benno Schulenberg ef16a2a250 Doing the copying of typed stuff from input to output just once.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5643 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-14 11:16:54 +00:00
Benno Schulenberg 15947ac871 Restoring the mentioned behavior also for the internal spell fixer.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5642 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-14 10:29:48 +00:00
Benno Schulenberg f3a1d7ba06 Making the iteration through replacement matches behave the same again as the
iteration through search matches: showing them centered when found offscreen.
This fixes Savannah bug #47127.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5641 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-14 10:19:27 +00:00
Benno Schulenberg 568d2a389c Switching the cursor on and off at the appropriate moments (that is: when
needed), so that it no longer shows in the help screen nor in the file list.
This fixes Savannah bug #47126.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5640 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-13 19:41:12 +00:00
Benno Schulenberg ec3cd1eeae Allocating enough space for printing out the line and column numbers.
This fixes Savannah bug #47135.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5639 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-13 17:00:06 +00:00
Benno Schulenberg 813f9f72d0 Rebuilding the file list only when necessary, and not for each and every
cursor movement.  This fixes Savannah bug #47133.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5638 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-13 16:42:30 +00:00
Chris Allegretta 0db28259ad Back to SVN, and fix typo in NEWS
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5637 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-12 05:36:40 +00:00
Chris Allegretta 0f45b26cb9 GNU nano 2.5.2 release
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5635 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-12 05:25:29 +00:00
Benno Schulenberg 6f352038da Making the formatter command more visible in the Go syntax file.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5634 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-11 17:30:16 +00:00
Benno Schulenberg de5b2634c8 Condensing some declarations, rewrapping some lines, and improving a
few comments.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5633 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-11 17:25:37 +00:00
Benno Schulenberg e39938c1fa Not leaving curses mode in the formatter, as that would hide
error messages upon reentry.  And, if there are any messages,
allowing the user a little time to read them.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5632 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-11 16:57:52 +00:00
Benno Schulenberg d4118efea5 Going to the next item in the list before freeing the current one.
This fixes Savannah bug #46796.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5631 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-11 08:50:11 +00:00
Benno Schulenberg 6c82fd65ad Adding remark to Changelog that Savannah bug #47111 is fixed.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5630 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-11 08:26:08 +00:00
Benno Schulenberg 65efed5f97 Freeing the position-history records that are dropped.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5629 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-10 20:29:23 +00:00
Benno Schulenberg b8e0e22d64 Switching the cursor on in the right place: in the central input routine.
This makes the cursor visible again during linting.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5628 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-10 20:16:50 +00:00
Benno Schulenberg fddad2636d Removing two SVN Id tags and a duplication.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5627 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-10 16:40:08 +00:00
Benno Schulenberg 9646d7c87d Thanking a Spanish, a Catalan, and a Croat translator.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5626 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-10 16:26:51 +00:00
Benno Schulenberg 14d1b3bd36 Allowing only control sequences in the proper range to be rebound.
This fixes Savannah bug #47025.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5625 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-10 15:06:45 +00:00
Benno Schulenberg d83bd7e305 Plugging a sneaky memory leak. This fixes Savannah bug #47003
reported and solved by Mike Frysinger.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5624 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-10 12:32:43 +00:00
Benno Schulenberg ef2cfa31a7 Preventing a chain of editing actions from continuing after a discard.
This fixes Savannah bug #47104.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5623 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-10 08:49:23 +00:00
Benno Schulenberg 0dbc867a16 Adjusting the version number in the docs before release.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5622 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-09 20:57:37 +00:00
Benno Schulenberg cdeb90515b Checking the result of a stat() to avoid referencing unitialized data.
The original patch was by Kamil Dudka.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5621 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-09 20:53:11 +00:00
Benno Schulenberg e853c1ee7c Renaming a variable for clarity.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5620 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-07 13:41:46 +00:00
Benno Schulenberg e5fee7e649 Normalizing a bit of indentation.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5619 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-07 13:37:16 +00:00
Benno Schulenberg 836fa7066a Using a character class instead of a literal tab and space.
The change was inspired by David Niklas.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5618 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-07 13:14:23 +00:00
Benno Schulenberg 98a8c06394 Eliding an unneeded 'if'.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5617 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-07 13:08:27 +00:00
Benno Schulenberg 12f27299f1 Avoiding a pointless lstat() when not writing to a temporary file.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5616 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-07 13:03:48 +00:00