Commit Graph

949 Commits (93df6ab385543190fd78130f662415d58f32cbbf)

Author SHA1 Message Date
Benno Schulenberg 93df6ab385 tweaks: shorten a comment, and drop some conditionalizing
The conditionalizing was needed only for Slang -- see commit 009fb2fa.
2021-11-27 17:07:47 +01:00
Benno Schulenberg be87f110ce bindings: allow rebinding ^Z also on a Linux console (a VT)
Achieve this by translating KEY_SUSPEND back to ^Z.

(Strictly speaking, this is incorrect, as the terminfo entry
might specify some other keystroke for 'kspd', but... meh.)

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

Bug existed since before version 2.2.0, since keys became rebindable.
2021-11-27 16:53:05 +01:00
Benno Schulenberg 9c9de85afb tweaks: elide a variable that is confusing and has just one use case 2021-11-22 12:03:28 +01:00
Benno Schulenberg 1235a5a365 tweaks: reshuffle the flag conversion into their order in the help text
This should make it slightly easier for translators when they compare
their PO file to nano's main help text.

Also, drop a die() -- a forgotten toggle name is not worth dying over.
2021-11-17 11:11:05 +01:00
Benno Schulenberg c772e1cb6b tweaks: rename a function, away from using an abbreviation
Also reshuffle a tiny fragment of code.
2021-11-17 11:01:37 +01:00
Benno Schulenberg 2f53760689 bindings: let ^T in the tiny version invoke spell checker (when included)
This fixes https://savannah.gnu.org/bugs/?61460.

Bug existed since version 5.0, commit d3954901, since in the normal
version ^T was repurposed to give direct access to the Execute menu.
2021-11-10 16:42:51 +01:00
Benno Schulenberg 3a94a0bb89 bindings: allow toggling line numbers (when enabled) also in tiny version
As a special case, and because it doesn't need any feedback on the
status bar nor other calls, add a special function and key binding
to allow the user to flip the LINE_NUMBERS flag also in a tiny nano.

This fixes https://savannah.gnu.org/bugs/?61441.
Reported-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-11-10 09:32:00 +01:00
Benno Schulenberg 0363703073 new feature: option --zero for an interface without bars
With --zero or 'set zero', nano will hide the title bar or the minibar
(whichever is active) and will use all rows of the terminal for showing
the text of the buffer.  Only when there is an important message will
it be shown on the bottom row -- until the next keystroke.

This feature can be toggled with M-Z.

The feedback at startup ("Read nnn lines") is suppressed with --zero,
because it disrupts the fullscreen experience (and is hardly useful).
The "Reading..." message then needs to be suppressed too, otherwise
it creates an annoying little flash.

There are still some issues that need to be addressed:

* In the browser, when the highlighted item is on the bottom row, it
  will get obscured by the prompt bar or the "Search Wrapped" message.

* In the edit window, when the search occurrence is on the bottom row,
  it can get obscured by the "This is the only occurrence" message.

* When tabbing at a prompt shows possible completions, they are shown
  a row too low.
2021-11-09 11:50:40 +01:00
Benno Schulenberg e4a247f7c9 tweaks: rename three functions, to better fit the general scheme 2021-11-09 10:39:31 +01:00
Benno Schulenberg 69b2467a9a tweaks: rename two more functions, to lose a senseless suffix 2021-11-09 10:18:03 +01:00
Benno Schulenberg 27f170815f tweaks: rename two functions, to get rid of one more senseless suffix 2021-11-08 16:54:18 +01:00
Benno Schulenberg d3c7e9d2f6 tweaks: rename two functions, to get rid of another senseless suffix 2021-11-08 16:41:44 +01:00
Benno Schulenberg ea4bbf4285 tweaks: rename two functions, to get rid of the senseless suffix of one 2021-11-08 16:16:35 +01:00
Benno Schulenberg c692a6ca70 tweaks: reshuffle a line into its proper order, and improve two comments 2021-11-07 11:23:45 +01:00
Benno Schulenberg 9e982f3283 tweaks: rename a function, for some contrast and to get rid of a suffix 2021-11-05 15:59:32 +01:00
Benno Schulenberg 11fec6f63c feedback: when the user types ^Z, say they can suspend nano with ^T^Z
Inspired-by: Sébastien Desreux <seb@h-k.fr>
2021-11-05 15:25:03 +01:00
Benno Schulenberg d0c2c1e6b9 suspension: leave ^Z unbound by default -- just ^T^Z will suspend nano
Suggest in the documentation how to get a one-keystroke Suspend.
2021-11-05 15:24:45 +01:00
Benno Schulenberg fc5d58ad97 tweaks: add two spaces and two comments, and drop an internal check 2021-10-31 16:45:43 +01:00
Benno Schulenberg 8da098f5e0 help: group the now lone mouse toggle with the "behavioral" ones 2021-10-31 10:55:07 +01:00
Benno Schulenberg 83f94a88df suspension: enable ^Z by default -- ignore -z option and drop M-Z toggle
In the beginning, the goal for nano was to be a drop-in replacement for
Pico.  Pico did not know a Suspend command, so the ^Z keystroke needed
to be conditionalized on an option (-z or --suspend or the toggle M-Z),
just like the ^S and ^Q keystrokes (for stopping and resuming terminal
output) were conditionalized on --preserve.

