Commit Graph

10402 Commits

Author SHA1 Message Date
Benno Schulenberg e51a28e492 rcfile: add bindable functions for moving the cursor to top or bottom row 2024-04-07 10:47:03 +02:00
Benno Schulenberg 72c83badf6 feedback: lowercase a letter, as the phrase is not a full sentence
It could also have been after a comma (instead of between parentheses).
2024-04-07 10:39:06 +02:00
Benno Schulenberg fe4f74f631 minibar: mention the file format when it's DOS or Mac
This provides feedback about the file format in a better way than
how it was done until the previous commit.
2024-04-07 10:27:21 +02:00
Benno Schulenberg 2b335060b0 feedback: suppress format-conversion messages for --zero and --mini
A "Read xx lines (converted from...)" message should be suppressed when
--zero or --minibar are active (just like the normal "Read xx lines"),
as otherwise it gets shown at a confusing moment when multiple files
are opened at the same time.  The message should get shown, however,
when inserting a file into the current buffer.

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

Bug existed since version 6.0, commit f147131e.
2024-04-06 17:55:29 +02:00
Benno Schulenberg c3fc3ec73d tweaks: slightly reword the help text for the Replace-With prompt
To avoid the vague impression that the characters typed at the two
prompts should correspond one to one.
2024-03-31 14:02:29 +02:00
Benno Schulenberg be14fc593f tweaks: rename two variables, to be clearer and to match others
Also trim a verbose comment.
2024-03-30 12:39:15 +01:00
Benno Schulenberg f2bfa53b61 tweaks: elide a redundant variable 2024-03-30 12:39:04 +01:00
Benno Schulenberg 25d07b422d tweaks: rename a variable, to better indicate what it represents
And also to get away from the abundance of the word "current".
2024-03-30 11:35:41 +01:00
Benno Schulenberg 8610857015 feedback: drop an unnecessary warning, to not bother the user
The idea of the warning was that `row < 0 || row >= editwinrows` would
never be true: that the check was redundant and could be removed.

As it appears to be too hard to make sure in advance that a chunk will
not fall outside the viewport, just drop the warning and leave the check
in place.

This also addresses https://savannah.gnu.org/bugs/?64168.
Reported-by: Matteo Raso <matteo_luigi_raso@protonmail.com>
2024-03-30 11:15:32 +01:00
Benno Schulenberg 17abce073f display: do not attempt to draw a line that is outside the viewport
When we're on the last row in the viewport, it is unwise to try and draw
the next line.

This fixes https://savannah.gnu.org/bugs/?65539.
The issue was reported by `correctmost`.

Bug existed since commit c2322f85 from three days ago.
2024-03-30 10:49:29 +01:00
Benno Schulenberg 02d50bd4aa help: mention M-Home and M-End in the help text and help lines
Make these new keystrokes discoverable for people who read help texts.
2024-03-29 12:56:15 +01:00
Benno Schulenberg 67d459b262 bindings: let <Alt+Home/End> move the cursor to top/bottom of viewport
For now these are hidden keystrokes -- they are not listed anywhere,
and the functions are not bindable by the user.
2024-03-28 16:04:34 +01:00
Benno Schulenberg 5ecefb8766 moving: preserve horizontal position when jumping to top or bottom row 2024-03-28 16:04:34 +01:00
Benno Schulenberg 52eb0e992d new feature: functions that jump to the top or bottom of the viewport
(The next commit will preserve the horizontal cursor position.)
2024-03-28 16:04:34 +01:00
Benno Schulenberg 19ddc081c1 tweaks: rename a variable, to be more readable 2024-03-28 16:01:48 +01:00
Benno Schulenberg 8e91e26cc5 tweaks: reshuffle three fragments of code, moving related things together
And avoid calling xplustabs() twice in a row.
2024-03-28 15:58:28 +01:00
Benno Schulenberg c2322f8563 display: draw a new magic line rightaway when there are multiline regexes
Drawing a line will allocate multidata for it (even when the line is
actually empty), so that this multidata will not be missing later on
when the next line gets drawn in the same burst of keystrokes.

(This also removes the triggering of a full refresh when line numbers
are active: only the new magic line needs to be additionally drawn, in
order to get the line number printed.)

This fixes https://savannah.gnu.org/bugs/?65516.
The issue was reported by `correctmost`.

