Commit Graph

8790 Commits (845a5973c946d44dc963368e1e2913f391e41966)

Author SHA1 Message Date
Benno Schulenberg 845a5973c9 counting: count words and characters without partitioning the file 2020-04-05 17:29:54 +02:00
Benno Schulenberg 6e5195f650 tweaks: invert a condition, to have two clauses in a more logical order
First the clause for the intro text and the normal lines, and then the
clause for the continuation lines (that are narrower and indented).

Also, avoid blanking the status bar when initializing the subwindows
anyway, and avoid an unneeded resfreshing call -- the bottombars()
function will take care of that.
2020-04-03 17:19:15 +02:00
Benno Schulenberg f3624b1b87 build: fix compilation when configured with --enable-tiny 2020-04-03 17:12:28 +02:00
Benno Schulenberg 1a2c9044d7 display: blank the status bar for a copy operation, like for cut & paste
This way an earlier "Copied nothing" or other message cannot confuse
the user.
2020-04-03 16:34:27 +02:00
Benno Schulenberg 9a67d7958f undo: choose the proper x positions to place the cursor and rejoin lines
Normally, when undoing an <Enter> that created automatic indentation,
the created whitespace should be skipped when rejoining the two lines.
In other words: take the data starting from tail_x in the second line.
But when the <Enter> occurred at the end of leading whitespace, then
that whitespace has disappeared from the original line and it should
be copied back in from the second line.  That is: from x is zero.

This fixes https://savannah.gnu.org/bugs/?58108.
Reported-by: Liu Hao <lh_mouse@126.com>

Bug existed since version 4.9, commit 1961c052.
2020-04-03 11:21:24 +02:00
Benno Schulenberg 23f73cb8b3 tweaks: exit from the writing loop as soon as the last line is reached
Avoid having to decrement the count in order to offset the increment
at the end of the loop.

Also, declare a variable on a separate line, and rename it.
2020-04-01 16:05:45 +02:00
Benno Schulenberg 9f6962f3f1 tweaks: condense a comment, and express a condition in a different way 2020-04-01 15:54:08 +02:00
Benno Schulenberg 958e3ec201 feedback: show a message also when trying to copy an empty region 2020-03-31 19:44:32 +02:00
Benno Schulenberg ce9cfdaa45 tweaks: normalize the indentation after the previous change
Also improve a comment.
2020-03-31 19:44:32 +02:00
Benno Schulenberg 56a111afa3 tweaks: fold two blocks into each other, to elide three overlapping cases 2020-03-31 19:42:22 +02:00
Benno Schulenberg 38bbdf8fc3 tweaks: change a helping variable, to make two blocks still more similar 2020-03-31 19:27:07 +02:00
Benno Schulenberg a0e523cd4b tweaks: add a helping variable, to slightly condense the code
And to prepare for folding two blocks together.
2020-03-31 19:21:38 +02:00
Benno Schulenberg 7660849b8f tweaks: invert a condition, to see the similarity between the two modes
The two modes being: the normal full-line cutting, and --cutfromcursor.
2020-03-31 19:17:17 +02:00
Benno Schulenberg 4b814698bd copying: with --nonewlines, don't add a final newline to the cutbuffer
This fixes https://savannah.gnu.org/bugs/?58086.

Bug existed since commit f52b6cf1 from yesterday.
2020-03-31 19:12:46 +02:00
Benno Schulenberg 96046f1e82 copying: when using M-6, copy the final line in the buffer just once
When using --nonewlines and the cursor has arrived at the end of the
final line, each press of M-6 would add another copy of that line to
the cutbuffer.  That is clearly not the right behavior.

Also, give feedback when a press of M-6 does not actually copy anything.

This fixes https://savannah.gnu.org/bugs/?58088.