But nano has abandoned full Pico compatibility since version 4.0.  It
is time to unconditionalize ^Z as well.  This should not be a problem:
Debian and Ubuntu have had 'set suspend' in their /etc/nanorc for years,
so a considerable portion of nano users have had ^Z enabled by default
for a long time, and no one seems to have complained.

If the keystroke bothers some user, they can unbind it in their nanorc.
They will still be able to suspend nano through the Execute menu: ^T^Z.

This addresses https://savannah.gnu.org/bugs/?61372.
2021-10-31 10:55:07 +01:00
Benno Schulenberg 9b419d0bff tweaks: rename a function, to describe better what it does nowadays 2021-10-22 11:50:04 +02:00
Benno Schulenberg 6018de2466 tweaks: condense the definitions of all the empty functions 2021-10-11 11:21:31 +02:00
Benno Schulenberg e9f0597e2e tweaks: rename two empty functions, to be more to the point
Also, move them to global.c, where all the other empty functions are.
2021-10-09 17:33:32 +02:00
Benno Schulenberg 65d81c60cd help: do not show ^S when --preserve is in effect
This fixes https://savannah.gnu.org/bugs/?61317.

Bug existed since version 5.0, since the Execute menu was overhauled.
2021-10-09 13:05:27 +02:00
Benno Schulenberg 8ef74b3aac tweaks: rename five empty functions, to get rid of a meaningless suffix
For consistency, these five names ought to start with "flip_", but
then the bindable functions would need to be renamed too, and that
would be annoying for the user, *and* it would create too many names
that start with "flip" -- it wouldn't be distinctive any more.
2021-10-08 10:58:47 +02:00
Benno Schulenberg 46b5f83601 tweaks: fold two lines into two others, for conciseness 2021-10-04 12:03:47 +02:00
Benno Schulenberg 6d5b16562f help: make the keystrokes ^W^Y and ^W^V work again
The keystrokes are not listed, but should work like
they do in a normal, editable buffer.

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

Bug existed since version 4.0, commit bc98dbca.
2021-10-04 11:54:02 +02:00
Benno Schulenberg 508301a2ef browser: make the keystrokes ^W^Y and ^W^V work again
The functions to_first_file() and to_last_file() can get called from
do_statusbar_input(), which is called indirectly from do_prompt(),
and are expected to make the corresponding adjustment.

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

Bug existed since version 5.0, commit 07c1ac90.
2021-10-04 11:38:30 +02:00
Benno Schulenberg 9f8309fba8 help: use smaller triangles for the arrows
In Dejavu Sans Mono the old pointing triangles had a decent size,
but in Noto Mono and in Ubuntu Mono (fonts that handle combining
diacritics better) those triangles were massive, visually taking
up more than a single cell, overlapping the closing parenthesis
when they are displayed in the second column.  Not nice.

The new pointing small triangles look good in the Noto and Ubuntu
fonts, but are real tiny in Dejavu.  :|  Oh well, one can't have
everything.

(Other triangles are not an option, because they don't degrade to
actual arrows when on a Linux console.)
2021-06-14 09:29:27 +02:00
Benno Schulenberg 0371dd1bde tweaks: rename two functions, to get rid of an ugly _void suffix
Also drop an unneeded prototype.
2021-06-13 12:17:33 +02:00
Hussam al-Homsi 092c62ccb8 bindings: allow copying text (with M-6) also when in view mode
This can be useful when wanting to search for the other occurrences
of some (long) string in the buffer: select, M-6, ^W, ^U, <Enter>.

Signed-off-by: Hussam al-Homsi <sawuare@gmail.com>
2021-06-02 11:09:24 +02:00
Benno Schulenberg d1957819c4 bindings: show either "^/" or "^-" in the help lines, instead of "^_"
The "^_" has always been poorly legible (the underscore melting into
the bottom of the terminal) and difficult to type (Shift+Ctrl+minus).
The "^/" is both more readable and easier to type.

In terminal emulators, "^/" is shown, but on a Linux console "^-",
as ^/ does a backspace in the default console key mapping.

Also, allow using "^-" when rebinding ^_ in a nanorc file.