Problem existed since version 6.3, commit 80c2000f.
2024-03-27 11:12:47 +01:00
Benno Schulenberg 4f0683a481 docs: add an example binding for normalizing Unicode to the sample nanorc
This requires `uconv` from the 'icu-devtools' package (on Debian).
2024-03-26 11:37:29 +01:00
Benno Schulenberg b9449de5cf docs: improve the description of the 'flipexecute' bindable function
It is bindable only in the Insert menu -- in the Execute menu it has
a "blind", unadvertised binding (because I consider toggling between
menus somewhat of a misfeature).
2024-03-26 11:29:56 +01:00
Benno Schulenberg c3a9578b82 feedback: raise the level of "Macro is empty", to match similar messages
The other three "... is empty" messages use the AHEM error level too.
2024-03-26 11:27:38 +01:00
Benno Schulenberg 6351dab3e6 bindings: let M-" place/remove an anchor, and let M-' jump to one
On my current laptop, typing <Alt+Insert> is awkward because it requires
holding down <Fn> too.  Also, M-" and M-' are in the normal symbols area
of the keyboard, which makes them easier to type and more discoverable.
Furthermore, being next to M-: and M-; (on a US keyboard) reinforces the
meanings: start/place, stop/remove, run/goto.
2024-03-25 11:01:14 +01:00
Benno Schulenberg 3ef6399d56 tweaks: rename a variable, away from an abbreviation
And rename its sister too.
2024-03-24 10:46:46 +01:00
Benno Schulenberg f4754bfb5a memory: prevent a leak by freeing a possibly already existing color combo
This fixes https://savannah.gnu.org/bugs/?65505.

Buglet existed in this form since version 2.9.3, commit 4b24ce1c.
2024-03-23 11:04:23 +01:00
Benno Schulenberg 3fb8efc8f2 input: prevent 'macro_length' from underflowing when hammering M-:
Normally, when recording a macro, users will make their keystrokes
slowly and carefully, and will most likely wait to see the effect
of the previous keystroke before making the next.  So, the chances
of two `recordmacro` keystrokes coming in in quick succession is
normally nil.  The 'macro_length' variable just needs a guard to
prevent it from underflowing when someone is hammering the keys.

This fixes https://savannah.gnu.org/bugs/?65394 in a better way.
2024-03-22 16:27:34 +01:00
Benno Schulenberg 9ae84071eb input: store key codes in the macro buffer as they come in from ncurses
Otherwise the leading ESC of keystrokes like M-A does not get recorded.

This reverts commit 191cf671 from three weeks ago.

This fixes https://savannah.gnu.org/bugs/?65507.
2024-03-22 16:27:11 +01:00
Benno Schulenberg c2b4c2ae0e docs: mention that 'light' background colors do not work on Linux console
This addresses https://savannah.gnu.org/bugs/?65501.
Reported-by: Alan Cristhian Ruiz <alancristhian@protonmail.com>
2024-03-22 11:23:05 +01:00
Benno Schulenberg 9f1431be17 justify: keep as much of the marked region onscreen as possible
When the justified region fits in its entirety onscreen, then it should
be shown in its entirety, because the user is probably curious what the
region looks like after justification.  This behavior will mean that
the line above the topline of the screen will still have multidata
(when the syntax has multiline regexes).  When the justified region
does not fit onscreen, then as much as possible should be shown --
meaning that the cursor should be either at the top or the bottom
of the viewport, meaning that it should not be centered.

This fixes https://savannah.gnu.org/bugs/?65482.
The issue was reported by `correctmost`.

Bug existed since version 4.0, since justifying a region was introduced.
2024-03-19 17:18:18 +01:00
Benno Schulenberg e1c6ae7cf3 justify: keep the cursor at the original end of a marked region
When justifying a region that was marked backwards, the cursor
should stay at the beginning of this region.  The old logic was
faulty because mark_is_before_cursor() does not give the correct
result *after* the justification has been done: for some reason
the mark ends up always before the cursor.

Bug existed since version 5.2, commit 0f8423eb,
which mistakenly removed the auxiliary variable.  :/
2024-03-19 16:45:02 +01:00
Benno Schulenberg bb7a9fe7d2 tweaks: ungettextize three strings, to make a translator hint right again
The strings are gettextized further down, for the non-tiny version,
so they will get translated anyhow.  The relevant translator hint
is the earlier one about "the next thirteen strings".

Also adjust an indentation, and ungettextize another string for
consistency.
2024-03-19 11:56:33 +01:00
Benno Schulenberg d77263d8ed bindings: let M-& show the ncurses version+patch, as a small Easter egg 2024-03-18 10:33:40 +01:00
Benno Schulenberg fdd92af3ac display: add a wnoutrefresh() call for NetBSD, to force a cursor update
With NetBSD curses, when only the cursor is moved (without writing any
text), then a call of wnoutrefresh() is needed to make doupdate() move
the cursor.  Ncurses does not need this.

This addresses https://savannah.gnu.org/patch/?10438.
2024-03-18 10:02:11 +01:00
Benno Schulenberg dd009e0bc7 tweaks: rename a function and variable, to describe better what they do 2024-03-17 17:18:48 +01:00
Benno Schulenberg 170e7d79e7 tweaks: express an 'if' more concisely, and add two blank lines
The calls of wnoutrefresh() after those new blank lines are not needed
for ncurses to show the cursor in the right place, but are logically
needed because things have been written to the screen in the preceding
code -- although nano seems to work correctly also without those calls.
2024-03-17 16:57:19 +01:00
Benno Schulenberg a7635ceb5d tweaks: rename a variable, to be a bit more indicative 2024-03-17 16:40:04 +01:00
Benno Schulenberg 64fb0be8b2 tweaks: add another translator hint, to help avoid overlong key tags 2024-03-16 16:28:16 +01:00
Benno Schulenberg a5a8487132 tweaks: improve three translator hints
The browser listing has a rigid format: longer translations
for "(dir)", "(parent dir)", and "(huge)" will be clipped.
2024-03-15 14:06:14 +01:00
Benno Schulenberg 8cf61af551 indicator: do not oversize the scroller when softwrapping
This fixes https://savannah.gnu.org/bugs/?65445.