The bug was old -- it existed since before version 2.2.0.
2020-03-31 17:59:21 +02:00
Benno Schulenberg 387be713c8 docs: copy the 4.9.1 news item from the release branch 2020-03-31 14:09:08 +02:00
Benno Schulenberg d9943120ed tweaks: move two functions, to have them in a more logical order
The logical order being: cut, copy, paste.
2020-03-30 19:20:18 +02:00
Benno Schulenberg a1907d77f8 tweaks: add a helping variable, in order to unwrap three lines
Also, move an administrative thing to after the actual operations.
2020-03-30 19:13:50 +02:00
Benno Schulenberg f25a3f8a36 tweaks: elide three functions that are called just once
The function that they were called from has shrunk a lot,
so there is now room to write their content out in full.
2020-03-30 19:05:57 +02:00
Benno Schulenberg 9f1c3c8513 memory: plug a leak, by freeing the cutbuffer after a bracketed paste
Also, remove an unneeded assignment -- the 'cutbottom' variable is
needed only when consecutives cuts (^K) or copies (M-6) are made.
2020-03-30 16:55:38 +02:00
Benno Schulenberg d1521c584d tweaks: elide a now-unused parameter -- it is always FALSE 2020-03-30 16:55:30 +02:00
Benno Schulenberg f52b6cf19f copying: change the implementation, away from cutting plus copying back
First cutting the text to be copied (before copying it back into the
buffer) had unwanted side effects: it moved the cursor, and changed
the linestructs of the current line and the line where the mark was.

[This takes thirty more lines, but the idea is to later get rid of
the partitioning routines entirely.]
2020-03-30 16:55:17 +02:00
Benno Schulenberg 59040169ed tweaks: get rid of a bunch of annoying casts, and thus condense the code 2020-03-29 20:17:32 +02:00
Benno Schulenberg 8f6559828d files: make filtering of the entire buffer into a new buffer work again
This fixes https://savannah.gnu.org/bugs/?58076.

Bug existed since version 4.9, commit 477a9b33.
2020-03-29 18:04:36 +02:00
Benno Schulenberg 619962ee18 undo: when undoing a line cut, place the cursor back where it was
This fixes https://savannah.gnu.org/bugs/?58074.

Bug existed since version 4.9, commit ac612545.
2020-03-29 14:25:15 +02:00
Benno Schulenberg 7ebe44ac25 tweaks: rename a symbol, to be more accurate, and reshuffle two lines 2020-03-29 14:24:16 +02:00
Benno Schulenberg 0cc2104257 tweaks: elide a parameter, by calling the relevant function beforehand
This means that in most cases mark_is_before_cursor() is called twice:
once before get_region() is called, and once by get_region() itself.
This small duplication of effort is acceptable: the affected functions
are not time critical, and it makes the code shorter.
2020-03-29 13:22:17 +02:00
Benno Schulenberg 9a6158cd94 input: stop recognizing the raw escape sequences for F13 to F16
It is very unlikely that anyone uses those keystrokes: 1) no keyboard
has such keys; 2) the default bindings for these keys were removed a
year and a half ago, and no one complained; 3) for several years nano
did not recognize the modern xterm escape sequences for F13 to F16,
and no one ssh'ing from a new machine to an old machine complained.

The only people who might be affected by this removal are Konsole users:
a Konsole claims to be an xterm, but sends its own peculiar "Esc O 2 X"
sequences for F13 to F16.  Using the data from terminfo, ncurses will
not recognize those sequences, and will pass them untranslated to nano.
When nano now stops recognizing them too...  Well, let's see if there
are any Konsole users that use F13 to F16.
2020-03-29 12:04:37 +02:00
Benno Schulenberg 7d3aad403d options: make -S the short synonym of --softwrap
The form -$ is still accepted, but is deprecated.
2020-03-27 17:02:55 +01:00
Benno Schulenberg aa70f3d95e options: stop recognizing the obsolete --morespace and --smooth
They have been no-ops for a year.

Also remove their documentation entries.

(The nanorc options still remain -- to be removed next year.)
2020-03-27 16:54:09 +01:00
Benno Schulenberg ec457dc33a tweaks: rename a variable, for shortness and contrast 2020-03-27 15:29:48 +01:00
Benno Schulenberg 31b978ca3e docs: reduce the TODO file to a reference to the bug tracker on Savannah
All those items that were marked as DONE are not actually TO-DO items.