This addresses https://savannah.gnu.org/bugs/?57393.
2021-05-22 16:52:56 +02:00
Benno Schulenberg 6360e4170a copyright: update the years for the FSF 2021-01-11 14:22:51 +01:00
Benno Schulenberg d30ddf0add tweaks: correct a translator hint 2021-01-07 15:18:57 +01:00
Benno Schulenberg caef3128eb search: suppress the cursor when highlighting a match
Having a block cursor present when highlighting a match...
does not look nice.  So... hide the cursor until the next
keystroke, unless --showcursor or 'set showcursor' is used.
2020-12-24 11:49:22 +01:00
Benno Schulenberg ba4f4bdc64 minibar: show the line count in the bar (at startup and when saving)
Show the line count too when switching between buffers.
2020-12-23 12:17:06 +01:00
Benno Schulenberg 13b839734f hellp: show all valid help items also in the Write-Out menu
Subtract one from the count only if all possible items in the menu
have been counted (item == NULL), meaning that the last item in the
Write-Out menu (the 'discard_buffer' function) has been counted too.

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

Bug existed since version 4.5, commit b3ace4d8.
2020-11-26 15:37:21 +01:00
Benno Schulenberg b9d6d547b8 bindings: accept b for scrolling back up in help viewer and file browser
Like in Dillo, and because it could be mnemonic for "Back" and
is directly above the space bar (in a QWERTY layout, at least).
2020-10-11 16:11:21 +02:00
Benno Schulenberg 6dd5a75d13 tweaks: add a hint for translators 2020-09-21 19:34:21 +02:00
Benno Schulenberg ffc0b4863b feedback: in the tiny version, let M-H show the helpful hint too 2020-09-19 12:23:16 +02:00
Benno Schulenberg a2878bff67 help: nicely pair menu items also when built with just --disable-help 2020-09-18 19:14:43 +02:00
Benno Schulenberg 07b5d97a3a help: do not show "^G Help" in the tiny version when there is no help
Also, to keep menu items nicely grouped in the Main, Search, Replace,
and Goto menus, reorder a few items when no help is available.

This addresses https://savannah.gnu.org/bugs/?59110.
2020-09-18 15:21:24 +02:00
Benno Schulenberg 3e9c2ecc85 help: in the tiny version, show Prev/Next Word before Backward/Forward
In the tiny version (built with Slang and running on Debian's bterm)
the Ctrl+Left/Ctrl+Right keystrokes do not work.  When the terminal
is wide enough, instead of showing ^B + ^F for Backward and Forward
(which are unneeded because the unmodified arrow keys work fine),
show M-B + M-N for Prev Word and Next Word.

(Listing ^Space and M-Space instead would cause "Prev Word" and
"Next Word" to be truncated.  They are weird keystrokes anyway.)

Also, list M-Q + M-W for "Previous" and "Next" next to "Where Is"
and "Replace", so that it is slightly clearer what they refer to.
2020-09-11 10:00:21 +02:00
Benno Schulenberg 48ac0a64c6 tweaks: dummy commit, to add some info about the previous one
The previous commit fixed https://savannah.gnu.org/bugs/?59071.

That bug existed since version 5.1, commit cc6d1d59.

But before that, a capital Ñ could not be typed (when built with Slang)
and would enter an invalid byte upon the next keystroke.

That bug existed since version 2.8.6, commit 43a5c876.
2020-09-08 09:05:01 +02:00
Benno Schulenberg 40b03162c3 bindings: make <Alt+Backspace> delete a word backwards, like in Bash
It jars a bit that it is <Ctrl+Delete> that deletes a word rightward
and <Alt+Backspace> that deletes a word leftward.  But it's good to
also have a two-key keystroke bound by default to 'chopwordleft',
and not just the three-key <Ctrl+Shift+Delete>.

This fulfills https://savannah.gnu.org/bugs/?58709.
Requested-by: Axel Scheepers <axel.scheepers76+gnu@gmail.com>
2020-07-31 18:52:51 +02:00
Benno Schulenberg fd667b5191 tweaks: add four more translator hints 2020-07-27 10:33:42 +02:00
Benno Schulenberg 1542cbf942 bindings: add mistakenly removed M-J (Full Justify) back to the main menu
This fixes https://savannah.gnu.org/bugs/?58729.

Bug existed since commit ee03c4b8 from six weeks ago.
2020-07-08 15:46:50 +02:00
Benno Schulenberg 07c1ac9035 tweaks: delete two functions that are never executed
Those two operations are performed directly in do_browser().
2020-07-04 17:14:52 +02:00
Benno Schulenberg a84653dc19 feedback: show the cursor position also at startup in an empty buffer
When using --constantshow and --nohelp and opening a new buffer,
the cursor location should be shown on the status bar right away.

Bug existed since commit 2e688640 from a few hours ago.
2020-07-03 13:03:44 +02:00
Benno Schulenberg 1388af2bdc tweaks: elide a wrapper function, by checking a precondition earlier 2020-07-03 12:41:40 +02:00