10478 Commits

Author SHA1 Message Date
9a96973b00 Merge branch 'master' of https://git.savannah.gnu.org/git/nano into line-folding 2025-04-02 15:23:18 -07:00
Benno Schulenberg
186896f072 po: update translations and regenerate POT file and PO files 2025-04-02 11:07:28 +02:00
Benno Schulenberg
78eb483bc2 bump version numbers and add a news item for the 8.4 release 2025-04-02 09:29:24 +02:00
Benno Schulenberg
c7033324a9 gnulib: update to its current upstream state 2025-03-24 10:27:28 +01:00
Benno Schulenberg
334604a591 syntax: po: colorize also format specifiers like "%.6f" 2025-03-17 12:48:04 +01:00
Benno Schulenberg
7905ba80ea docs: add a suggestion to the FAQ on how to configure nano for git 2025-03-17 12:47:15 +01:00
Benno Schulenberg
ccff4685df docs: in the FAQ, replace an old item with an item about Byte Order Marks 2025-03-15 12:08:20 +01:00
Benno Schulenberg
0167f78dca feedback: warn when the cursor sits on a Byte Order Mark (BOM)
The ceck is only done at the start of a line, because in other places
the BOM will be glued to the preceding character.

This partially addresses https://bugs.debian.org/964901.
Reported-by: Nils König <oneric@oneric.de>
2025-03-15 09:17:01 +01:00
Benno Schulenberg
282ec08e5e docs: change two interface colors in the sample nanorc
For esthetics, and to showcase possibilities.
2025-03-14 11:48:29 +01:00
Benno Schulenberg
5efb7f31df tweaks: add a translator hint for the three changed file-writing prompts 2025-03-14 08:07:23 +01:00
Benno Schulenberg
bf39ffe903 prompt: accept tabs in an external paste as literal tabs
This fixes https://savannah.gnu.org/bugs/?66892.

Buglet existed since before version 2.0.0.
2025-03-12 16:59:58 +01:00
Benno Schulenberg
f2c30aa437 prompt: beep when an external paste contains a command code
Until the previous commit, nano used to beep for any command code
in an external paste.  It's better to continue doing that.

(When pasting multiple lines, it's debatable whether nano should
beep for each discarded CR.  But for any other command code, it
definitely should beep.  Maybe it should even show a message.)
2025-03-11 16:27:08 +01:00
Benno Schulenberg
bf12c90b07 input: implement bracketed pastes in a different manner
Ask ncurses to recognize the escape sequences that mark the start
and end of a bracketed paste, and thus benefit from the waiting that
ncurses does for an escape sequence to complete.  This helps prevent
nano from failing to recognize an end-of-paste sequence (resulting
in hanging or inserting some sequence characters into the buffer).

This addresses https://savannah.gnu.org/bugs/?66858 in a better way.
Reported-by: Doug Smythies <dsmythies@telus.net>
2025-03-10 17:17:07 +01:00
Benno Schulenberg
615570cf5e tweaks: remove two commented-out lines and two unused variables
And harmonize some whitespace.
2025-03-09 10:25:45 +01:00
Benno Schulenberg
aff9f4742c input: remove single-keycode detection from the bracketed-paste routine
It interferes with an upcoming change.
2025-03-08 12:08:30 +01:00
Benno Schulenberg
31a2cc9d76 tweaks: swap two fragments of code, to allow unwrapping a line 2025-03-08 12:07:49 +01:00
Benno Schulenberg
9c6a62d319 tweaks: remove an unwanted newline from a debugging message 2025-03-06 12:19:29 +01:00
Benno Schulenberg
38c8845b05 input: remove a special-case workaround
Let the more general flaw handling (added in commit 41c1b962, and
amended in the previous commit) handle also this case: it's better
to let the user know that they are using poor pasting software than
to silently work around the issue.

