Commit Graph

589 Commits (532d73ccc71da3e12ffcec5a78ca93e969741eae)

Author SHA1 Message Date
Benno Schulenberg 532d73ccc7 Renaming a variable to better indicate booleanness.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5779 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-30 12:27:06 +00:00
Benno Schulenberg 4ddf194004 Always asking whether it's okay when the name of the file was changed.
This fixes Savannah bug #46894.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5753 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-20 14:34:46 +00:00
Benno Schulenberg 1ef62490dd Normalizing the punctuation in some prompts: no space before a question mark,
and a semicolon instead of a comma between phrases.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5750 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-20 10:57:14 +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 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 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 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 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 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 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 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 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 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
Benno Schulenberg 05334a2b3c Not recording files that have the default cursor position.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5615 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-07 12:49:42 +00:00
Benno Schulenberg 22a01cad9e Rewrapping some lines and removing some useless comments.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5614 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-06 12:12:08 +00:00
Benno Schulenberg 6829241433 Removing the --nofollow option that hasn't been working for a dozen years.
With this option, nano would simply refuse to write to any symlinked file;
if anyone really used this option, they would certainly have complained.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5608 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-06 10:59:31 +00:00
Benno Schulenberg ba987350a9 Being more specific in how a given path is invalid.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5602 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-31 13:06:06 +00:00
Benno Schulenberg f96f4fe616 Updating position history only when 'positionlog' is set.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5601 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-29 20:43:54 +00:00
Benno Schulenberg 68ab4b848b Plugging another memory leak.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5600 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-29 20:39:12 +00:00
Benno Schulenberg 41f08534d9 Plugging a couple of memory leaks.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5598 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-29 16:58:02 +00:00
Benno Schulenberg d8801ec10e Also displaying the buffer when configured with only --disable-histories.
This fixes a segfault reported in Savannah bug #47011.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5596 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-29 16:01:43 +00:00
Benno Schulenberg 7256b055b1 Not adding directories to the list of file positions.
This fixes Savannah bug #46971.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5592 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-26 09:06:31 +00:00
Benno Schulenberg ae42240c33 Handling an update of the first element correctly.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5589 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-25 20:26:01 +00:00
Benno Schulenberg 8c705b5dc2 Moving an updated position-history item to the end of the list,
so that it won't be dropped any time soon.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5582 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-24 14:49:42 +00:00
Benno Schulenberg cd1d435ac7 Renaming a variable for clarity and contrast.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5581 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-22 16:56:04 +00:00
Benno Schulenberg fe3d849a75 Getting rid of a global variable.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5574 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-20 15:56:40 +00:00
Benno Schulenberg a91a1c7bbd Readjusting the indentation and a comment.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5573 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-20 15:33:41 +00:00
Benno Schulenberg 8bd76d8302 Verifying that the containing directory of the given filename exists.
Original patch by Rishabh Dave, edited by Benno.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5572 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-20 15:14:52 +00:00
Benno Schulenberg f8f2d63107 Limiting the number of loaded items in the positions history.
(So that most likely not more than two hundred plus a handful
will be written out.  This was the easiest to implement.)

See https://lists.gnu.org/archive/html/nano-devel/2016-01/msg00050.html.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5571 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-17 17:04:28 +00:00
Benno Schulenberg 38acacb461 Moving set_modified() to the file that has to do with files.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5566 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-15 14:42:07 +00:00
Benno Schulenberg caa759be31 Returning a fantastic file descriptor -- when opening
a non-existent file for reading succeeds.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5565 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-15 14:23:50 +00:00
Benno Schulenberg 0ee7729666 Freeing the full filename in all cases.
There's a bunch of return cases where we don't free the new full filename
which leads to leaks when writing out new files.  One way to reproduce:
$ rm -f foo
$ nano foo
<hit enter>
<ctrl+o to save>
<ctrl+x to exit>
-> memory leak

Patch by Mike Frysinger.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5563 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-15 13:17:44 +00:00
Benno Schulenberg 34fbb1f4de Adjusting a few comments and rewrapping some lines.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5556 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-13 20:32:40 +00:00
Benno Schulenberg ecf3cd7244 Reducing the number of indentation steps elsewhere too.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5555 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-13 20:08:36 +00:00
Benno Schulenberg 96b9249f91 Reducing the number of indentation steps.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5554 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-12 20:26:59 +00:00
Benno Schulenberg 774c8ba1bf Condensing the preparsing of a line.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5553 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-12 20:17:05 +00:00
Benno Schulenberg 73ee7d7ee5 Removing a senseless iteration: simply add the new record at the tail.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5552 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-12 20:08:31 +00:00
Benno Schulenberg deb271d708 Differentiating a variable name from function names.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5551 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-12 19:20:40 +00:00
Benno Schulenberg cb832bef1b Removing some code duplication.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5550 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-12 19:07:01 +00:00
Benno Schulenberg 583b67bad2 Rename a variable, to match the save routine.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5549 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-12 11:16:39 +00:00
Benno Schulenberg 46db638435 Chopping a duplicate parameter.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5519 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-12-31 19:20:40 +00:00
Benno Schulenberg 1592ca0585 Chopping an always FALSE parameter.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5518 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-12-31 17:20:46 +00:00
Benno Schulenberg 37d8ad8687 Not trying to position the cursor when opening a buffer failed.
This fixes Savannah bug #46778.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5514 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-12-30 10:11:20 +00:00
Benno Schulenberg 480b6a320f Going back to the filename prompt when the user decides to save a
changed buffer after all, as the buffer may not have a name yet.
This fixes Savannah bug #46752.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5512 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-12-23 19:18:33 +00:00
Benno Schulenberg 31e1af646c Not opening an extra blank buffer when an empty file is read.
This bug was exposed by r5498 on December 18.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5511 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-12-23 16:44:39 +00:00
Benno Schulenberg 8cc6308f9c Offering ^Q in the writeout menu to close and discard the current buffer
without saving it.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5509 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-12-23 16:34:44 +00:00