Bug existed since version 5.7, commit 49d8b99e.
2024-03-11 11:18:28 +01:00
Benno Schulenberg 778f000a3b docs: use a space after #, like everywhere else in the sample nanorc
Also, use a more mnemonic example shortcut for copy-to-clipboard.
2024-03-10 17:32:09 +01:00
Benno Schulenberg 623ff4e1ed docs: trim stuff that is more than five years old from the changelog
A detailed list of changes is useful for a small number of users only,
and only when the changes are fairly recent.

The NEWS file, that contains a summary of user-visible changes and
will be useful for a larger number of users, is distributed in full.
2024-03-09 17:18:04 +01:00
Benno Schulenberg 260f00c76d screen: recalculate the multidata when detecting the need for it
This fixes https://savannah.gnu.org/bugs/?65435.
The issue was reported by `correctmost`.

Problem existed since version 6.3, commit 80c2000f.
2024-03-09 09:01:31 +01:00
Benno Schulenberg 0c8a3b5c3e tweaks: pull a fragment of code a bit forward, to enable the next commit 2024-03-09 08:32:47 +01:00
Benno Schulenberg e76068a2de docs: adjust an example help line in the README to the current state 2024-03-08 17:12:28 +01:00
Benno Schulenberg a12e45c355 help: show ^F/^B as primary shortcuts for search, not as secondary
This looks better in the help viewer (^F/^B matching the pair M-B/M-F),
and showing ^F instead of ^W for search in the main edit window will
prevent novice users from using ^W in situations where they shouldn't.
2024-03-08 11:50:20 +01:00
Benno Schulenberg 74b9dd6881 help: rebalance the help items when --preserve is used
As a backward search is now normally always bound (to ^B, instead of
conditionally to ^Q), ^L should always be shown in the help viewer.

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

Problem existed since commit 8a304bdf, since ^F/^B do a search.
2024-03-08 11:31:02 +01:00
Benno Schulenberg edd0823d96 docs: mention that --modernbindings overrides --preserve 2024-03-08 11:25:14 +01:00
Benno Schulenberg 4ef4eb4f12 options: make --modernbindings actually override --preserve
When modern bindings are requested, ^S should save and ^Q must exit,
so --preserve and 'set preserve' need to be cancelled.

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

Bug existed since commit 18b37c98, which introduced --modernbindings.
2024-03-08 11:04:48 +01:00
Benno Schulenberg 862574f381 undo: force a screen refresh also for the special case Bsp-at-EOF
Because meanwhile the cursor might be someplace where EOF is offscreen.

This effectively reverts commit 9ccf85ea from two years ago, but also
sets 'focusing' to false so that the last line of the buffer will be at
the bottom of the edit window, where it probably was when Bsp was typed.

This fixes https://savannah.gnu.org/bugs/?65428.
The issue was reported by `correctmost`.

Bug existed since version 6.3, commit 9ccf85ea.
2024-03-07 17:14:18 +01:00
Benno Schulenberg c67ea1ffc1 undo: recompute the multidata when a piece of text is replaced
When a justification (or even a spell check) is undone or redone,
this might affect the matching of multiline regexes, so... schedule
a recalculation of the multidata in those cases.

This fixes https://savannah.gnu.org/bugs/?65426.
The issue was reported by `correctmost`.

Problem existed since version 6.3, commit 80c2000f.
2024-03-07 16:51:08 +01:00
Benno Schulenberg 5bd5bcd06a docs: mention backreferences (for replacements with regular expressions)
Also mention that nano prompts for each occurrence, and that, when
a region is marked, replacements are made only within that region.
2024-03-05 15:50:15 +01:00
Benno Schulenberg a13cd6a177 execute: show "Older" and "Newer" in the help lines, to allow rebinding
Since commits c8363a0d and a75bf0a1 from seven years ago, the Execute
menu permits retrieving previously executed commands, but the help text
and help lines never showed the corresponding keystrokes.

Four years ago commit d3954901 made the Execute menu directly accessible,
but I preferred to not mention the ^P/^N keystrokes in the help lines,
to leave as much space as possible for the executable functions (added
in subsequent commits), thinking that no one would want to rebind those
keystrokes anyway, as the Up/Down arrows seem more logical and easier.

The issue was reported by Ivan Vorontsov:
  https://lists.gnu.org/archive/html/help-nano/2024-02/msg00003.html
2024-03-05 11:31:48 +01:00