This effectively reverts commit 555a9878 from last week.
2025-03-06 09:42:53 +01:00
Benno Schulenberg
934d122dd4 input: robustness is good, but dropping a key code is not a good idea
If (on a bogged-down computer) a paste goes so slow that the bytes
come in one by one, nano shouldn't discard any of them -- the user
is unlikely to appreciate this.  Just switch the bracketed paste
off, for the possibility that the closing sequence went missing,
and accept that this closing sequence gets pasted into the buffer.
2025-03-06 09:42:43 +01:00
Benno Schulenberg
f8de98f7cd tweaks: condense a fragment of code 2025-03-04 16:44:32 +01:00
Benno Schulenberg
ef7f825d97 input: adjust file browser and help viewer for changed bracketed pastes
Since the previous commit, the escape-sequence-parsing code does not
set 'bracketed_paste' to FALSE any more when the closing sequence is
deficient.  So, the browser and viewer need to do that themselves.

Also, instead of just beeping and wordlessly discarding a paste when
it's done in the file browser or help viewer, report that it is being
ignored.  This is much more friendly.
2025-03-04 16:44:32 +01:00
Benno Schulenberg
41c1b9623e input: make bracketed paste more robust against loss of closing sequence
A bracketed paste should be one large batch (or several batches)
of bytes, not single bytes coming in one by one.  When the latter
happens, assume the end-of-paste sequence got swallowed somehow,
stop the bracketed paste and display a warning, while discarding
the first byte that came in alone.

This change was inspired by this report from Doug Smythies:
  https://lists.gnu.org/archive/html/nano-devel/2025-02/msg00001.html
2025-03-04 16:44:32 +01:00
Benno Schulenberg
555a987844 input: wait a bit for "~" when bracketed-paste sequence is incomplete
When pasting something into nano over OpenSSH_for_Windows, the final
tilde of the end-of-paste sequence can lag some 29 ms behind the rest
of the sequence, causing ncurses to split it off into a next batch of
bytes.  Accommodate for this by noticing the missing tilde and then
waiting at most one second for it to arrive.  This prevents the tilde
from appearing spuriously in the buffer after the paste.

