10454 Commits

Author SHA1 Message Date
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
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
Lukáš Zaoral
7fd38e88c1 memory: avoid a leak when linter aborts after producing parsable output
Any collected messages should be freed also after an
abnormal exit of the linter.

Buglet existed since version 2.4.1, commit f225991b.
2024-12-11 08:22:17 +01:00
Benno Schulenberg
ee66c13487 tweaks: adjust a translator hint, and add another one
For the affected four "tags" only 10 character cells are available
(on an 80-column terminal) since they are used in the help viewer.

For the other two "tags" 15 cells are available, as they are shown
only when the terminal is at least 380 columns wide.

Indirectly-reported-by: Rafael Fontenelle <rafaelff@gnome.org>
2024-11-24 17:41:04 +01:00
Benno Schulenberg
250192c603 tweaks: drop six unneeded casts
The cast is implied by the type of the assignee.
2024-11-24 17:41:02 +01:00
Benno Schulenberg
9d181a1cc6 build: fix a compilation error with gcc-15
Assigning a pointer to a boolean variable without a cast
is not accepted any more.

This addresses https://savannah.gnu.org/bugs/?66467.
Reported-by: Rudi Heitbaum <rudi@heitbaum.com>
2024-11-20 13:06:22 +01:00
LIU Hao
07a92c3988 syntax: asm: add end-of-word anchors to the keywords
Previously some of these regexes could color part of a directive;
for example, the `.int` part of `.intel_syntax`.

Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-11-05 17:12:25 +01:00
Benno Schulenberg
e9b0a57490 docs: put a space after "|" and before "{enter}" in the sample nanorc
This makes the example bindings slightly more legible.

Also improve a comment.
2024-11-04 16:22:07 +01:00
Benno Schulenberg
2fca581095 syntax: groff: correct the mistaken .rof extension to .roff
Buglet existed since version 2.9.8, commit cdd637d6.
2024-10-23 11:14:48 +02:00
Benno Schulenberg
53afd90ad4 syntax: groff: recognize also the .mom extension
This addresses https://savannah.gnu.org/bugs/?66369.
Reported-by: Elfener <elfenermarcell@gmail.com>
2024-10-23 11:07:05 +02:00
Benno Schulenberg
d9ea07515b docs: clarify the possible effects of a misuse of braced function names
And fix a nearby grammatical mistake that was
caused by commit 77a8841d from four months ago.

Inspired-by: Max Gammache <bigjango13@gmail.com>
2024-10-20 17:19:27 +02:00
Benno Schulenberg
de82920819 docs: add Shift+PgUp/PgDown to the FAQ item about urxvt modified keys
So that those keystrokes will select text per screenful also on urxvt.

Inspired-by: Sébastien Desreux <seb@h-k.fr>
2024-10-12 12:57:15 +02:00