Commit Graph

921 Commits (9f8309fba8fbb7170d2825c685f45bc2dd5e4a0f)

Author SHA1 Message Date
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
Benno Schulenberg 2e6886406c tweaks: elide an unneeded global variable
The constant cursor display must be suppressed whenever a message
was printed to the status bar.  That is: whenever 'lastmessage' is
something other than 'VACUUM'.
2020-07-03 12:41:40 +02:00
Benno Schulenberg 80ff5e76d6 help: pair the items in the two bottom lines better in the tiny version
This fixes https://savannah.gnu.org/bugs/?58693.

Bug existed since commit 9b8930cc from ten days ago.
2020-07-03 11:28:41 +02:00
Benno Schulenberg 1a2d0c1770 scrolling: add a function and a key binding to center the cursor line
By default, this function is bound to ^L, to make that keystroke do
something actually useful.  To not lose the Refresh function that this
keystroke had, the centering function additionally does a full redraw
and refresh of the screen.
2020-07-02 11:11:44 +02:00
Benno Schulenberg 3e609ee4c7 rcfile: complain when an essential key binding is missing
This fixes https://savannah.gnu.org/bugs/?58670.

Bug existed since commit 009fb2fa from two days ago.
2020-06-29 11:09:12 +02:00
Benno Schulenberg 331bd7662e tweaks: delete a now-unused function 2020-06-27 10:23:03 +02:00
Benno Schulenberg 009fb2fae6 tweaks: make three hard-bindings of special keys more efficiently
Instead of calling a function that tries to find the relevant operation,
just add three hidden hard-bindings at the end of the shortcuts list.