This addresses https://savannah.gnu.org/bugs/?66858.
Reported-by: Doug Smythies <dsmythies@telus.net>
2025-03-04 16:44:32 +01:00
1d4ac090d8 Merge branch 'master' of https://git.savannah.gnu.org/git/nano into line-folding 2025-02-28 11:42:40 -08:00
Benno Schulenberg
c1df6dfd05 execute: retain what the user typed before a tool was invoked
When the user types something at the Execute prompt and then invokes
one of the six tools or special functions (that don't take any input),
stash the typed string and restore it upon the next invocation of the
Execute menu.  This way the typed string is not lost when the tool or
special function was invoked by accident -- which it likely was, as
those tools and functions don't take any input from the prompt.

This addresses https://savannah.gnu.org/bugs/?66637.
Suggested-by: Evgeny Pestov <fsdhfhhf@gmail.com>
2025-02-28 17:12:43 +01:00
Benno Schulenberg
163c569919 syntax: po: colorize also format specifiers like "%<PRIu64>" 2025-02-28 11:34:42 +01:00
Benno Schulenberg
63a7be115a syntax: po: colorize also a 'msgctxt' line, and the 'c++-format' flag 2025-02-20 13:49:03 +01:00
Benno Schulenberg
fed31f2a79 syntax: po: colorize also Python's "%(name)x" format specifiers 2025-02-17 13:58:35 +01:00
Benno Schulenberg
5d496b3152 syntax: po: colorize also the Python-specific conversion specifier "%r" 2025-02-16 09:44:18 +01:00
Benno Schulenberg
f5a2b8983d syntax: groff: highlight the zeroeth macro argument too
It is used in some .tmac files.
2025-02-15 17:47:20 +01:00
Benno Schulenberg
8f44800588 tweaks: add missing closing quotes, as reported by mandoc -T lint ... 2025-02-15 17:44:16 +01:00
Benno Schulenberg
68c9b6af07 tweaks: prevent some more keywords from getting hyphenated 2025-02-14 17:22:38 +01:00
Benno Schulenberg
8536b4bfcb tweaks: prevent some color keywords from getting hyphenated in man page 2025-02-14 16:50:16 +01:00
Benno Schulenberg
0694c616a2 syntax: man: highlight some escapes, like \& and \(em, specially
This helps prevent reading things like \e and \(em as text.
2025-02-14 16:42:45 +01:00
Benno Schulenberg
8e456bab9f docs: use proper emdashes instead of double hyphens: "--" => "\(em"
Also, remove redundant double quotes, protect single quotes from
possibly getting misinterpreted, and protect periods from getting
treated as end-of-sentence.  Also, use \e instead of \\.

(Overlong lines are left alone -- they don't bother me.)

This partially addresses https://bugs.debian.org/1095957.
Reported-by: Bjarni Ingi Gislason <bjarniig@simnet.is>
2025-02-14 16:29:13 +01:00
Benno Schulenberg
aa663ae386 tweaks: consistently use "\fR" for switching back to normal, roman font 2025-02-12 09:34:29 +01:00
Benno Schulenberg
01c8ffd61f tweaks: avoid running tolower() on an out-of-range value
Functions like tolower() expect characters in the range -1..255.

Reference: https://savannah.gnu.org/bugs/?50289.

The other occurrences of toupper(), tolower(), and isxdigit() that
don't do a cast are fine, because the values of 'code' or 'keycode'
are already guaranteed to be in range by the surrounding code.
2025-02-12 09:34:06 +01:00
Benno Schulenberg
58c7358cb3 tweaks: change the man-page markup of options that take an argument
This is an attempt to work around a bug in the Debian HTML-renderer of
manual pages: see how after "-C" everything is in italics [1], instead
of just the "directory" arguments.  (The renderer for Arch Linux does
even worse, showing the first argument in bold italics [2].)

The old markup was fine, though, as `groff` had no problem generating
properly formatted HTML [3].

[1] https://manpages.debian.org/bookworm/nano/nano.1.en.html
[2] https://man.archlinux.org/man/nano.1.en
[3] https://nano-editor.org/dist/v7/nano.1.html
2025-02-10 16:34:15 +01:00
Benno Schulenberg
1a150bf544 syntax: po: colorize also the %llu and %hhi format specifiers
And colorize %% only by itself, not combined with anything.
2025-02-10 11:04:06 +01:00
Benno Schulenberg
98bab0db07 docs: improve the description of the constantshow bindable function
And of the '--constantshow' and 'set constantshow' options.
2025-01-20 15:25:40 +01:00
Brand Huntsman
b9c65193af files: improve the wording of the normal file-writing prompts
Make them similar to the prompts for writing out a selection.

Signed-off-by: Brand Huntsman <alpha@qzx.com>

(The change was first proposed seven years ago as part of a patch set:
  https://lists.gnu.org/archive/html/nano-devel/2018-02/msg00144.html,
then reposted by myself:
  https://lists.gnu.org/archive/html/nano-devel/2018-02/msg00147.html,
and then... forgotten.)
2025-01-17 11:11:04 +01:00
Benno Schulenberg
20403ef8bb copyright: update the years for the FSF 2025-01-14 11:00:11 +01:00
Benno Schulenberg
e26cdd3dab tweaks: remove three redundant pairs of parentheses from a nanorc regex 2025-01-12 12:32:27 +01:00
Benno Schulenberg
2065713e5c docs: replace a word that is better not used in the plural
Noted by https://fossies.org/linux/misc/nano-8.3.tar.xz/codespell.html.
2024-12-24 17:14:23 +01:00
Benno Schulenberg
a9cf841042 po: update translations and regenerate POT file and PO files 2024-12-21 11:55:15 +01:00
Benno Schulenberg
46466530a5 bump version numbers and add a news item for the 8.3 release 2024-12-21 11:23:05 +01:00
Benno Schulenberg
94ed548366 gnulib: update to its current upstream state 2024-12-20 12:15:44 +01:00
Benno Schulenberg
1e4c69baa7 tweaks: adjust another translator hint, and add two more
The "Prev Line"/"Next Line" tags are shown in the help viewer,
so on an 80-column terminal they may be only 10 cells wide.
2024-12-16 11:16:10 +01:00
Benno Schulenberg
f04c1a6ab5 syntax: markdown: accept also digit 0 in a list marker
For ordered lists, 10., 20., 30., ... were not getting colorized.

Also, https://daringfireball.net/projects/markdown/dingus
accepts 0. by itself just fine as marker.

This addresses https://savannah.gnu.org/patch/?10492.
2024-12-15 11:39:06 +01:00
Benno Schulenberg
6393edf40a tweaks: add a small clarifying comment 2024-12-11 17:12:50 +01:00