Also, most of those things are mentioned in the IMPROVEMENTS file too.
So, add the few that were missing there, and condense/rewrap some.
2020-03-26 19:27:46 +01:00
Benno Schulenberg 9a4586557b build: stop distributing a nano.spec file
We do not provide an RPM package.  And distros like Fedora, Mageia,
and Suse have their own spec files -- they don't need ours.  And in
case anyone would like to create their own RPM package from nano,
they can look at the spec files of those distros.
2020-03-26 17:08:36 +01:00
Benno Schulenberg 02c48dc8a4 tweaks: delete another pointless ChangeLog 2020-03-26 13:17:41 +01:00
Benno Schulenberg 384c9aaad3 tweaks: delete a ChangeLog that is no longer updated and is incomplete
It is incomplete at the top, in the middle, and at the bottom.

Also, the Makefile from gettext automatically includes this ChangeLog
in a release tarball when the ChangeLog exists.  This is an unneeded
burden on the tarball, as I don't think any distro installs this file
in nano's doc directory.  And if any does, I don't think they should:
it is not helpful for using nano.

If anyone would like to know more about the history of a PO file,
since we now have git, they can do something like:

        git log -p po/<LANGUAGECODE>.po |
        grep -e Revision-Date -e Last-Translator |
        grep -A1 "^\+.PO" | less
2020-03-26 13:17:21 +01:00
Benno Schulenberg 0c249de9e5 tweaks: for each version, mention the changes to the PO files last
Also, rewrap some lines, and  normalize how function names are listed,
back until version 0.9.9.
2020-03-26 12:18:22 +01:00
Benno Schulenberg abf4658ab9 tweaks: uniformize some old translator credits
And add two of the earliest that were missing.
2020-03-25 19:37:09 +01:00
Benno Schulenberg ba25d0df1d tweaks: fix twenty typos, in old Changelogs and in some comments
They were found by a run of 'codespell' at https://fossies.org/.

Reported-by: Jens Schleusener <Jens.Schleusener@fossies.org>
2020-03-25 16:57:43 +01:00
Benno Schulenberg e7fa43d600 po: update translations and regenerate POT file and PO files 2020-03-24 11:21:03 +01:00
Benno Schulenberg 49a84f9e8a bump version numbers and add a news item for the 4.9 release 2020-03-24 11:11:22 +01:00
Benno Schulenberg 6ee657b7d8 docs: trim some TODO items, and condense several others
Remove the suggested clever bracket matching.
2020-03-23 11:30:34 +01:00
Benno Schulenberg 6866ea0d0e justify: skip over in-line whitespace only, not over leading whitespace
This fixes https://savannah.gnu.org/bugs/?58028.

Bug existed since commit 107abd26 from yesterday.
2020-03-23 11:00:17 +01:00
Benno Schulenberg 34d38fe1c6 undo: treat a cut-until-end-of-buffer like a backward marked region
This fixes https://savannah.gnu.org/bugs/?58024.

Bug existed since commit ac612545 from two weeks go.
2020-03-22 19:16:22 +01:00
Benno Schulenberg b17309b652 tweaks: when extending the marked region, include also exotic blanks
Just in case someone uses multibyte whitespace characters.
2020-03-22 18:45:46 +01:00
Benno Schulenberg 107abd2654 justify: skip over blanks after the region, to not skew the indentation
This fixes https://savannah.gnu.org/bugs/?58023.

Bug existed since commit 3225c71e from six days ago.
2020-03-22 17:48:39 +01:00
Benno Schulenberg f528ced22b tweaks: use a symbol instead of a number, and drop two unneeded casts 2020-03-22 14:29:10 +01:00
Benno Schulenberg 71628ad0b8 build: fix compilation for --enable-tiny --enable-justify 2020-03-22 13:41:28 +01:00
Benno Schulenberg 481529e865 input: accommodate silly emulators that have LF instead of CR in a paste
Even though a user would never type ^J to start a new line, accept it
as a synonym of <Enter> (^M) in a bracketed paste, because apparently
bash accepts it as a synonym too.

This works around https://savannah.gnu.org/bugs/?58010.
2020-03-20 14:25:27 +01:00
Benno Schulenberg bc6645f753 tweaks: move two functions to before the ones that call them 2020-03-19 15:12:40 +01:00
Benno Schulenberg c1ca578853 tweaks: unwrap four lines, and use explicit codes where possible
The explicit codes are slightly faster, and they show the correspondence.
2020-03-19 14:55:39 +01:00