They are hidden because we don't want them to show up in the help text,
because we don't know what to call them (as a Cancel and Suspend key
don't exist on normal keyboards) or naming the key would be confusing
(Sh-Ins is grabbed by the desktop manager and doesn't reach nano).
2020-06-27 10:20:45 +02:00
Benno Schulenberg f601eeda57 build: fix compilation when configured with --disable-color 2020-06-22 12:49:04 +02:00
Benno Schulenberg 9b8930cc13 tweaks: adjust the conditional help-item pairing for absence of speller
The Spell Checker is no longer among the first twelve items of the
main menu, so the conditional placing of the Go To Line item should
no longer depend on it.
2020-06-22 09:09:05 +02:00
Benno Schulenberg a9e171de52 tweaks: update three translator hints, add two, and frob three strings 2020-06-21 14:10:37 +02:00
Benno Schulenberg 90f6342fd1 tweaks: rename two header files, to be distinct and not an abbreviation 2020-06-20 12:09:31 +02:00
Benno Schulenberg d8249917c3 bindings: allow toggling the help lines at several prompts and in browser
Now the help lines can be toggled not only while editing, but also at
the Read (^R), Write (^O), Execute (^T), Search (^W), Replace (M-R),
Goto (^/), and Yesno prompts, and also in the file browser and when
searching for a file name.  The help lines cannot be toggled in the
help viewer, nor when searching in a help text, nor in the linter,
as these three things force the help lines to be on.

Furthermore, the 'nohelp' function can be rebound in all relevant
menus (default binding: M-X).

This fulfills https://savannah.gnu.org/bugs/?58471.
2020-06-18 15:36:10 +02:00
Benno Schulenberg d67faa2bb5 tweaks: remove a superfluous global variable
There were no calls of statusbar() or statusline() before curses mode
was entered.  But since the previous commit curses mode is entered
even earlier, so...
2020-06-14 13:09:23 +02:00
Benno Schulenberg b33a62af8c new feature: a position-plus-portion indicator on the righthand side
This displays a scrollbar-like thing on the right edge of the screen,
giving a rough indication where in the buffer the text that is being
shown in the viewport is located, and how large/small a portion of
the buffer this text is.

(Support for softwrapping, and an option to turn the indicator on,
will arrive in subsequent commits.)

This fulfills https://savannah.gnu.org/bugs/?57956.

Original-patch-by: Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com>
2020-06-04 18:52:28 +02:00
Benno Schulenberg d729edaeda bindings: make ^L (Refresh) work at all the prompts too
(Unfortunately, this means that ^L cannot be used for the
Linter in the "Execute Command" menu.)

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

Bug existed since around version 2.1.0.
2020-06-04 09:10:48 +02:00
Benno Schulenberg 2a44cb2ed8 tweaks: rename a function, to leave the old names behind
What the function does has changed, so better change the name too.
2020-06-01 09:43:08 +02:00
Benno Schulenberg ee03c4b857 bindings: remove the Full-Justify function from the Search menu
It was out of place there and found a new home in the Execute menu.
2020-05-30 18:58:41 +02:00
Benno Schulenberg 6d7ff17901 help: put the two toggles first in the "Execute Command" menu
This makes that the M-F toggle stays roughly in the same place when
toggling between "Read File" and "Execute Command", and groups the
six special commands together.
2020-05-30 18:57:04 +02:00
Benno Schulenberg 7bad92c50b bindings: add ^Z (Suspend) to the "Execute Command" menu
This makes suspension more discoverable, and allows the user to rebind
^Z in the main menu without losing the ability to suspend nano.

This drops the ^X (Flip Execute) toggle from the menu -- keeping it
would make an ugly uneven number and would reduce the space for each
menu item too much (clipping "Full Justify" and "Cut Till End") --
but it is still present as a blind toggle.
2020-05-30 18:56:58 +02:00
Benno Schulenberg d3954901a9 bindings: make ^T invoke the "Execute Command" menu, and ^T^T the Speller
Make the "Execute Command" menu accessible also with a single keystroke
(^T), not just with a double one (^R^X).  This is useful, because no one
will suspect that "Execute Command" can be found behind "Read File".

To not disturb muscle memory too much for people who are used to ^T
invoking the Spell Checker, a second ^T will invoke it.
2020-05-30 18:56:55 +02:00
Benno Schulenberg cd594b85f4 general: make five tools accessible through the "Execute Command" menu
Instead of creating a special Tools menu, add the five functions that
affect the whole buffer to the "Execute Command" menu.  There is room
for these five functions there, and they kind of fit in because three
of them (Speller, Linter, and Formatter) actually invoke an external
command, and Full Justify could have been implemented externally, and
the destructive Cut Till End ought to have required a double keystroke
since the beginning.
2020-05-30 18:56:51 +02:00
Benno Schulenberg 933dd567de tweaks: separate a symbol from its definition by two spaces
It's a little clearer, and new ones were like that already.
2020-05-29 18:45:14 +02:00
Benno Schulenberg 8089f5ad54 build: do not let --disable-speller exclude also the formatter code
In the past, when Speller and Linter and Formatter were all bound
to ^T (later ones taking priority), it was easier to exclude also
the formatter code when --disable-speller was used.  But since the
formatter was reintroduced (in commit 34170611) and bound to its
own keystroke (M-F), this is no longer the case.
2020-05-24 12:08:50 +02:00
Benno Schulenberg 2579b105da tweaks: slightly improve the grouping of shortcuts in some help texts 2020-05-24 11:54:02 +02:00
Benno Schulenberg 53c5ace8c3 tweaks: rename a symbol, away from a double abbreviation 2020-05-22 10:04:33 +02:00
Benno Schulenberg 187843d2da tweaks: exclude a bit of bracketed-paste code from the tiny version
The tiny version does not support bracketed pastes.
2020-05-14 18:47:50 +02:00
Benno Schulenberg b9deb883fa tweaks: shorten the name of a symbol, to match its bindable function 2020-05-01 13:25:15 +02:00
Benno Schulenberg d4ee6a2b53 options: rename --tempfile to --saveonexit, to be far clearer
A long option should describe what it does, not vaguely hint at it.

Also, in several places of nano's code we deal with actual temp files,
and then having a flag called TEMP_FILE that doesn't have anything to
do with temp files is somewhat confusing.
2020-04-30 19:12:54 +02:00
Benno Schulenberg fd70c25d21 menus: remove unneeded words and shortenings from key labels
In "Cut Text" and "Paste Text" the word "Text" is superfluous.  (It
could even be called slightly misleading, because by default ^K will
cut the current line, whether or not it contains text.)

The "Get Help" is of course inherited from Pico, but to me it has
always sounded a bit as if it would go search help on the internet.

Instead of "Spelling" I would have preferred "Spellcheck", but that
gets a bit too cramped on an 80-column terminal.

For ^C I've chosen "Location" because I tend to understand "Position"
as a verb, especially when seen next to "Go To Line" (even when having
two items with the same meaning next to each other doesn't make sense).

"Mark Text" has simply always been wrong.  It doesn't mark anything,
but just *sets* the mark (or unsets it, but that normally happens
automatically, no need to mention that in the label).

The "Cut Till End" and "Full Justify" get shown only on very wide
terminals, and at such widths there is enough room for each label
to write out those two labels in full.
2020-04-21 19:14:28 +02:00